]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Pass a MCID request to the bridged channel.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 7 Feb 2011 23:33:44 +0000 (23:33 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 7 Feb 2011 23:33:44 +0000 (23:33 +0000)
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

CHANGES
channels/chan_dahdi.c
channels/sig_pri.c
channels/sig_pri.h
configs/chan_dahdi.conf.sample
funcs/func_frame_trace.c
include/asterisk/frame.h
main/channel.c
main/features.c

diff --git a/CHANGES b/CHANGES
index 7ae9b20c9a3bec53ef41da946c1e70570d707962..b3731d65166aec3b55215cf68b091d1acb55b9f0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -52,6 +52,7 @@ libpri channel driver (chan_dahdi) DAHDI changes
  * Added display_send and display_receive options to control how the display ie
    is handled.  To send display text from the dialplan use the SendText()
    application when the option is enabled.
+ * Added mcid_send option to allow sending a MCID request on a span.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
index 80416e5a311cd6cd710cee629bdea7f1fd125b3d..888a8f27fadd498f9957cea0258dfa23b4ec71d0 100644 (file)
@@ -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")) {
index ff700c0875f37d189b82abe89d44541035e47e3c..58f6c82b2bad4939b3b24c3fb1d10ec982a40fe5 100644 (file)
@@ -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;
index bbf517d3de34900301d0c7450211b0aee787ea80..1c17eee53704536bf06dc9ba31de26201526fdd7 100644 (file)
@@ -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 */
index 17587068a3189d90cdbda4f45e179ba36141f22f..0f20c57cce6ca786be240b0f28a1d08cead305ac 100644 (file)
 ;display_send=
 ;display_receive=
 
+; Allow sending an ISDN MCID request on this span.
+; Default disabled
+;
+;mcid_send=yes
+
 ; Allow inband audio (progress) when a call is DISCONNECTed by the far end of a PRI
 ;
 ;inbanddisconnect=yes
index 5863b27e8ffc7c5b54f0af92d6dd84ee3ee54454..03711ee7d7c90b97a5e83ab2e47d4aaae659c453 100644 (file)
@@ -308,6 +308,9 @@ static void print_frame(struct ast_frame *frame)
                case AST_CONTROL_AOC:
                        ast_verbose("SubClass: AOC\n");
                        break;
+               case AST_CONTROL_MCID:
+                       ast_verbose("SubClass: MCID\n");
+                       break;
                }
                if (frame->subclass.integer == -1) {
                        ast_verbose("SubClass: %d\n", frame->subclass.integer);
index fc7c1a07b2b2a2d2236f9ccb4dc99852de24f5b7..63cbb952fe244f1aa2bddb93bfb15444d81572f9 100644 (file)
@@ -263,6 +263,7 @@ enum ast_control_frame_type {
        AST_CONTROL_READ_ACTION = 27, /*!< Tell ast_read to take a specific action */
        AST_CONTROL_AOC = 28,           /*!< Advice of Charge with encoded generic AOC payload */
        AST_CONTROL_END_OF_Q = 29,              /*!< Indicate that this position was the end of the channel queue for a softhangup. */
+       AST_CONTROL_MCID = 30,                  /*!< Indicate that the caller is being malicious. */
 };
 
 enum ast_frame_read_action {
index ae61b77313a6bfe5cefa81fbebaff19cb8926e5a..093d5f619cb62595c4e170c16d72e74c1a6ec3b5 100644 (file)
@@ -4229,6 +4229,7 @@ static int attribute_const is_visible_indication(enum ast_control_frame_type con
        case AST_CONTROL_READ_ACTION:
        case AST_CONTROL_AOC:
        case AST_CONTROL_END_OF_Q:
+       case AST_CONTROL_MCID:
                break;
 
        case AST_CONTROL_CONGESTION:
@@ -4412,6 +4413,7 @@ int ast_indicate_data(struct ast_channel *chan, int _condition,
        case AST_CONTROL_READ_ACTION:
        case AST_CONTROL_AOC:
        case AST_CONTROL_END_OF_Q:
+       case AST_CONTROL_MCID:
                /* Nothing left to do for these. */
                res = 0;
                break;
@@ -7013,6 +7015,7 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
 
                        switch (f->subclass.integer) {
                        case AST_CONTROL_AOC:
+                       case AST_CONTROL_MCID:
                                ast_indicate_data(other, f->subclass.integer, f->data.ptr, f->datalen);
                                break;
                        case AST_CONTROL_REDIRECTING:
index 7b856e132d65461f37d36b5ede6f5c60e031f829..d22416226d9674e4871e8b573bc0c15cbf880b42 100644 (file)
@@ -3662,6 +3662,7 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
                        switch (f->subclass.integer) {
                        case AST_CONTROL_RINGING:
                        case AST_CONTROL_FLASH:
+                       case AST_CONTROL_MCID:
                        case -1:
                                ast_indicate(other, f->subclass.integer);
                                break;