diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 1297c3c291f24abd041bda6449e3cf2a0ae708db..4349d39b53e01cdd83f41c37c7fc8d2e881138f0 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -5024,7 +5024,7 @@ static int unload_module(void) static int load_module(void) { int i, port; - int ntflags = 0; + int ntflags = 0, ntkc = 0; char ports[256] = ""; char tempbuf[BUFFERSIZE + 1]; char ntfile[BUFFERSIZE + 1]; @@ -5091,7 +5091,9 @@ static int load_module(void) misdn_cfg_get(0, MISDN_GEN_NTDEBUGFLAGS, &ntflags, sizeof(ntflags)); misdn_cfg_get(0, MISDN_GEN_NTDEBUGFILE, &ntfile, sizeof(ntfile)); + misdn_cfg_get( 0, MISDN_GEN_NTKEEPCALLS, &ntkc, sizeof(ntkc)); + misdn_lib_nt_keepcalls(ntkc); misdn_lib_nt_debug_init(ntflags, ntfile); if (ast_channel_register(&misdn_tech)) { diff --git a/channels/misdn/chan_misdn_config.h b/channels/misdn/chan_misdn_config.h index 42fdd8a8189dc47ecc3c0f1215d0c7ab6a949ebd..f9475bd0347d5ad42c8032bbfb3e616d1be5c6a1 100644 --- a/channels/misdn/chan_misdn_config.h +++ b/channels/misdn/chan_misdn_config.h @@ -97,6 +97,7 @@ enum misdn_cfg_elements { 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 diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index 443bc90fbcf20ca4dfce9a9167284effad7dcd50..dba065f7199fe3eec71fb68bab47eae19a833c46 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -2752,12 +2752,14 @@ static int handle_l1(msg_t *msg) 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)) @@ -2859,7 +2861,9 @@ static int handle_mgmt(msg_t *msg) 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: @@ -3866,6 +3870,18 @@ int misdn_lib_maxports_get() { /** BE AWARE WE HAVE NO CB_LOG HERE! **/ } +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; diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h index 16dec8bb9c2a82b0a982a0c80c8c7624817b5251..5dc374c4fc10fc892383b3b14121a877a11215e1 100644 --- a/channels/misdn/isdn_lib.h +++ b/channels/misdn/isdn_lib.h @@ -382,6 +382,8 @@ struct misdn_lib_iface { /***** 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); diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 71ed157ca585b3a9826795b5fe32a89e289b037f..467e0a8af5e757e7943ae8e0dc7046a9c1be9f1e 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -369,6 +369,10 @@ static const struct misdn_cfg_spec gen_spec[] = { { "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, diff --git a/configs/misdn.conf.sample b/configs/misdn.conf.sample index c3e2b741de4010632b390bd078b36329bbe00ce7..fb2925b2394856fbdb6b6134bb2e4de85d5a7abd 100644 --- a/configs/misdn.conf.sample +++ b/configs/misdn.conf.sample @@ -56,6 +56,12 @@ debug=0 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]