diff options
author | Olle Johansson <oej@edvina.net> | 2006-11-16 19:29:28 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2006-11-16 19:29:28 +0000 |
commit | a6f5adefa16a7786d291bcccdd911bd067052cc8 (patch) | |
tree | 2a54b788bc3c31344e6989e00d8d53a5ef379187 /channels | |
parent | f7816736140f3f38d42c922b023191af2d338c67 (diff) |
Make it possible to enable/disable onhold tracking, in order to make life easier
for realtime users.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 76c8ae4d2..9259dc28b 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -530,6 +530,7 @@ static struct ast_codec_pref default_prefs; /*!< Default codec prefs */ static int global_limitonpeers; /*!< Match call limit on peers only */ static int global_rtautoclear; static int global_notifyringing; /*!< Send notifications on ringing */ +static int global_notifyhold; /*!< Send notifications on hold */ static int global_alwaysauthreject; /*!< Send 401 Unauthorized for all failing requests */ static int global_srvlookup; /*!< SRV Lookup on or off. Default is off, RFC behavior is on */ static int pedanticsipchecking; /*!< Extra checking ? Default off */ @@ -5274,7 +5275,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) "Uniqueid: %s\r\n", p->owner->name, p->owner->uniqueid); - sip_peer_hold(p, 0); + if (global_notifyhold) + sip_peer_hold(p, FALSE); } ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD); /* Clear both flags */ } else if (!sin.sin_addr.s_addr || sendonly ) { @@ -5292,7 +5294,8 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR); else if (sendonly == 2) /* Inactive stream */ ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_INACTIVE); - sip_peer_hold(p, 1); + if (global_notifyhold) + sip_peer_hold(p, TRUE); } return 0; @@ -10432,6 +10435,7 @@ static int sip_show_settings(int fd, int argc, char *argv[]) ast_cli(fd, " Outbound reg. timeout: %d secs\n", global_reg_timeout); ast_cli(fd, " Outbound reg. attempts: %d\n", global_regattempts_max); ast_cli(fd, " Notify ringing state: %s\n", global_notifyringing ? "Yes" : "No"); + ast_cli(fd, " Notify hold state: %s\n", global_notifyhold ? "Yes" : "No"); ast_cli(fd, " SIP Transfer mode: %s\n", transfermode2str(global_allowtransfer)); ast_cli(fd, " Max Call Bitrate: %d kbps\r\n", default_maxcallbitrate); ast_cli(fd, " Auto-Framing: %s \r\n", global_autoframing ? "Yes" : "No"); @@ -16132,6 +16136,7 @@ static int reload_config(enum channelreloadreason reason) expiry = DEFAULT_EXPIRY; global_notifyringing = DEFAULT_NOTIFYRINGING; global_limitonpeers = FALSE; /*!< Match call limit on peers only */ + global_notifyhold = FALSE; /*!< Keep track of hold status for a peer */ global_alwaysauthreject = 0; global_allowsubscribe = FALSE; ast_copy_string(global_useragent, DEFAULT_USERAGENT, sizeof(global_useragent)); @@ -16258,6 +16263,8 @@ static int reload_config(enum channelreloadreason reason) global_notifyringing = ast_true(v->value); } else if (!strcasecmp(v->name, "limitpeersonly")) { global_limitonpeers = ast_true(v->value); + } else if (!strcasecmp(v->name, "notifyhold")) { + global_notifyhold = ast_true(v->value); } else if (!strcasecmp(v->name, "alwaysauthreject")) { global_alwaysauthreject = ast_true(v->value); } else if (!strcasecmp(v->name, "mohinterpret") |