From: Alexander Traud Date: Fri, 13 Oct 2017 14:43:12 +0000 (+0200) Subject: res_pjsip_session: Rewrite o= with external_media_address. X-Git-Tag: 13.19.0-rc1~206^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcbf61a31e5a86452e6dd05948b10a024c6069af;p=thirdparty%2Fasterisk.git res_pjsip_session: Rewrite o= with external_media_address. PJSIP allows a domain name as external_media_address. This allows chan_pjsip to be used behind a NAT with changing IP addresses. The IP address of that domain is resolved to the c= line already. This change sets also the o= line to that domain. ASTERISK-27341 #close Change-Id: I690163b6e762042ec38b3995aa5c9bea909d8ec4 --- diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index eb16125160..c53d52d715 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -3136,6 +3136,7 @@ static void session_outgoing_nat_hook(pjsip_tx_data *tdata, struct ast_sip_trans if (ast_sip_transport_is_local(transport_state, &our_sdp_addr) || !transport_state->localnet) { ast_debug(5, "Setting external media address to %s\n", ast_sockaddr_stringify_host(&transport_state->external_media_address)); pj_strdup2(tdata->pool, &sdp->conn->addr, ast_sockaddr_stringify_host(&transport_state->external_media_address)); + pj_strdup2(tdata->pool, &sdp->origin.addr, transport->external_media_address); } }