summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorWard van Wanrooij <ward@ward.nu>2015-12-26 16:24:09 +0100
committerWard van Wanrooij <ward@ward.nu>2015-12-26 16:24:09 +0100
commitd4b10cfb3e41e7635385866b7f96968c6b1e9cb1 (patch)
tree9e044a3e1d8a4ceb82b839cd91edcef208f6b51f /channels/chan_sip.c
parente90bb44b76d1c34817b5ad7db34c1c595c644702 (diff)
chan_sip: option 'notifyringing' change and doc fix
In the sample sip.conf this is written with regard to notifyringing: ;notifyringing = no ; Control whether subscriptions already INUSE get sent RINGING when another call is sent (default: yes) However, this setting changes whether or not any RINGING indications are sent to subscriptions. There is no separate configurable setting that allows to control whether INUSE subscriptions also get sent RINGING. This is however a useful option, to see (using BLF) if somebody else is able to handle an incoming call or if everybody is busy. This patch corrects the documentation for notifyringing (so the documentation matches the functionality) and make notifyringing a tri-state option, by adding the value 'notinuse' (in addition to 'yes' and 'no'). When notifyringing = notinuse, only subscriptions that are not INUSE are sent the RINGING signal. The default setting for notifyringing remains set to yes, so the default behaviour is not affected. ASTERISK-25558 Change-Id: I88f7036ee084bb3f43b74f15612695c6708f74aa
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 158dc7b18..fa4b864b1 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14630,7 +14630,7 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
switch (data->state) {
case (AST_EXTENSION_RINGING | AST_EXTENSION_INUSE):
- statestring = (sip_cfg.notifyringing) ? "early" : "confirmed";
+ statestring = (sip_cfg.notifyringing == NOTIFYRINGING_ENABLED) ? "early" : "confirmed";
local_state = NOTIFY_INUSE;
pidfstate = "busy";
pidfnote = "Ringing";
@@ -21120,7 +21120,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_
ast_cli(a->fd, " Outbound reg. timeout: %d secs\n", global_reg_timeout);
ast_cli(a->fd, " Outbound reg. attempts: %d\n", global_regattempts_max);
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));
+ ast_cli(a->fd, " Notify ringing state: %s%s\n", AST_CLI_YESNO(sip_cfg.notifyringing), sip_cfg.notifyringing == NOTIFYRINGING_NOTINUSE ? " (when not in use)" : "");
if (sip_cfg.notifyringing) {
ast_cli(a->fd, " Include CID: %s%s\n",
AST_CLI_YESNO(sip_cfg.notifycid),
@@ -31676,7 +31676,11 @@ static int reload_config(enum channelreloadreason reason)
} else if (!strcasecmp(v->name, "directrtpsetup")) {
sip_cfg.directrtpsetup = ast_true(v->value);
} else if (!strcasecmp(v->name, "notifyringing")) {
- sip_cfg.notifyringing = ast_true(v->value);
+ if (!strcasecmp(v->value, "notinuse")) {
+ sip_cfg.notifyringing = NOTIFYRINGING_NOTINUSE;
+ } else {
+ sip_cfg.notifyringing = ast_true(v->value) ? NOTIFYRINGING_ENABLED : NOTIFYRINGING_DISABLED;
+ }
} else if (!strcasecmp(v->name, "notifyhold")) {
sip_cfg.notifyhold = ast_true(v->value);
} else if (!strcasecmp(v->name, "notifycid")) {