<p>sungtae kim has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14572">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip.c: Added disable_rport option for pjsip.conf<br><br>Currently when the pjsip making an outgoing request, it keep adding the<br>rport parameter in a request message as a default.<br><br>This causes unexpected rport handle at the other end.<br><br>Added option for disable this behaviour in the pjsip.conf.<br><br>ASTERISK-28959<br><br>Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc<br>---<br>M configs/samples/pjsip.conf.sample<br>M res/res_pjsip.c<br>M res/res_pjsip/config_system.c<br>3 files changed, 13 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/14572/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample</span><br><span>index 93fb701..a559dfa 100644</span><br><span>--- a/configs/samples/pjsip.conf.sample</span><br><span>+++ b/configs/samples/pjsip.conf.sample</span><br><span>@@ -1089,6 +1089,7 @@</span><br><span>                            ; This option must also be enabled on endpoints that</span><br><span>                            ; require this functionality.</span><br><span>                            ; (default: no)</span><br><span style="color: hsl(120, 100%, 40%);">+;disable_rport=no ; Disable the use of "rport" in outgoing requests.</span><br><span> ;type=  ; Must be of type system (default: "")</span><br><span> </span><br><span> ;==========================GLOBAL SECTION OPTIONS=========================</span><br><span>diff --git a/res/res_pjsip.c b/res/res_pjsip.c</span><br><span>index a1b1e00..32907e3 100644</span><br><span>--- a/res/res_pjsip.c</span><br><span>+++ b/res/res_pjsip.c</span><br><span>@@ -1831,6 +1831,12 @@</span><br><span>                                               </para></note></span><br><span>                                   </description></span><br><span>                                 </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+                         <configOption name="disable_rport" default="no"></span><br><span style="color: hsl(120, 100%, 40%);">+                                    <synopsis>Disable the use of rport in outgoing requests.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+                                       <description><para></span><br><span style="color: hsl(120, 100%, 40%);">+                                               Remove "rport" parameter from the outgoing requests.</span><br><span style="color: hsl(120, 100%, 40%);">+                                        </para></description></span><br><span style="color: hsl(120, 100%, 40%);">+                             </configOption></span><br><span>                                <configOption name="type"></span><br><span>                                   <synopsis>Must be of type 'system' UNLESS the object name is 'system'.</synopsis></span><br><span>                                </configOption></span><br><span>diff --git a/res/res_pjsip/config_system.c b/res/res_pjsip/config_system.c</span><br><span>index 716a6da..e16738f 100644</span><br><span>--- a/res/res_pjsip/config_system.c</span><br><span>+++ b/res/res_pjsip/config_system.c</span><br><span>@@ -59,6 +59,8 @@</span><br><span>    */</span><br><span>  unsigned int follow_early_media_fork;</span><br><span>        unsigned int accept_multiple_sdp_answers;</span><br><span style="color: hsl(120, 100%, 40%);">+     /*! Disable the use of rport in outgoing requests */</span><br><span style="color: hsl(120, 100%, 40%);">+  unsigned int disable_rport;</span><br><span> };</span><br><span> </span><br><span> static struct ast_threadpool_options sip_threadpool_options = {</span><br><span>@@ -131,6 +133,8 @@</span><br><span>       pjsip_cfg()->endpt.disable_tcp_switch =</span><br><span>           system->disable_tcp_switch ? PJ_TRUE : PJ_FALSE;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+       pjsip_cfg()->endpt.disable_rport = system->disable_rport ? PJ_TRUE : PJ_FALSE;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       return 0;</span><br><span> }</span><br><span> </span><br><span>@@ -209,6 +213,8 @@</span><br><span>                     OPT_BOOL_T, 1, FLDSET(struct system_config, follow_early_media_fork));</span><br><span>       ast_sorcery_object_field_register(system_sorcery, "system", "accept_multiple_sdp_answers", "no",</span><br><span>                       OPT_BOOL_T, 1, FLDSET(struct system_config, accept_multiple_sdp_answers));</span><br><span style="color: hsl(120, 100%, 40%);">+    ast_sorcery_object_field_register(system_sorcery, "system", "disable_rport", "no",</span><br><span style="color: hsl(120, 100%, 40%);">+                      OPT_BOOL_T, 1, FLDSET(struct system_config, disable_rport));</span><br><span> </span><br><span>     ast_sorcery_load(system_sorcery);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14572">change 14572</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/14572"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc </div>
<div style="display:none"> Gerrit-Change-Number: 14572 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>