properly git rid of span_id
This commit is contained in:
parent
4f6f7eb456
commit
87569c0ba9
|
@ -97,8 +97,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||||
switch_memory_pool_t **pool,
|
switch_memory_pool_t **pool,
|
||||||
switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
|
switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
|
||||||
{
|
{
|
||||||
const char *szspanid = switch_event_get_header(var_event, kSPAN_ID),
|
const char *szchanid = switch_event_get_header(var_event, kCHAN_ID),
|
||||||
*szchanid = switch_event_get_header(var_event, kCHAN_ID),
|
|
||||||
*span_name = switch_event_get_header(var_event, kSPAN_NAME);
|
*span_name = switch_event_get_header(var_event, kSPAN_NAME);
|
||||||
int chan_id;
|
int chan_id;
|
||||||
int span_id;
|
int span_id;
|
||||||
|
@ -113,23 +112,21 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||||
|
|
||||||
ctdm_private_t *tech_pvt = NULL;
|
ctdm_private_t *tech_pvt = NULL;
|
||||||
|
|
||||||
if (zstr(szchanid) || (zstr(szspanid) && zstr(span_name))) {
|
if (zstr(szchanid) || zstr(span_name)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Both ["kSPAN_ID"] and ["kCHAN_ID"] have to be set.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Both ["kSPAN_ID"] and ["kCHAN_ID"] have to be set.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
chan_id = atoi(szchanid);
|
chan_id = atoi(szchanid);
|
||||||
span_id = atoi(szspanid);
|
|
||||||
|
|
||||||
|
|
||||||
if (!span_id) {
|
if (ftdm_span_find_by_name(span_name, &span) == FTDM_SUCCESS) {
|
||||||
if (ftdm_span_find_by_name(span_name, &span) == FTDM_SUCCESS) {
|
span_id = ftdm_span_get_id(span);
|
||||||
span_id = ftdm_span_get_id(span);
|
} else {
|
||||||
} else {
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find span [%s]\n");
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find span [%s]\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!(*new_session = switch_core_session_request(ctdm.endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, 0, pool))) {
|
if (!(*new_session = switch_core_session_request(ctdm.endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, 0, pool))) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't request session.\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't request session.\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue