[Asterisk-code-review] fix for ASTERISK-25558 (asterisk[master])

Ward van Wanrooij asteriskteam at digium.com
Wed Nov 18 12:58:03 CST 2015


Ward van Wanrooij has uploaded a new change for review.

  https://gerrit.asterisk.org/1649

Change subject: fix for ASTERISK-25558
......................................................................

fix for ASTERISK-25558

Change-Id: I88f7036ee084bb3f43b74f15612695c6708f74aa
---
M channels/chan_sip.c
M channels/sip/include/sip.h
M configs/samples/sip.conf.sample
3 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/49/1649/1

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 158dc7b..befafd6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14630,7 +14630,7 @@
 
 	switch (data->state) {
 	case (AST_EXTENSION_RINGING | AST_EXTENSION_INUSE):
-		statestring = (sip_cfg.notifyringing) ? "early" : "confirmed";
+		statestring = (sip_cfg.notifyringingprio) ? "early" : "confirmed";
 		local_state = NOTIFY_INUSE;
 		pidfstate = "busy";
 		pidfnote = "Ringing";
@@ -21122,6 +21122,7 @@
 	ast_cli(a->fd, "  Outbound reg. retry 403:%d\n", global_reg_retry_403);
 	ast_cli(a->fd, "  Notify ringing state:   %s\n", AST_CLI_YESNO(sip_cfg.notifyringing));
 	if (sip_cfg.notifyringing) {
+		ast_cli(a->fd, "    Priority over inuse:  %s\n", AST_CLI_YESNO(sip_cfg.notifyringingprio));
 		ast_cli(a->fd, "    Include CID:          %s%s\n",
 				AST_CLI_YESNO(sip_cfg.notifycid),
 				sip_cfg.notifycid == IGNORE_CONTEXT ? " (Ignoring context)" : "");
@@ -31408,6 +31409,7 @@
 	sip_cfg.legacy_useroption_parsing = DEFAULT_LEGACY_USEROPTION_PARSING;
 	sip_cfg.send_diversion = DEFAULT_SEND_DIVERSION;
 	sip_cfg.notifyringing = DEFAULT_NOTIFYRINGING;
+	sip_cfg.notifyringingprio = DEFAULT_NOTIFYRINGINGPRIO;
 	sip_cfg.notifycid = DEFAULT_NOTIFYCID;
 	sip_cfg.notifyhold = FALSE;		/*!< Keep track of hold status for a peer */
 	sip_cfg.directrtpsetup = FALSE;		/* Experimental feature, disabled by default */
@@ -31677,6 +31679,8 @@
 			sip_cfg.directrtpsetup = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifyringing")) {
 			sip_cfg.notifyringing = ast_true(v->value);
+		} else if (!strcasecmp(v->name, "notifyringingprio")) {
+			sip_cfg.notifyringingprio = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifyhold")) {
 			sip_cfg.notifyhold = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "notifycid")) {
diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h
index 87b59f6..f0a0889 100644
--- a/channels/sip/include/sip.h
+++ b/channels/sip/include/sip.h
@@ -212,6 +212,7 @@
 #define DEFAULT_REALM          "asterisk" /*!< Realm for HTTP digest authentication */
 #define DEFAULT_DOMAINSASREALM FALSE    /*!< Use the domain option to guess the realm for registration and invite requests */
 #define DEFAULT_NOTIFYRINGING  TRUE     /*!< Notify devicestate system on ringing state */
+#define DEFAULT_NOTIFYRINGINGPRIO TRUE  /*!< Ringing notifications trump busy notifications */
 #define DEFAULT_NOTIFYCID      DISABLED	/*!< Include CID with ringing notifications */
 #define DEFAULT_PEDANTIC       TRUE     /*!< Follow SIP standards for dialog matching */
 #define DEFAULT_AUTOCREATEPEER AUTOPEERS_DISABLED    /*!< Don't create peers automagically */
@@ -757,6 +758,7 @@
 	char messagecontext[AST_MAX_CONTEXT];  /*!< Default context for out of dialog msgs. */
 	unsigned int disallowed_methods;   /*!< methods that we should never try to use */
 	int notifyringing;          /*!< Send notifications on ringing */
+	int notifyringingprio;      /*!< Ringing notifications trump busy notifications */
 	int notifyhold;             /*!< Send notifications on hold */
 	enum notifycid_setting notifycid;  /*!< Send CID with ringing notifications */
 	enum transfermodes allowtransfer;  /*!< SIP Refer restriction scheme */
diff --git a/configs/samples/sip.conf.sample b/configs/samples/sip.conf.sample
index 0fc5af2..4df60ce 100644
--- a/configs/samples/sip.conf.sample
+++ b/configs/samples/sip.conf.sample
@@ -694,7 +694,8 @@
 ;subscribecontext = default     ; Set a specific context for SUBSCRIBE requests
                                 ; Useful to limit subscriptions to local extensions
                                 ; Settable per peer/user also
-;notifyringing = no             ; Control whether subscriptions already INUSE get sent
+;notifyringing = no             ; Notify subscriptions on RINGING state (default: yes)
+;notifyringingprio = no         ; Control whether subscriptions already INUSE get sent
                                 ; RINGING when another call is sent (default: yes)
 ;notifyhold = yes               ; Notify subscriptions on HOLD state (default: no)
                                 ; Turning on notifyringing and notifyhold will add a lot

-- 
To view, visit https://gerrit.asterisk.org/1649
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88f7036ee084bb3f43b74f15612695c6708f74aa
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Ward van Wanrooij <ward at ward.nu>



More information about the asterisk-code-review mailing list