aboutsummaryrefslogtreecommitdiffstats
path: root/channels/misdn
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-15 20:56:21 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-15 20:56:21 +0000
commite1603c3999687e71e07f39d0c06ed70be29bd8e3 (patch)
treebc2b727f966efad9653d0526cdd5c63fa1a7caa5 /channels/misdn
parent7108110fd3c79e0e853c81fc97695ff27f362262 (diff)
Merged revisions 287017 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r287017 | rmudgett | 2010-09-15 15:53:38 -0500 (Wed, 15 Sep 2010) | 65 lines Merged revision 287014 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier .......... r287014 | rmudgett | 2010-09-15 15:32:24 -0500 (Wed, 15 Sep 2010) | 58 lines The handling of call transfer signaling for mISDN PTMP is not fully implemented. The handling of call transfer signaling for mISDN PTMP is not fully implemented. The signaling of number updates with ISDN/DSS1 ECT supplementary services (ETS 300 369-1) comes along with a notification indicator IE and redirection number IE for PTMP. The implementation in the current Asterisk mISDN channel unfortunately can handle these information elements only in a NOTIFY message. These information elements are also signaled in a FACILTY message with a RequestSubaddress facility, when the subscriber is already in the active state (see 9.2.4 and 9.2.5 of ETS 300 369-1). ********** abe_2526_ast.patch * Added support to handle the notification indicator IE and redirection number IE with the RequestSubaddress facility. * Made misdn_update_connected_line() send a NOTIFY message if Asterisk originated the call and it is not connected yet. * Made misdn_update_connected_line() send a FACILITY message if the call is already connected. This patch requires the presence of the associated mISDN patches to compile. I had to enhance mISDN to allow the notification indicator IE and the redirection number IE to be used with a FACILITY message. Earlier versions of the Digium enhanced mISDN are no longer going to work. ********** abe_2526_misdn.patch * Made an incoming FACILITY message allow the presence of the notification indicator IE and the redirection number IE. ********** abe_2526_misdnuser_v3.patch * Added support to send and receive a FACILITY message with the notification indicator IE and the redirection number IE. * Added the ability to send a NOTIFY message in PTMP/NT mode to all responding subcalls in Q.931 states 6, 7, 8, 9, and 25. ********** Patches: abe_2526_ast.patch uploaded by rmudgett (license 664) abe_2526_misdn.patch uploaded by rmudgett (license 664) abe_2526_misdnuser_v3.patch uploaded by rmudgett (license 664) Tested by: rmudgett and reporter JIRA SWP-2146 JIRA ABE-2526 .......... ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287018 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn')
-rw-r--r--channels/misdn/isdn_msg_parser.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c
index fa1560e5d..3c7a8f33a 100644
--- a/channels/misdn/isdn_msg_parser.c
+++ b/channels/misdn/isdn_msg_parser.c
@@ -1282,6 +1282,13 @@ static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch
FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN);
Q931_info_t *qi = (Q931_info_t*)(msg->data+HEADER_LEN);
unsigned char *p = NULL;
+#if defined(AST_MISDN_ENHANCEMENTS)
+ int description_code;
+ int type;
+ int plan;
+ int present;
+ char number[sizeof(bc->redirecting.to.number)];
+#endif /* defined(AST_MISDN_ENHANCEMENTS) */
#ifdef DEBUG
printf("Parsing FACILITY Msg\n");
@@ -1301,6 +1308,37 @@ static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch
if (decodeFac(p, &bc->fac_in)) {
cb_log(3, bc->port, "Decoding facility ie failed! Unrecognized facility message?\n");
}
+
+#if defined(AST_MISDN_ENHANCEMENTS)
+ dec_ie_notify(facility->NOTIFY, qi, &description_code, nt, bc);
+ if (description_code < 0) {
+ bc->notify_description_code = mISDN_NOTIFY_CODE_INVALID;
+ } else {
+ bc->notify_description_code = description_code;
+ }
+
+ dec_ie_redir_dn(facility->REDIR_DN, qi, &type, &plan, &present, number, sizeof(number), nt, bc);
+ if (0 <= type) {
+ bc->redirecting.to_changed = 1;
+
+ bc->redirecting.to.number_type = type;
+ bc->redirecting.to.number_plan = plan;
+ switch (present) {
+ default:
+ case 0:
+ bc->redirecting.to.presentation = 0; /* presentation allowed */
+ break;
+ case 1:
+ bc->redirecting.to.presentation = 1; /* presentation restricted */
+ break;
+ case 2:
+ bc->redirecting.to.presentation = 2; /* Number not available */
+ break;
+ }
+ bc->redirecting.to.screening = 0; /* Unscreened */
+ strcpy(bc->redirecting.to.number, number);
+ }
+#endif /* defined(AST_MISDN_ENHANCEMENTS) */
}
static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
@@ -1324,6 +1362,12 @@ static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc,
* Clear facility information
*/
bc->fac_out.Function = Fac_None;
+
+#if defined(AST_MISDN_ENHANCEMENTS)
+ /* Clear other one shot information. */
+ bc->notify_description_code = mISDN_NOTIFY_CODE_INVALID;
+ bc->redirecting.to_changed = 0;
+#endif /* defined(AST_MISDN_ENHANCEMENTS) */
return NULL;
}
@@ -1351,6 +1395,27 @@ static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc,
enc_ie_display(&facility->DISPLAY, msg, bc->display, nt,bc);
}
+#if defined(AST_MISDN_ENHANCEMENTS)
+ if (bc->notify_description_code != mISDN_NOTIFY_CODE_INVALID) {
+ enc_ie_notify(&facility->NOTIFY, msg, bc->notify_description_code, nt, bc);
+ bc->notify_description_code = mISDN_NOTIFY_CODE_INVALID;
+ }
+
+ if (bc->redirecting.to_changed) {
+ bc->redirecting.to_changed = 0;
+ switch (bc->outgoing_colp) {
+ case 0:/* pass */
+ case 1:/* restricted */
+ enc_ie_redir_dn(&facility->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;
+ }
+ }
+#endif /* defined(AST_MISDN_ENHANCEMENTS) */
+
return msg;
}
@@ -1469,6 +1534,7 @@ static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, i
notify = (NOTIFY_t *) (msg->data + HEADER_LEN);
enc_ie_notify(&notify->NOTIFY, msg, bc->notify_description_code, nt, bc);
+ bc->notify_description_code = mISDN_NOTIFY_CODE_INVALID;
if (bc->redirecting.to_changed) {
bc->redirecting.to_changed = 0;