summaryrefslogtreecommitdiff
path: root/channels/misdn
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2009-05-14 22:03:49 +0000
committerRichard Mudgett <rmudgett@digium.com>2009-05-14 22:03:49 +0000
commit7872538b83cbb2cc94df0140c5686cbcc8f66c32 (patch)
treee0f2c41e8e25a6cce74c5f115fef236b93d37d0f /channels/misdn
parent23f54f4c760427b601088fc8e5d2883319b43bf9 (diff)
Add outgoing_colp misdn.conf port parameter.
Select what to do with outgoing COLP information on this port. 0 - Send out COLP information unaltered. (default) 1 - Force COLP to restricted on all outgoing COLP information. 2 - Do not send COLP information. outgoing_colp=0 Also fixed sending the EctInform message so it always has the required redirectionNumber parameter when the status is active. JIRA ABE-1853 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/misdn')
-rw-r--r--channels/misdn/chan_misdn_config.h1
-rw-r--r--channels/misdn/isdn_lib.c2
-rw-r--r--channels/misdn/isdn_lib.h9
-rw-r--r--channels/misdn/isdn_msg_parser.c51
4 files changed, 49 insertions, 14 deletions
diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h
index 140e1ee26..40df71f97 100644
--- a/channels/misdn/chan_misdn_config.h
+++ b/channels/misdn/chan_misdn_config.h
@@ -66,6 +66,7 @@ enum misdn_cfg_elements {
MISDN_CFG_INCOMING_EARLY_AUDIO, /* int (bool) */
MISDN_CFG_ECHOCANCEL, /* int */
MISDN_CFG_CC_REQUEST_RETENTION,/* bool */
+ MISDN_CFG_OUTGOING_COLP, /* int */
#ifdef MISDN_1_2
MISDN_CFG_PIPELINE, /* char[] */
#endif
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index c0a4170e2..ec8f37f09 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -753,6 +753,8 @@ static void empty_bc(struct misdn_bchannel *bc)
bc->display_connected = 0; /* none */
bc->display_setup = 0; /* none */
+ bc->outgoing_colp = 0;/* pass */
+
bc->presentation = 0; /* allowed */
bc->set_presentation = 0;
diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h
index df11659c3..934be9830 100644
--- a/channels/misdn/isdn_lib.h
+++ b/channels/misdn/isdn_lib.h
@@ -589,6 +589,15 @@ struct misdn_bchannel {
*/
int display_setup;
+ /*!
+ * \brief Select what to do with outgoing COLP information.
+ * \details
+ * 0 - pass (Send out COLP information unaltered.)
+ * 1 - restricted (Force COLP to restricted on all outgoing COLP information.)
+ * 2 - block (Do not send COLP information.)
+ */
+ int outgoing_colp;
+
/*! \brief User set presentation restriction code
* 0=Allowed, 1=Restricted, 2=Unavailable
* \note It is settable by the misdn_set_opt() application.
diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c
index 4201cab2e..fa1560e5d 100644
--- a/channels/misdn/isdn_msg_parser.c
+++ b/channels/misdn/isdn_msg_parser.c
@@ -519,18 +519,26 @@ static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, in
enc_ie_called_pn(&setup->CALLED_PN, msg, bc->dialed.number_type, bc->dialed.number_plan, bc->dialed.number, nt, bc);
}
- if (bc->redirecting.from.number[0]) {
+ switch (bc->outgoing_colp) {
+ case 0:/* pass */
+ case 1:/* restricted */
+ if (bc->redirecting.from.number[0]) {
#if 1
- /* ETSI and Q.952 do not define the screening field */
- enc_ie_redir_nr(&setup->REDIR_NR, msg, bc->redirecting.from.number_type, bc->redirecting.from.number_plan,
- bc->redirecting.from.presentation, 0, bc->redirecting.reason,
- bc->redirecting.from.number, nt, bc);
+ /* ETSI and Q.952 do not define the screening field */
+ enc_ie_redir_nr(&setup->REDIR_NR, msg, bc->redirecting.from.number_type,
+ bc->redirecting.from.number_plan, bc->redirecting.from.presentation, 0,
+ bc->redirecting.reason, bc->redirecting.from.number, nt, bc);
#else
- /* Q.931 defines the screening field */
- enc_ie_redir_nr(&setup->REDIR_NR, msg, bc->redirecting.from.number_type, bc->redirecting.from.number_plan,
- bc->redirecting.from.presentation, bc->redirecting.from.screening, bc->redirecting.reason,
- bc->redirecting.from.number, nt, bc);
+ /* Q.931 defines the screening field */
+ enc_ie_redir_nr(&setup->REDIR_NR, msg, bc->redirecting.from.number_type,
+ bc->redirecting.from.number_plan, bc->redirecting.from.presentation,
+ bc->redirecting.from.screening, bc->redirecting.reason,
+ bc->redirecting.from.number, nt, bc);
#endif
+ }
+ break;
+ default:
+ break;
}
if (bc->keypad[0]) {
@@ -667,8 +675,16 @@ static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc,
enc_ie_date(&connect->DATE, msg, now, nt,bc);
}
- enc_ie_connected_pn(&connect->CONNECT_PN, msg, bc->connected.number_type, bc->connected.number_plan,
- bc->connected.presentation, bc->connected.screening, bc->connected.number, nt, bc);
+ switch (bc->outgoing_colp) {
+ case 0:/* pass */
+ case 1:/* restricted */
+ enc_ie_connected_pn(&connect->CONNECT_PN, msg, bc->connected.number_type,
+ bc->connected.number_plan, bc->connected.presentation,
+ bc->connected.screening, bc->connected.number, nt, bc);
+ break;
+ default:
+ break;
+ }
if (nt && bc->connected.presentation == 0) {
char display[sizeof(bc->display)];
@@ -1456,9 +1472,16 @@ static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, i
if (bc->redirecting.to_changed) {
bc->redirecting.to_changed = 0;
- enc_ie_redir_dn(&notify->REDIR_DN, msg, bc->redirecting.to.number_type,
- bc->redirecting.to.number_plan, bc->redirecting.to.presentation,
- bc->redirecting.to.number, nt, bc);
+ switch (bc->outgoing_colp) {
+ case 0:/* pass */
+ case 1:/* restricted */
+ enc_ie_redir_dn(&notify->REDIR_DN, msg, bc->redirecting.to.number_type,
+ bc->redirecting.to.number_plan, bc->redirecting.to.presentation,
+ bc->redirecting.to.number, nt, bc);
+ break;
+ default:
+ break;
+ }
}
return msg;
}