From: Joshua Colp Date: Fri, 10 Oct 2014 12:09:39 +0000 (+0000) Subject: res_pjsip_nat: Place source port into rport of responses if 'force_rport' is on. X-Git-Tag: 12.7.0-rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29c84f001f7a4926001f7eb27952c7ca4d3c781f;p=thirdparty%2Fasterisk.git res_pjsip_nat: Place source port into rport of responses if 'force_rport' is on. When the 'force_rport' option is enabled the behavior should be the same as if the remote side placed rport into the message themselves. Therefore any responses we send should include the source port of the request in the rport of the Via header. #SIPit31 ASTERISK-24387 #close Reported by: Matt Jordan git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@425131 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c index d0c8f17f3a..572421a56d 100644 --- a/res/res_pjsip_nat.c +++ b/res/res_pjsip_nat.c @@ -62,7 +62,7 @@ static pj_bool_t handle_rx_message(struct ast_sip_endpoint *endpoint, pjsip_rx_d } if (endpoint->nat.force_rport) { - rdata->msg_info.via->rport_param = 0; + rdata->msg_info.via->rport_param = rdata->pkt_info.src_port; } return PJ_FALSE;