Hi,
I was trying to build a setup with Asterisk as a SIP server and Kamailio as a proxy, however, I couldn’t make SIP calls to be routed in a symmetric way via the proxy, despite configuring the proxy to add “rport” to SIP requests.
Looking at the Asterisk trunk code I could find a reference to symmetric routing, however, the code doesn’t seem to handle it correctly. Following is the patch that made the Asterisk work as expected.
Index: channels/chan_sip.c
===================================================================
--- channels/chan_sip.c (revision 434725)
+++ channels/chan_sip.c (working copy)
@@ -17148,7 +17148,8 @@
set_peer_nat(p, peer);
- ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT_FORCE_RPORT);
+ ast_copy_flags(&peer->flags[0], &p->flags[0], SIP_NAT_FORCE_RPORT);
+ ast_copy_flags(&peer->flags[0], &p->flags[0], SIP_NAT_RPORT_PRESENT);
if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri2, XMIT_UNRELIABLE))) {
if (sip_cancel_destroy(p))
Am I missing something?
Thanks,
Oleg