[asterisk-commits] kharwell: trunk r382787 - in /trunk: ./ channels/ channels/sip/include/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 11 10:22:05 CDT 2013
Author: kharwell
Date: Mon Mar 11 10:22:02 2013
New Revision: 382787
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382787
Log:
Added an option to disallow music on hold
Added an option "discard_remote_hold_retrieval" (default "no") that if set does
not trigger the music on hold event. This essentially stops telling the peer
to start music on hold.
(issue ABE-2899)
Reported by: Denis Alberto Martinez
Review: https://reviewboard.asterisk.org/r/2336/
Modified:
trunk/CHANGES
trunk/channels/chan_sip.c
trunk/channels/sip/include/sip.h
Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=382787&r1=382786&r2=382787
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Mar 11 10:22:02 2013
@@ -472,6 +472,9 @@
when using Transfer application. See refer_addheaders in sip.conf.sample.
* Added support to use private party ID information with calls.
+
+ * Adds an option discard_remote_hold_retrieval that when set stops telling
+ the peer to start music on hold.
chan_skinny
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=382787&r1=382786&r2=382787
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Mar 11 10:22:02 2013
@@ -10744,14 +10744,18 @@
}
if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && (!ast_sockaddr_isnull(sa) || !ast_sockaddr_isnull(vsa) || !ast_sockaddr_isnull(tsa) || !ast_sockaddr_isnull(isa)) && (!sendonly || sendonly == -1)) {
- ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
+ if (!ast_test_flag(&p->flags[2], SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL)) {
+ ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
+ }
/* Activate a re-invite */
ast_queue_frame(p->owner, &ast_null_frame);
change_hold_state(p, req, FALSE, sendonly);
} else if ((sockaddr_is_null_or_any(sa) && sockaddr_is_null_or_any(vsa) && sockaddr_is_null_or_any(tsa) && sockaddr_is_null_or_any(isa)) || (sendonly && sendonly != -1)) {
- ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
+ if (!ast_test_flag(&p->flags[2], SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL)) {
+ ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
S_OR(p->mohsuggest, NULL),
!ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
+ }
if (sendonly)
ast_rtp_instance_stop(p->rtp);
/* RTCP needs to go ahead, even if we're on hold!!! */
@@ -31034,6 +31038,8 @@
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
} else if (!strcasecmp(v->name, "ignore_requested_pref")) {
ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_IGNORE_PREFCAPS);
+ } else if (!strcasecmp(v->name, "discard_remote_hold_retrieval")) {
+ ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL);
} else {
ast_rtp_dtls_cfg_parse(&peer->dtls_cfg, v->name, v->value);
}
@@ -32162,6 +32168,8 @@
ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_SNOM_AOC);
} else if (!strcasecmp(v->name, "icesupport")) {
ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_ICE_SUPPORT);
+ } else if (!strcasecmp(v->name, "discard_remote_hold_retrieval")) {
+ ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL);
} else if (!strcasecmp(v->name, "parkinglot")) {
ast_copy_string(default_parkinglot, v->value, sizeof(default_parkinglot));
} else if (!strcasecmp(v->name, "refer_addheaders")) {
Modified: trunk/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sip/include/sip.h?view=diff&rev=382787&r1=382786&r2=382787
==============================================================================
--- trunk/channels/sip/include/sip.h (original)
+++ trunk/channels/sip/include/sip.h Mon Mar 11 10:22:02 2013
@@ -376,10 +376,12 @@
#define SIP_PAGE3_USE_AVPF (1 << 5) /*!< DGP: Support a minimal AVPF-compatible profile */
#define SIP_PAGE3_ICE_SUPPORT (1 << 6) /*!< DGP: Enable ICE support */
#define SIP_PAGE3_IGNORE_PREFCAPS (1 << 7) /*!< DP: Ignore prefcaps when setting up an outgoing call leg */
+#define SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL (1 << 8) /*!< DGP: Stop telling the peer to start music on hold */
#define SIP_PAGE3_FLAGS_TO_COPY \
(SIP_PAGE3_SNOM_AOC | SIP_PAGE3_SRTP_TAG_32 | SIP_PAGE3_NAT_AUTO_RPORT | SIP_PAGE3_NAT_AUTO_COMEDIA | \
- SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT | SIP_PAGE3_IGNORE_PREFCAPS )
+ SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT | SIP_PAGE3_IGNORE_PREFCAPS | \
+ SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL)
#define CHECK_AUTH_BUF_INITLEN 256
More information about the asterisk-commits
mailing list