From 49feb747ba9b5c3243a00c9d2e8eb38194882a6b Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 7 Feb 2011 23:33:44 +0000 Subject: Pass a MCID request to the bridged channel. Pass a MCID request to the bridged channel so the bridged channel can send it to the network. The ability to send the MCID request on an ISDN span is enabled with the new chan_dahdi.conf mcid_send option. JIRA SWP-2845 JIRA ABE-2736 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306755 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_dahdi.c | 7 +++++++ channels/sig_pri.c | 16 +++++++++++++++- channels/sig_pri.h | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'channels') diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 80416e5a3..888a8f27f 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -12353,6 +12353,9 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, pris[span].pri.display_flags_send = conf->pri.pri.display_flags_send; pris[span].pri.display_flags_receive = conf->pri.pri.display_flags_receive; #endif /* defined(HAVE_PRI_DISPLAY_TEXT) */ +#if defined(HAVE_PRI_MCID) + pris[span].pri.mcid_send = conf->pri.pri.mcid_send; +#endif /* defined(HAVE_PRI_MCID) */ for (x = 0; x < PRI_MAX_TIMERS; x++) { pris[span].pri.pritimers[x] = conf->pri.pri.pritimers[x]; @@ -17307,6 +17310,10 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct } else if (!strcasecmp(v->name, "display_receive")) { confp->pri.pri.display_flags_receive = dahdi_display_text_option(v->value); #endif /* defined(HAVE_PRI_DISPLAY_TEXT) */ +#if defined(HAVE_PRI_MCID) + } else if (!strcasecmp(v->name, "mcid_send")) { + confp->pri.pri.mcid_send = ast_true(v->value); +#endif /* defined(HAVE_PRI_MCID) */ #endif /* HAVE_PRI */ #if defined(HAVE_SS7) } else if (!strcasecmp(v->name, "ss7type")) { diff --git a/channels/sig_pri.c b/channels/sig_pri.c index ff700c087..58f6c82b2 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -1917,7 +1917,12 @@ static void sig_pri_mcid_event(struct sig_pri_span *pri, const struct pri_subcmd } if (owner) { - /* The owner channel is present. */ + /* + * The owner channel is present. + * Pass the event to the peer as well. + */ + ast_queue_control(owner, AST_CONTROL_MCID); + ast_str_append(&msg, 0, "Channel: %s\r\n", owner->name); ast_str_append(&msg, 0, "UniqueID: %s\r\n", owner->uniqueid); @@ -7687,6 +7692,15 @@ int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condi } #endif /* defined(HAVE_PRI_AOC_EVENTS) */ break; +#if defined(HAVE_PRI_MCID) + case AST_CONTROL_MCID: + if (p->pri && p->pri->pri && p->pri->mcid_send) { + pri_grab(p, p->pri); + pri_mcid_req_send(p->pri->pri, p->call); + pri_rel(p->pri); + } + break; +#endif /* defined(HAVE_PRI_MCID) */ } return res; diff --git a/channels/sig_pri.h b/channels/sig_pri.h index bbf517d3d..1c17eee53 100644 --- a/channels/sig_pri.h +++ b/channels/sig_pri.h @@ -402,6 +402,10 @@ struct sig_pri_span { * appended to the initial_user_tag[]. */ unsigned int append_msn_to_user_tag:1; +#if defined(HAVE_PRI_CALL_WAITING) + /*! \brief TRUE if allow sending MCID request on this span. */ + unsigned int mcid_send:1; +#endif /* defined(HAVE_PRI_CALL_WAITING) */ int dialplan; /*!< Dialing plan */ int localdialplan; /*!< Local dialing plan */ int cpndialplan; /*!< Connected party dialing plan */ -- cgit v1.2.3