]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for MODENDP-88 (too many dchans on a span)
authorMichael Jerris <mike@jerris.com>
Thu, 28 Feb 2008 00:19:07 +0000 (00:19 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 28 Feb 2008 00:19:07 +0000 (00:19 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@413 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/zap_isdn.c

index 73bf924035b18bc6dc032d9628f1b933761df685..31e17049d7423e5cf5f2fa3ffa0cffabf728d68c 100644 (file)
@@ -718,9 +718,14 @@ zap_status_t zap_isdn_configure_span(zap_span_t *span, Q921NetUser_t mode, Q931D
        
        for(i = 1; i <= span->chan_count; i++) {
                if (span->channels[i].type == ZAP_CHAN_TYPE_DQ921) {
-                       if (zap_channel_open(span->span_id, i, &dchans[x]) == ZAP_SUCCESS) {
-                               zap_log(ZAP_LOG_DEBUG, "opening d-channel #%d %d:%d\n", x, dchans[x]->span_id, dchans[x]->chan_id);
-                               x++;
+                       if (x > 1) {
+                               snprintf(span->last_error, sizeof(span->last_error), "Span has more than 2 D-Channels!");
+                               return ZAP_FAIL;
+                       } else {
+                               if (zap_channel_open(span->span_id, i, &dchans[x]) == ZAP_SUCCESS) {
+                                       zap_log(ZAP_LOG_DEBUG, "opening d-channel #%d %d:%d\n", x, dchans[x]->span_id, dchans[x]->chan_id);
+                                       x++;
+                               }
                        }
                }
        }