<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19412">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session: Add overlap_context option.<br><br>Adds the overlap_context option, which can be used<br>to explicitly specify a context to use for overlap<br>dialing extension matches, rather than forcibly<br>using the context configured for the endpoint.<br><br>ASTERISK-30262 #close<br><br>Change-Id: Ibbcd4a8b11402428a187fb56b8d4e7408774a0db<br>---<br>M configs/samples/pjsip.conf.sample<br>A doc/CHANGES-staging/res_pjsip_session_overlap.txt<br>M include/asterisk/res_pjsip.h<br>M res/res_pjsip/pjsip_config.xml<br>M res/res_pjsip/pjsip_configuration.c<br>M res/res_pjsip/pjsip_manager.xml<br>M res/res_pjsip_session.c<br>7 files changed, 46 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/12/19412/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 6fbdb8b..dcd7de3 100644</span><br><span>--- a/configs/samples/pjsip.conf.sample</span><br><span>+++ b/configs/samples/pjsip.conf.sample</span><br><span>@@ -616,6 +616,8 @@</span><br><span> ;aggregate_mwi=yes      ;  (default: "yes")</span><br><span> ;allow= ; Media Codec s to allow (default: "")</span><br><span> ;allow_overlap=yes ; Enable RFC3578 overlap dialing support. (default: "yes")</span><br><span style="color: hsl(120, 100%, 40%);">+;overlap_context=default ; Context to used for overlap dialing matches</span><br><span style="color: hsl(120, 100%, 40%);">+                         ; (default: same as context option)</span><br><span> ;aors=  ; AoR s to be used with the endpoint (default: "")</span><br><span> ;auth=  ; Authentication Object s associated with the endpoint (default: "")</span><br><span> ;callerid=      ; CallerID information for the endpoint (default: "")</span><br><span>diff --git a/doc/CHANGES-staging/res_pjsip_session_overlap.txt b/doc/CHANGES-staging/res_pjsip_session_overlap.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..5523f3c</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/res_pjsip_session_overlap.txt</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: res_pjsip_session</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The overlap_context option now allows explicitly</span><br><span style="color: hsl(120, 100%, 40%);">+specifying a context to use for overlap dialing matches.</span><br><span>diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h</span><br><span>index 743b19f..eaccf9b 100644</span><br><span>--- a/include/asterisk/res_pjsip.h</span><br><span>+++ b/include/asterisk/res_pjsip.h</span><br><span>@@ -1045,6 +1045,8 @@</span><br><span>       AST_STRING_FIELD_EXTENDED(geoloc_incoming_call_profile);</span><br><span>     /*! The name of the geoloc profile to apply when Asterisk sends a call to this endpoint */</span><br><span>   AST_STRING_FIELD_EXTENDED(geoloc_outgoing_call_profile);</span><br><span style="color: hsl(120, 100%, 40%);">+      /*! The context to use for overlap dialing, if different from the endpoint's context */</span><br><span style="color: hsl(120, 100%, 40%);">+   AST_STRING_FIELD_EXTENDED(overlap_context);</span><br><span>  /*! 100rel mode to use with this endpoint */</span><br><span>         enum ast_sip_100rel_mode rel100;</span><br><span> };</span><br><span>diff --git a/res/res_pjsip/pjsip_config.xml b/res/res_pjsip/pjsip_config.xml</span><br><span>index 9e3b17d..9ae7770 100644</span><br><span>--- a/res/res_pjsip/pjsip_config.xml</span><br><span>+++ b/res/res_pjsip/pjsip_config.xml</span><br><span>@@ -313,6 +313,16 @@</span><br><span>                           <configOption name="allow_overlap" default="yes"></span><br><span>                                  <synopsis>Enable RFC3578 overlap dialing support.</synopsis></span><br><span>                             </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+                         <configOption name="overlap_context"></span><br><span style="color: hsl(120, 100%, 40%);">+                                 <synopsis>Dialplan context to use for RFC3578 overlap dialing.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+                                 <description></span><br><span style="color: hsl(120, 100%, 40%);">+                                           <para>Dialplan context to use for overlap dialing extension matching.</span><br><span style="color: hsl(120, 100%, 40%);">+                                           If not specified, the context configured for the endpoint will be used.</span><br><span style="color: hsl(120, 100%, 40%);">+                                               If specified, the extensions/patterns in the specified context will be used</span><br><span style="color: hsl(120, 100%, 40%);">+                                           for determining if a full number has been received from the endpoint.</span><br><span style="color: hsl(120, 100%, 40%);">+                                         </para></span><br><span style="color: hsl(120, 100%, 40%);">+                                 </description></span><br><span style="color: hsl(120, 100%, 40%);">+                          </configOption></span><br><span>                                <configOption name="aors"></span><br><span>                                   <synopsis>AoR(s) to be used with the endpoint</synopsis></span><br><span>                                         <description><para></span><br><span>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c</span><br><span>index e63018e..f498025 100644</span><br><span>--- a/res/res_pjsip/pjsip_configuration.c</span><br><span>+++ b/res/res_pjsip/pjsip_configuration.c</span><br><span>@@ -2229,6 +2229,7 @@</span><br><span>     ast_sorcery_object_field_register(sip_sorcery, "endpoint", "asymmetric_rtp_codec", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, asymmetric_rtp_codec));</span><br><span>        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rtcp_mux", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtcp_mux));</span><br><span>  ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allow_overlap", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, allow_overlap));</span><br><span style="color: hsl(120, 100%, 40%);">+      ast_sorcery_object_field_register(sip_sorcery, "endpoint", "overlap_context", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, overlap_context));</span><br><span>  ast_sorcery_object_field_register(sip_sorcery, "endpoint", "refer_blind_progress", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, refer_blind_progress));</span><br><span>       ast_sorcery_object_field_register(sip_sorcery, "endpoint", "notify_early_inuse_ringing", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, notify_early_inuse_ringing));</span><br><span>    ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_audio_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_audio_streams));</span><br><span>@@ -2426,6 +2427,10 @@</span><br><span>                ao2_cleanup(endpoint);</span><br><span>               return NULL;</span><br><span>         }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ast_string_field_init_extended(endpoint, overlap_context)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              ao2_cleanup(endpoint);</span><br><span style="color: hsl(120, 100%, 40%);">+                return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span> </span><br><span>        if (!(endpoint->media.codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {</span><br><span>              ao2_cleanup(endpoint);</span><br><span>diff --git a/res/res_pjsip/pjsip_manager.xml b/res/res_pjsip/pjsip_manager.xml</span><br><span>index 810a5e3..475da8b 100644</span><br><span>--- a/res/res_pjsip/pjsip_manager.xml</span><br><span>+++ b/res/res_pjsip/pjsip_manager.xml</span><br><span>@@ -507,6 +507,9 @@</span><br><span>                                <parameter name="Allowoverlap"></span><br><span>                                      <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='allow_overlap']/synopsis/node())"/></para></span><br><span>                            </parameter></span><br><span style="color: hsl(120, 100%, 40%);">+                            <parameter name="OverlapContext"></span><br><span style="color: hsl(120, 100%, 40%);">+                                     <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='overlap_context']/synopsis/node())"/></para></span><br><span style="color: hsl(120, 100%, 40%);">+                           </parameter></span><br><span>                   </syntax></span><br><span>              </managerEventInstance></span><br><span>        </managerEvent></span><br><span>diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c</span><br><span>index fa3d813..50cd8cd 100644</span><br><span>--- a/res/res_pjsip_session.c</span><br><span>+++ b/res/res_pjsip_session.c</span><br><span>@@ -3690,8 +3690,10 @@</span><br><span>              ao2_ref(pickup_cfg, -1);</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* If there's an overlap_context override specified, use that; otherwise, just use the endpoint's context */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>       if (!strcmp(session->exten, pickupexten) ||</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_exists_extension(NULL, session->endpoint->context, session->exten, 1, NULL)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           ast_exists_extension(NULL, S_OR(session->endpoint->overlap_context, session->endpoint->context), session->exten, 1, NULL)) {</span><br><span>          /*</span><br><span>            * Save off the INVITE Request-URI in case it is</span><br><span>              * needed: CHANNEL(pjsip,request_uri)</span><br><span>@@ -3706,7 +3708,7 @@</span><br><span>         */</span><br><span>  if (session->endpoint->allow_overlap && (</span><br><span>              !strncmp(session->exten, pickupexten, strlen(session->exten)) ||</span><br><span style="color: hsl(0, 100%, 40%);">-          ast_canmatch_extension(NULL, session->endpoint->context, session->exten, 1, NULL))) {</span><br><span style="color: hsl(120, 100%, 40%);">+                ast_canmatch_extension(NULL, S_OR(session->endpoint->overlap_context, session->endpoint->context), session->exten, 1, NULL))) {</span><br><span>               /* Overlap partial match */</span><br><span>          return SIP_GET_DEST_EXTEN_PARTIAL;</span><br><span>   }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19412">change 19412</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/+/19412"/><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: Ibbcd4a8b11402428a187fb56b8d4e7408774a0db </div>
<div style="display:none"> Gerrit-Change-Number: 19412 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>