diff options
author | Richard Mudgett <rmudgett@digium.com> | 2012-03-13 21:18:31 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2012-03-13 21:18:31 +0000 |
commit | a22b56235ba019d83260aac47121e5aa155de6ee (patch) | |
tree | 6663f978f3557b820c67141b6f65fe00c1fec278 /channels/sig_pri.c | |
parent | cb94c35a8524323b52a3c66eff4d15f72778a7d7 (diff) |
Add ability for chan_dahdi ISDN to block connected line updates per span.
Added new chan_dahdi.conf colp_send option parameter to block connected
line updates per span.
(closes issue ASTERISK-17025)
Reported by: Michael Smith
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r-- | channels/sig_pri.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 093d8ad83..feb86fdae 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -8019,8 +8019,34 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi struct pri_party_connected_line connected; int dialplan; int prefix_strip; + int colp_allowed = 0; pri_grab(p, p->pri); + + /* Check if a connected line update is allowed at this time. */ + switch (p->pri->colp_send) { + case SIG_PRI_COLP_BLOCK: + break; + case SIG_PRI_COLP_CONNECT: + /* + * Outgoing calls receive CONNECT and act like an update before + * the call is connected. + */ + if (p->call_level <= SIG_PRI_CALL_LEVEL_ALERTING && !p->outgoing) { + colp_allowed = 1; + } + break; + case SIG_PRI_COLP_UPDATE: + colp_allowed = 1; + break; + } + if (!colp_allowed) { + pri_rel(p->pri); + ast_debug(1, "Blocked AST_CONTROL_CONNECTED_LINE on %s\n", + ast_channel_name(chan)); + break; + } + memset(&connected, 0, sizeof(connected)); sig_pri_party_id_from_ast(&connected.id, &ast_channel_connected(chan)->id); |