]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_pjsip: Add "rpid_immediate" option to prevent unnecessary "180 Ringing" messages.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 24 Mar 2015 19:41:36 +0000 (19:41 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 24 Mar 2015 19:41:36 +0000 (19:41 +0000)
Incoming PJSIP call legs that have not been answered yet send unnecessary
"180 Ringing" or "183 Progress" messages every time a connected line
update happens.  If the outgoing channel is also PJSIP then the incoming
channel will always send a "180 Ringing" or "183 Progress" message when
the outgoing channel sends the INVITE.

Consequences of these unnecessary messages:

* The caller can start hearing ringback before the far end even gets the
call.

* Many phones tend to grab the first connected line information and refuse
to update the display if it changes.  The first information is not likely
to be correct if the call goes to an endpoint not under the control of the
first Asterisk box.

When connected line first went into Asterisk in v1.8, chan_sip received an
undocumented option "rpid_immediate" that defaults to disabled.  When
enabled, the option immediately passes connected line update information
to the caller in "180 Ringing" or "183 Progress" messages as described
above.

* Added "rpid_immediate" option to prevent unnecessary "180 Ringing" or
"183 Progress" messages.  The default is "no" to disable sending the
unnecessary messages.

ASTERISK-24781 #close
Reported by: Richard Mudgett

Review: https://reviewboard.asterisk.org/r/4473/
........

Merged revisions 433338 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433339 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
channels/chan_pjsip.c
configs/samples/pjsip.conf.sample
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/pjsip_configuration.c

diff --git a/CHANGES b/CHANGES
index 36aabc72860a59acdae801ab975a1c0182c666e0..52e8f6681f8aac28519cdf3dc233331fa1217573 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -106,6 +106,18 @@ res_musiconhold
    over the channel-set musicclass. This allows separate hold-music from
    application (e.g. Queue or Dial) specified music.
 
+------------------------------------------------------------------------------
+--- Functionality changes from Asterisk 13.3.0 to Asterisk 13.4.0 ------------
+------------------------------------------------------------------------------
+
+chan_pjsip
+------------------
+ * New 'rpid_immediate' option to control if connected line update information
+   goes to the caller immediately or waits for another reason to send the
+   connected line information update.  See the online option documentation for
+   more information.  Defaults to 'no' as setting it to 'yes' can result in
+   many unnecessary messages being sent to the caller.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 13.2.0 to Asterisk 13.3.0 ------------
 ------------------------------------------------------------------------------
index 11acdffe16ea2c2c76ac11a26e2feba0d7c196d5..8d9193f93356d6f2e6b7d3c4456345421a78b61b 100644 (file)
@@ -1117,7 +1117,8 @@ static int update_connected_line_information(void *data)
 
                        ast_sip_session_refresh(session, NULL, NULL, NULL, method, generate_new_sdp);
                }
-       } else if (session->inv_session->state != PJSIP_INV_STATE_DISCONNECTED
+       } else if (session->endpoint->id.rpid_immediate
+               && session->inv_session->state != PJSIP_INV_STATE_DISCONNECTED
                && is_colp_update_allowed(session)) {
                int response_code = 0;
 
index ba8bf751ba720e6d0db313aa2f8de12f7e79ad45..d3bb518f15fbed45a19359ca30379b0a114840e4 100644 (file)
                         ; information to the called user agent (default: "yes")
 ;send_pai=no    ; Send the P Asserted Identity header (default: "no")
 ;send_rpid=no   ; Send the Remote Party ID header (default: "no")
+;rpid_immediate=no      ; Send connected line updates on unanswered incoming calls immediately. (default: "no")
 ;timers_min_se=90       ; Minimum session timers expiration period (default:
                         ; "90")
 ;timers=yes     ; Session timers for SIP packets (default: "yes")
index 57c1a598d82a6b848e53900819f81ae68bd6057a..442ee72f779fd471d6a17540020e37814a049558 100644 (file)
@@ -415,6 +415,8 @@ struct ast_sip_endpoint_id_configuration {
        unsigned int send_pai;
        /*! Do we send Remote-Party-ID headers to this endpoint? */
        unsigned int send_rpid;
+       /*! Do we send messages for connected line updates for unanswered incoming calls immediately to this endpoint? */
+       unsigned int rpid_immediate;
        /*! Do we add Diversion headers to applicable outgoing requests/responses? */
        unsigned int send_diversion;
        /*! When performing connected line update, which method should be used */
index 1d6af27a1616ab837c7dfe1661631477e79a2673..aa6a500cdc38afea7032539c8bb7173ebe6017d0 100644 (file)
                                                <para>This setting allows to choose the DTMF mode for endpoint communication.</para>
                                                <enumlist>
                                                        <enum name="rfc4733">
-                                                               <para>DTMF is sent out of band of the main audio stream.This
+                                                               <para>DTMF is sent out of band of the main audio stream.  This
                                                                supercedes the older <emphasis>RFC-2833</emphasis> used within
                                                                the older <literal>chan_sip</literal>.</para>
                                                        </enum>
                                <configOption name="send_rpid" default="no">
                                        <synopsis>Send the Remote-Party-ID header</synopsis>
                                </configOption>
+                               <configOption name="rpid_immediate" default="no">
+                                       <synopsis>Immediately send connected line updates on unanswered incoming calls.</synopsis>
+                                       <description>
+                                               <para>When enabled, immediately send <emphasis>180 Ringing</emphasis>
+                                               or <emphasis>183 Progress</emphasis> response messages to the
+                                               caller if the connected line information is updated before
+                                               the call is answered.  This can send a <emphasis>180 Ringing</emphasis>
+                                               response before the call has even reached the far end.  The
+                                               caller can start hearing ringback before the far end even gets
+                                               the call.  Many phones tend to grab the first connected line
+                                               information and refuse to update the display if it changes.  The
+                                               first information is not likely to be correct if the call
+                                               goes to an endpoint not under the control of this Asterisk
+                                               box.</para>
+                                               <para>When disabled, a connected line update must wait for
+                                               another reason to send a message with the connected line
+                                               information to the caller before the call is answered.  You can
+                                               trigger the sending of the information by using an appropriate
+                                               dialplan application such as <emphasis>Ringing</emphasis>.</para>
+                                       </description>
+                               </configOption>
                                <configOption name="timers_min_se" default="90">
                                        <synopsis>Minimum session timers expiration period</synopsis>
                                        <description><para>
index ceb90a008eb4144374e8e600073bca02b14ceffb..5a4741d906bd85001f906059c661819e2b829e2d 100644 (file)
@@ -1710,6 +1710,7 @@ int ast_res_pjsip_initialize_configuration(const struct ast_module_info *ast_mod
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "trust_id_outbound", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, id.trust_outbound));
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_pai", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, id.send_pai));
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rpid", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, id.send_rpid));
+       ast_sorcery_object_field_register(sip_sorcery, "endpoint", "rpid_immediate", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, id.rpid_immediate));
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_diversion", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, id.send_diversion));
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mailboxes", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, subscription.mwi.mailboxes));
        ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aggregate_mwi", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, subscription.mwi.aggregate));