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;
}
}
}
} 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");
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);
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);