From 261ab22dda0befc3816f24c210cd8a9f97118040 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 21 Dec 2010 19:46:14 +0000 Subject: [PATCH] Invalid PTMP redirecting signaling as TE towards NT. * The PTMP redirection signaling (NOTIFY redirection number and notification code, SETUP redirecting number) is also sent in PTMP/TE mode. It should only apply in PTMP/NT mode. The call setup proceeds but the network (Deutsche Telekom) reacts with ugly ISDN STATUS messages. * Don't send the redirecting number ie when PTP is also sending the DivertingLegInformation2 facility. The redirecting number ie is redundant and the network (Deutsche Telekom) complains about it. JIRA LIBPRI-53 JIRA SWP-2543 git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2175 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- pri.c | 15 ++++++++++++--- q931.c | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/pri.c b/pri.c index 3fee6a0..1288f58 100644 --- a/pri.c +++ b/pri.c @@ -1159,9 +1159,18 @@ int pri_redirecting_update(struct pri *ctrl, q931_call *call, const struct pri_p case PRI_SWITCH_EUROISDN_E1: case PRI_SWITCH_EUROISDN_T1: if (PTMP_MODE(ctrl)) { - /* PTMP mode */ - q931_notify_redirection(ctrl, call, PRI_NOTIFY_CALL_DIVERTING, - &call->redirecting.to.number); + if (NT_MODE(ctrl)) { + /* + * NT PTMP mode + * + * We should not send these messages to the network if we are + * the CPE side since phones do not redirect calls within + * themselves. Well... If you consider someone else picking up + * the handset a redirection then how is the network to know? + */ + q931_notify_redirection(ctrl, call, PRI_NOTIFY_CALL_DIVERTING, + &call->redirecting.to.number); + } break; } /* PTP mode - same behaviour as Q.SIG */ diff --git a/q931.c b/q931.c index d144eb7..9e3c4ab 100644 --- a/q931.c +++ b/q931.c @@ -2101,6 +2101,23 @@ static int transmit_redirecting_number(int full_ie, struct pri *ctrl, q931_call if (!call->redirecting.from.number.valid) { return 0; } + if (BRI_TE_PTMP(ctrl)) { + /* + * We should not send this ie to the network if we are the TE + * PTMP side since phones do not redirect calls within + * themselves. Well... If you consider someone else dialing the + * handset a redirection then how is the network to know? + */ + return 0; + } + if (call->redirecting.state != Q931_REDIRECTING_STATE_IDLE) { + /* + * There was a DivertingLegInformation2 in the message so the + * Q931_REDIRECTING_NUMBER ie is redundant. Some networks + * (Deutsche Telekom) complain about it. + */ + return 0; + } datalen = strlen(call->redirecting.from.number.str); ie->data[0] = call->redirecting.from.number.plan;