[asterisk-commits] crichter: branch 1.4 r89169 - in /branches/1.4: channels/ channels/misdn/ con...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 12 03:46:22 CST 2007
Author: crichter
Date: Mon Nov 12 03:45:36 2007
New Revision: 89169
URL: http://svn.digium.com/view/asterisk?view=rev&rev=89169
Log:
aded ntkeepcalls option, to avoid droÃpping calls when the L2 goes down on a PTP link. There are some pbx which do turn off the L1 for a very short while and restart it immediately. normally T310 should be started and after 10 seconds or so the calls should be dropped, this is a simple fix wihtout this timer.
Modified:
branches/1.4/channels/chan_misdn.c
branches/1.4/channels/misdn/chan_misdn_config.h
branches/1.4/channels/misdn/isdn_lib.c
branches/1.4/channels/misdn/isdn_lib.h
branches/1.4/channels/misdn_config.c
branches/1.4/configs/misdn.conf.sample
Modified: branches/1.4/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_misdn.c?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/channels/chan_misdn.c (original)
+++ branches/1.4/channels/chan_misdn.c Mon Nov 12 03:45:36 2007
@@ -4997,7 +4997,7 @@
chan_misdn_log(0, 0, "Got: %s from get_ports\n",ports);
{
- int ntflags=0;
+ int ntflags=0, ntkc=0;
char ntfile[BUFFERSIZE+1];
struct misdn_lib_iface iface = {
.cb_event = cb_events,
@@ -5013,6 +5013,9 @@
misdn_lib_nt_debug_init(ntflags,ntfile);
+
+ misdn_cfg_get( 0, MISDN_GEN_NTKEEPCALLS, &ntkc, sizeof(int));
+ misdn_lib_nt_keepcalls(ntkc);
}
{
Modified: branches/1.4/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/chan_misdn_config.h?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/channels/misdn/chan_misdn_config.h (original)
+++ branches/1.4/channels/misdn/chan_misdn_config.h Mon Nov 12 03:45:36 2007
@@ -97,6 +97,7 @@
MISDN_GEN_DYNAMIC_CRYPT, /* int (bool) */
MISDN_GEN_CRYPT_PREFIX, /* char[] */
MISDN_GEN_CRYPT_KEYS, /* char[] */
+ MISDN_GEN_NTKEEPCALLS, /* int (bool) */
MISDN_GEN_NTDEBUGFLAGS, /* int */
MISDN_GEN_NTDEBUGFILE, /* char[] */
MISDN_GEN_LAST
Modified: branches/1.4/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_lib.c?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.c (original)
+++ branches/1.4/channels/misdn/isdn_lib.c Mon Nov 12 03:45:36 2007
@@ -2743,12 +2743,14 @@
case PH_DEACTIVATE | CONFIRM:
case PH_DEACTIVATE | INDICATION:
cb_log (3, stack->port, "L1: PH L1Link Down! \n");
-
+
+#if 0
for (i=0; i<=stack->b_num; i++) {
if (global_state == MISDN_INITIALIZED) {
cb_event(EVENT_CLEANUP, &stack->bc[i], glob_mgr->user_data);
}
}
+#endif
if (stack->nt) {
if (stack->nst.l1_l2(&stack->nst, msg))
@@ -2850,7 +2852,9 @@
case SSTATUS_L1_DEACTIVATED:
cb_log(3, 0, "MGMT: SSTATUS: L1_DEACTIVATED \n");
stack->l1link=0;
+#if 0
clear_l3(stack);
+#endif
break;
case SSTATUS_L2_ESTABLISHED:
@@ -3857,6 +3861,18 @@
}
+void misdn_lib_nt_keepcalls( int kc)
+{
+#ifdef FEATURE_NET_KEEPCALLS
+ if (kc) {
+ struct misdn_stack *stack=get_misdn_stack();
+ for ( ; stack; stack=stack->next) {
+ stack->nst.feature |= FEATURE_NET_KEEPCALLS;
+ }
+ }
+#endif
+}
+
void misdn_lib_nt_debug_init( int flags, char *file )
{
int static init=0;
Modified: branches/1.4/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_lib.h?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.h (original)
+++ branches/1.4/channels/misdn/isdn_lib.h Mon Nov 12 03:45:36 2007
@@ -381,6 +381,8 @@
/***** USER IFACE **********/
+void misdn_lib_nt_keepcalls(int kc);
+
void misdn_lib_nt_debug_init( int flags, char *file );
int misdn_lib_init(char *portlist, struct misdn_lib_iface* iface, void *user_data);
Modified: branches/1.4/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn_config.c?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/channels/misdn_config.c (original)
+++ branches/1.4/channels/misdn_config.c Mon Nov 12 03:45:36 2007
@@ -358,6 +358,10 @@
{ "crypt_keys", MISDN_GEN_CRYPT_KEYS, MISDN_CTYPE_STR, NO_DEFAULT, NONE,
"Keys for cryption, you reference them in the dialplan\n"
"\tLater also in dynamic encr." },
+ { "ntkeepcalls", MISDN_GEN_NTKEEPCALLS, MISDN_CTYPE_BOOL, "no", NONE,
+ "avoid dropping calls if the L2 goes down. some nortel pbx\n"
+ "do put down the L2/L1 for some milliseconds even if there\n"
+ "are running calls. with this option you can avoid dropping them\n" },
{ "ntdebugflags", MISDN_GEN_NTDEBUGFLAGS, MISDN_CTYPE_INT, "0", NONE,
"No description yet."},
{ "ntdebugfile", MISDN_GEN_NTDEBUGFILE, MISDN_CTYPE_STR, "/var/log/misdn-nt.log", NONE,
Modified: branches/1.4/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.4/configs/misdn.conf.sample?view=diff&rev=89169&r1=89168&r2=89169
==============================================================================
--- branches/1.4/configs/misdn.conf.sample (original)
+++ branches/1.4/configs/misdn.conf.sample Mon Nov 12 03:45:36 2007
@@ -56,6 +56,12 @@
ntdebugflags=0
ntdebugfile=/var/log/misdn-nt.log
+
+; some pbx systems do cut the L1 for some milliseconds, to avoid
+; dropping running calls, we can set this flag to yes and tell
+; mISDNuser not to drop the calls on L2_RELEASE
+ntkeepcalls=no
+
; the big trace
;
; default value: [not set]
More information about the asterisk-commits
mailing list