]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
aded ntkeepcalls option, to avoid droƃpping calls when the L2 goes down on a PTP...
authorChristian Richter <christian.richter@beronet.com>
Mon, 12 Nov 2007 09:45:36 +0000 (09:45 +0000)
committerChristian Richter <christian.richter@beronet.com>
Mon, 12 Nov 2007 09:45:36 +0000 (09:45 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89169 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c
channels/misdn/chan_misdn_config.h
channels/misdn/isdn_lib.c
channels/misdn/isdn_lib.h
channels/misdn_config.c
configs/misdn.conf.sample

index ea8bce0dc6b10f802b105d5df3525a5b9bf12c92..a7807ab3928192a9e601fccaee22022d78640f57 100644 (file)
@@ -4997,7 +4997,7 @@ static int load_module(void)
                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 @@ static int load_module(void)
 
                misdn_lib_nt_debug_init(ntflags,ntfile);
 
+
+               misdn_cfg_get( 0, MISDN_GEN_NTKEEPCALLS, &ntkc, sizeof(int));
+               misdn_lib_nt_keepcalls(ntkc);
        }
 
        {
index 5ced271581d73cc27ff756175df6c30b9d61b1c2..f675704c04fdb3dc21357e0b33b0f865b798ca32 100644 (file)
@@ -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
index 959a2a888b2e600ed583c367d7aa5450473d252e..ae87a0e940823f28b9f811a84a87bcd6d0ce9b46 100644 (file)
@@ -2743,12 +2743,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))
@@ -2850,7 +2852,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:
@@ -3857,6 +3861,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;
index f8deb910fa5ee33f985344970d196124c93f19f3..22f5d9ff6d51c50fe117b888ac3a8111f4e0129a 100644 (file)
@@ -381,6 +381,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);
index d30b4589bd46a45439456cd94d78022487aabe07..d13ab0a0904f9d017662ac2efe15c555de729cfb 100644 (file)
@@ -358,6 +358,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,
index 97e9caf38c1b44f5e1724e9f73404b64a1291116..cd92e7dc39f295f173f0ce0fa5cdc5837ca40c87 100644 (file)
@@ -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]