chan_id = ftdm_channel_get_id(fchan);
tech_init(hdata->tech_pvt, hdata->new_session, fchan);
- hdata->tech_pvt->caller_profile = hdata->caller_profile;
snprintf(name, sizeof(name), "FreeTDM/%u:%u/%s", span_id, chan_id, caller_data->dnis.digits);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connect outbound channel %s\n", name);
switch_channel_set_variable_printf(channel, "freetdm_span_number", "%d", span_id);
switch_channel_set_variable_printf(channel, "freetdm_chan_number", "%d", chan_id);
+ switch_channel_set_caller_profile(channel, hdata->caller_profile);
+ hdata->tech_pvt->caller_profile = hdata->caller_profile;
+
switch_channel_set_state(channel, CS_INIT);
sess_uuid = switch_core_session_get_uuid(hdata->new_session);
status = ftdm_channel_add_token(fchan, sess_uuid, ftdm_channel_get_token_count(fchan));
if ((*new_session = switch_core_session_request(freetdm_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
private_t *tech_pvt;
switch_caller_profile_t *caller_profile;
- switch_channel_t *channel = switch_core_session_get_channel(*new_session);
switch_core_session_add_stream(*new_session, NULL);
if (!(tech_pvt = (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t)))) {
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
caller_profile->destination_number = switch_core_strdup(caller_profile->pool, switch_str_nil(dest_num));
caller_profile->caller_id_number = switch_core_strdup(caller_profile->pool, switch_str_nil(callerid_num));
- switch_channel_set_caller_profile(channel, caller_profile);
hunting.result_cb = on_channel_found;
hunt_data.var_event = var_event;