]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix group configuration bug
authorMoises Silva <moy@sangoma.com>
Tue, 12 Jan 2010 18:09:55 +0000 (18:09 +0000)
committerMoises Silva <moy@sangoma.com>
Tue, 12 Jan 2010 18:09:55 +0000 (18:09 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@955 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/mod_openzap/mod_openzap.c
libs/freetdm/src/zap_io.c
libs/freetdm/src/zap_threadmutex.c

index 3042d8e817168873bfb31627379a1558afda18ec..9d8120d0fbcf019595eb642fd6ecbaa5deac844e 100644 (file)
@@ -1103,7 +1103,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                if (zstatus == ZAP_SUCCESS && group) {
                        group_id = group->group_id;
                } else {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing span\n");
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing zap span or group: %s\n", span_name);
                        return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
                }
        }
index 567c7aff40395912daa1b2e16cd1226de16daacb..445fb7094fdadd509bd050c49e9b77ab539ed232 100644 (file)
@@ -2827,9 +2827,7 @@ static zap_status_t load_config(void)
                                }
                        } else if (!strcasecmp(var, "b-channel")) {
                                configured += zio->configure_span(span, val, ZAP_CHAN_TYPE_B, name, number);
-                               if (zap_group_add_channels(group_name, span, val) != ZAP_SUCCESS) {
-                                       zap_log(ZAP_LOG_ERROR, "Failed to add channels (%d:%s) to group\n", number, val);
-                               }
+                               zap_group_add_channels(group_name, span, val);
                        } else if (!strcasecmp(var, "d-channel")) {
                                if (d) {
                                        zap_log(ZAP_LOG_WARNING, "ignoring extra d-channel\n");
@@ -2855,7 +2853,7 @@ static zap_status_t load_config(void)
                                        len = sizeof(group_name) - 1;
                                        zap_log(ZAP_LOG_WARNING, "Truncating group name %s to %zd length\n", val, len);
                                }
-                               zap_copy_string(group_name, val, len);
+                               memcpy(group_name, val, len);
                                group_name[len] = '\0';
                        } else {
                                zap_log(ZAP_LOG_ERROR, "unknown span variable '%s'\n", var);
index edf7d3391c407ee300515fc54d948b258d889907..bae288c5614f4b0a111fc6e6a3ac45b47dac19d3 100644 (file)
@@ -300,20 +300,14 @@ OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *condition, int ms)
        int res = 0;
        if (ms > 0) {
                struct timeval t;
-               
                struct timespec waitms;
-
                gettimeofday(&t, NULL);
-
                waitms.tv_sec = t.tv_sec + ( ms / 1000 );
-
                waitms.tv_nsec = 1000*(t.tv_usec + (1000 * ( ms % 1000 )));
-
                if (waitms.tv_nsec >= ONE_BILLION) {
                                waitms.tv_sec++;
-                               waitms.tv_nsec-= ONE_BILLION;
+                               waitms.tv_nsec -= ONE_BILLION;
                }
-
                res = pthread_cond_timedwait(&condition->condition, &condition->mutex->mutex, &waitms);
        } else {
                res = pthread_cond_wait(&condition->condition, &condition->mutex->mutex);