I found that the following change allowed a successful tls session (using QjSimple): static pj_status_t mod_on_tx_msg(pjsip_tx_data *tdata) { #define CHG101109 #ifdef CHG101109 //if tcp or tls //make Contact port equal local port (as well as ip addr) pjsip_contact_hdr* contact; pjsip_sip_uri* contact_uri; if ((tdata->tp_info.transport->flag & PJSIP_TRANSPORT_SECURE) || (tdata->tp_info.transport->flag & PJSIP_TRANSPORT_RELIABLE)) { contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL); if (contact) { contact_uri = (pjsip_sip_uri*)pjsip_uri_get_uri(contact->uri); if (tdata->tp_info.transport->local_name.port) contact_uri->port = tdata->tp_info.transport->local_name.port; } } #endif return pjsip_tx_data_encode(tdata); } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20101110/7d0fa4e5/attachment-0001.html>