]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Support more node type values and spam the console if an invalid one is used
authorMathieu Rene <mrene@avgs.ca>
Sun, 1 Mar 2009 23:10:17 +0000 (23:10 +0000)
committerMathieu Rene <mrene@avgs.ca>
Sun, 1 Mar 2009 23:10:17 +0000 (23:10 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@675 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c

index 5ee468a458475e4715830844fc542e348a55caac..169cae6146fb133690a5ffd83994972ad828ab56 100644 (file)
@@ -733,11 +733,11 @@ static zap_status_t zap_libpri_start(zap_span_t *span)
 
 static int str2node(char *node)
 {
-       if (!strcasecmp(node, "cpe"))
+       if (!strcasecmp(node, "cpe") || !strcasecmp(node, "user"))
                return PRI_CPE;
-       if (!strcasecmp(node, "network"))
+       if (!strcasecmp(node, "network") || !strcasecmp(node, "net"))
                return PRI_NETWORK;
-       return PRI_CPE;
+       return -1;
 }
 
 static int str2switch(char *swtype)
@@ -826,10 +826,16 @@ static ZIO_SIG_CONFIGURE_FUNCTION(zap_libpri_configure_span)
        
        while((var = va_arg(ap, char *))) {
                if (!strcasecmp(var, "node")) {
+                       int node;
                        if (!(val = va_arg(ap, char *))) {
                                break;
                        }
-                       isdn_data->node = str2node(val);
+                       node = str2node(val);
+                       if (-1 == node) {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Unknown node type %s, defaulting to CPE mode\n", val);
+                               node = PRI_CPE;
+                       }
+                       isdn_data->node = node;
                } else if (!strcasecmp(var, "switch")) {
                        if (!(val = va_arg(ap, char *))) {
                                break;