aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--channels/chan_dahdi.c7
-rw-r--r--channels/sig_pri.c16
-rw-r--r--channels/sig_pri.h4
-rw-r--r--configs/chan_dahdi.conf.sample5
-rw-r--r--funcs/func_frame_trace.c3
-rw-r--r--include/asterisk/frame.h1
-rw-r--r--main/channel.c3
-rw-r--r--main/features.c1
9 files changed, 40 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 7ae9b20c9..b3731d651 100644
--- 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 ----------------
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 */
diff --git a/configs/chan_dahdi.conf.sample b/configs/chan_dahdi.conf.sample
index 17587068a..0f20c57cc 100644
--- a/configs/chan_dahdi.conf.sample
+++ b/configs/chan_dahdi.conf.sample
@@ -231,6 +231,11 @@
;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
diff --git a/funcs/func_frame_trace.c b/funcs/func_frame_trace.c
index 5863b27e8..03711ee7d 100644
--- a/funcs/func_frame_trace.c
+++ b/funcs/func_frame_trace.c
@@ -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);
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index fc7c1a07b..63cbb952f 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -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 {
diff --git a/main/channel.c b/main/channel.c
index ae61b7731..093d5f619 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -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:
diff --git a/main/features.c b/main/features.c
index 7b856e132..d22416226 100644
--- a/main/features.c
+++ b/main/features.c
@@ -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;