[asterisk-commits] branch crichter/0.3.0 r10224 - in /team/crichter/0.3.0: channels/ channels/mi...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 15 12:18:57 MST 2006


Author: crichter
Date: Wed Feb 15 13:18:52 2006
New Revision: 10224

URL: http://svn.digium.com/view/asterisk?rev=10224&view=rev
Log:
Added pmp_l1_check option, to make it possible to ignore the L1 state before
making a group call on a PMP Port. Providers shut down the L1 sometimes.


Modified:
    team/crichter/0.3.0/channels/chan_misdn.c
    team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
    team/crichter/0.3.0/channels/misdn/isdn_lib.c
    team/crichter/0.3.0/channels/misdn/isdn_lib.h
    team/crichter/0.3.0/channels/misdn_config.c
    team/crichter/0.3.0/configs/misdn.conf.sample

Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Wed Feb 15 13:18:52 2006
@@ -2305,8 +2305,9 @@
 					
 					if (!strcasecmp(cfg_group, group)) {
 						int port_up;
-					
-						port_up = misdn_lib_port_up(port);
+						int check;
+						misdn_cfg_get(port, MISDN_CFG_PMP_L1_CHECK, &check, sizeof(int));
+						port_up = misdn_lib_port_up(port, check);
 						
 						if ( port_up )	{
 							newbc = misdn_lib_get_free_bc(port, robin_channel);
@@ -2332,12 +2333,14 @@
 				 port=misdn_cfg_get_next_port(port)) {
 				
 				misdn_cfg_get( port, MISDN_CFG_GROUPNAME, cfg_group, BUFFERSIZE);
-				
+
+				chan_misdn_log(3,port, "Group [%s] Port [%d]\n", group, port);
 				if (!strcasecmp(cfg_group, group)) {
 					int port_up;
+					int check;
+					misdn_cfg_get(port, MISDN_CFG_PMP_L1_CHECK, &check, sizeof(int));
+					port_up = misdn_lib_port_up(port, check);
 					
-					port_up = misdn_lib_port_up(port);
-
 					chan_misdn_log(4, port, "portup:%d\n", port_up);
 					
 					if ( port_up )	{

Modified: team/crichter/0.3.0/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/chan_misdn_config.h?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/chan_misdn_config.h (original)
+++ team/crichter/0.3.0/channels/misdn/chan_misdn_config.h Wed Feb 15 13:18:52 2006
@@ -26,6 +26,7 @@
 	MISDN_CFG_RXGAIN,              /* int */
 	MISDN_CFG_TXGAIN,              /* int */
 	MISDN_CFG_TE_CHOOSE_CHANNEL,   /* int (bool) */
+	MISDN_CFG_PMP_L1_CHECK,        /* int (bool) */
 	MISDN_CFG_CONTEXT,             /* char[] */
 	MISDN_CFG_LANGUAGE,            /* char[] */
 	MISDN_CFG_MUSICCLASS,            /* char[] */

Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Wed Feb 15 13:18:52 2006
@@ -1462,27 +1462,25 @@
 }
 
 
-int misdn_lib_port_up(int port)
+int misdn_lib_port_up(int port, int check)
 {
 	struct misdn_stack *stack;
-	
+
+
 	for (stack=glob_mgr->stack_list;
 	     stack;
 	     stack=stack->next) {
 		
+		if ( !stack->ptp && !check) return 1;
+		
 		if (stack->port == port) {
-			if (stack->nt) {
-				if (stack->l1link)
-					return 1;
-				else
-					return 0;
-			} else {
-				if (stack->l1link)
-					return 1;
-				else
-					return 0;
-			}
-
+			if (stack->l1link)
+				return 1;
+			else {
+				cb_log(-1,port, "Port down [%s]\n",
+				       stack->ptp?"PP":"PMP");
+				return 0;
+			}
 		}
 	}
   

Modified: team/crichter/0.3.0/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.h?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.h (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.h Wed Feb 15 13:18:52 2006
@@ -335,7 +335,7 @@
 int misdn_lib_port_restart(int port);
 int misdn_lib_get_port_info(int port);
 
-int misdn_lib_port_up(int port);
+int misdn_lib_port_up(int port, int notcheck);
 
 int misdn_lib_get_port_up (int port) ;
      

Modified: team/crichter/0.3.0/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn_config.c?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn_config.c (original)
+++ team/crichter/0.3.0/channels/misdn_config.c Wed Feb 15 13:18:52 2006
@@ -87,6 +87,7 @@
 	{ "rxgain", MISDN_CFG_RXGAIN, MISDN_CTYPE_INT, "0", NONE },
 	{ "txgain", MISDN_CFG_TXGAIN, MISDN_CTYPE_INT, "0", NONE },
 	{ "te_choose_channel", MISDN_CFG_TE_CHOOSE_CHANNEL, MISDN_CTYPE_BOOL, "no", NONE },
+	{ "pmp_l1_check", MISDN_CFG_PMP_L1_CHECK, MISDN_CTYPE_BOOL, "yes", NONE },
 	{ "context", MISDN_CFG_CONTEXT, MISDN_CTYPE_STR, "default", NONE },
 	{ "language", MISDN_CFG_LANGUAGE, MISDN_CTYPE_STR, "en", NONE },
 	{ "musicclass", MISDN_CFG_MUSICCLASS, MISDN_CTYPE_STR, "default", NONE },

Modified: team/crichter/0.3.0/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/configs/misdn.conf.sample?rev=10224&r1=10223&r2=10224&view=diff
==============================================================================
--- team/crichter/0.3.0/configs/misdn.conf.sample (original)
+++ team/crichter/0.3.0/configs/misdn.conf.sample Wed Feb 15 13:18:52 2006
@@ -141,6 +141,19 @@
 ;
 te_choose_channel=no
 
+
+
+;
+; This option defines, if chan_misdn should check the L1 on  a PMP 
+; before makeing a group call on it. The L1 may go down for PMP Ports
+; so we might need this.
+; But be aware! a broken or plugged off cable might be used for a group call
+; as well, since chan_misdn has no chance to distinguish if the L1 is down
+; because of a lost Link or because the Provider shut it down...
+;
+; default: yes
+;
+pmp_l1_check=yes
 
 ;
 ; Send Setup_Acknowledge on incoming calls anyway (instead of PROCEEDING), 



More information about the asterisk-commits mailing list