[svn-commits] rmudgett: branch 13 r433338 - in /branches/13: ./ channels/ configs/samples/ ...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Mar 24 14:26:14 CDT 2015


Author: rmudgett
Date: Tue Mar 24 14:26:11 2015
New Revision: 433338

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=433338
Log:
chan_pjsip: Add "rpid_immediate" option to prevent unnecessary "180 Ringing" messages.

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/

Added:
    branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py   (with props)
Modified:
    branches/13/CHANGES
    branches/13/channels/chan_pjsip.c
    branches/13/configs/samples/pjsip.conf.sample
    branches/13/include/asterisk/res_pjsip.h
    branches/13/res/res_pjsip.c
    branches/13/res/res_pjsip/pjsip_configuration.c

Modified: branches/13/CHANGES
URL: http://svnview.digium.com/svn/asterisk/branches/13/CHANGES?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/CHANGES (original)
+++ branches/13/CHANGES Tue Mar 24 14:26:11 2015
@@ -7,6 +7,18 @@
 === and the other UPGRADE files for older releases.
 ===
 ==============================================================================
+
+------------------------------------------------------------------------------
+--- 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 ------------

Modified: branches/13/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/channels/chan_pjsip.c?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/channels/chan_pjsip.c (original)
+++ branches/13/channels/chan_pjsip.c Tue Mar 24 14:26:11 2015
@@ -1117,7 +1117,8 @@
 
 			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->rpid_immediate
+		&& session->inv_session->state != PJSIP_INV_STATE_DISCONNECTED
 		&& is_colp_update_allowed(session)) {
 		int response_code = 0;
 

Modified: branches/13/configs/samples/pjsip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/branches/13/configs/samples/pjsip.conf.sample?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/configs/samples/pjsip.conf.sample (original)
+++ branches/13/configs/samples/pjsip.conf.sample Tue Mar 24 14:26:11 2015
@@ -628,6 +628,7 @@
                         ; 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")

Added: branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py
URL: http://svnview.digium.com/svn/asterisk/branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py?view=auto&rev=433338
==============================================================================
--- branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py (added)
+++ branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py Tue Mar 24 14:26:11 2015
@@ -1,0 +1,48 @@
+#
+# Asterisk -- An open source telephony toolkit.
+#
+# Copyright (C) 2015, Richard Mudgett
+#
+# Richard Mudgett <rmudgett at digium.com>
+#
+# See http://www.asterisk.org for more information about
+# the Asterisk project. Please do not directly contact
+# any of the maintainers of this project for assistance;
+# the project provides a web site, mailing lists and IRC
+# channels for your use.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2. See the LICENSE file
+# at the top of the source tree.
+#
+
+"""add rpid_immediate
+
+Revision ID: 23530d604b96
+Revises: 45e3f47c6c44
+Create Date: 2015-03-18 17:41:58.055412
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '23530d604b96'
+down_revision = '45e3f47c6c44'
+
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects.postgresql import ENUM
+
+YESNO_NAME = 'yesno_values'
+YESNO_VALUES = ['yes', 'no']
+
+def upgrade():
+    ############################# Enums ##############################
+
+    # yesno_values have already been created, so use postgres enum object
+    # type to get around "already created" issue - works okay with mysql
+    yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)
+
+    op.add_column('ps_endpoints', sa.Column('rpid_immediate', yesno_values))
+
+def downgrade():
+    op.drop_column('ps_endpoints', 'rpid_immediate')

Propchange: branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/13/contrib/ast-db-manage/config/versions/23530d604b96_add_rpid_immediate.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: branches/13/include/asterisk/res_pjsip.h
URL: http://svnview.digium.com/svn/asterisk/branches/13/include/asterisk/res_pjsip.h?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/include/asterisk/res_pjsip.h (original)
+++ branches/13/include/asterisk/res_pjsip.h Tue Mar 24 14:26:11 2015
@@ -613,6 +613,8 @@
 	struct ast_variable *channel_vars;
 	/*! Whether to place a 'user=phone' parameter into the request URI if user is a number */
 	unsigned int usereqphone;
+	/*! Do we send messages for connected line updates for unanswered incoming calls immediately to this endpoint? */
+	unsigned int rpid_immediate;
 };
 
 /*!

Modified: branches/13/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip.c?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/res/res_pjsip.c (original)
+++ branches/13/res/res_pjsip.c Tue Mar 24 14:26:11 2015
@@ -199,7 +199,7 @@
 						<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>
@@ -315,6 +315,27 @@
 				</configOption>
 				<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>

Modified: branches/13/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip/pjsip_configuration.c?view=diff&rev=433338&r1=433337&r2=433338
==============================================================================
--- branches/13/res/res_pjsip/pjsip_configuration.c (original)
+++ branches/13/res/res_pjsip/pjsip_configuration.c Tue Mar 24 14:26:11 2015
@@ -1710,6 +1710,7 @@
 	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, 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));




More information about the svn-commits mailing list