aboutsummaryrefslogtreecommitdiffstats
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-03-04 15:28:20 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2011-03-04 15:28:20 +0000
commit7edf19861b1acc8ebe0910a925b2ac9e557bdf1e (patch)
treef3cafb2098bf62294b6581078f8b3e29a8caba83 /channels/sig_pri.c
parent08689bd8a07f9cf42dc2ac095166bfc8acda825f (diff)
Merged revisions 309445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r309445 | rmudgett | 2011-03-04 09:22:04 -0600 (Fri, 04 Mar 2011) | 46 lines Get real channel of a DAHDI call. Starting with Asterisk v1.8, the DAHDI channel name format was changed for ISDN calls to: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number> There were several reasons that the channel name had to change. 1) Call completion requires a device state for ISDN phones. The generic device state uses the channel name. 2) Calls do not necessarily have B channels. Calls placed on hold by an ISDN phone do not have B channels. 3) The B channel a call initially requests may not be the B channel the call ultimately uses. Changes to the internal implementation of the Asterisk master channel list caused deadlock problems for chan_dahdi if it needed to change the channel name. Chan_dahdi no longer changes the channel name. 4) DTMF attended transfers now work with ISDN phones because the channel name is "dialable" like the chan_sip channel names. For various reasons, some people need to know which B channel a DAHDI call is using. * Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and CHANNEL(dahdi_type) so the dialplan can determine the B channel currently in use by the channel. Use CHANNEL(no_media_path) to determine if the channel even has a B channel. * Added AMI event DAHDIChannel to associate a DAHDI channel with an Asterisk channel so AMI applications can passively determine the B channel currently in use. Calls with "no-media" as the DAHDIChannel do not have an associated B channel. No-media calls are either on hold or call-waiting. (closes issue #17683) Reported by: mrwho Tested by: rmudgett (closes issue #18603) Reported by: arjankroon Patches: issue17683_18603_v1.8_v2.patch uploaded by rmudgett (license 664) Tested by: stever28, rmudgett ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@309446 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 05d0fa4fe..4425b188e 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -932,6 +932,24 @@ static void sig_pri_open_media(struct sig_pri_chan *p)
}
}
+/*!
+ * \internal
+ * \brief Post an AMI B channel association event.
+ * \since 1.8
+ *
+ * \param p Channel private control structure.
+ *
+ * \note Assumes the private and owner are locked.
+ *
+ * \return Nothing
+ */
+static void sig_pri_ami_channel_event(struct sig_pri_chan *p)
+{
+ if (p->calls->ami_channel_event) {
+ p->calls->ami_channel_event(p->chan_pvt, p->owner);
+ }
+}
+
struct ast_channel *sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law, const struct ast_channel *requestor, int transfercapability)
{
struct ast_channel *ast;
@@ -1333,6 +1351,10 @@ static int pri_fixup_principle(struct sig_pri_span *pri, int principle, q931_cal
sig_pri_open_media(new_chan);
}
+ if (new_chan->owner) {
+ sig_pri_ami_channel_event(new_chan);
+ }
+
sig_pri_unlock_private(old_chan);
if (new_chan->owner) {
ast_channel_unlock(new_chan->owner);