CF_SERVICE - Channel has a service thread
CF_TAGGED - Channel is tagged
CF_WINNER - Channel is the winner
+CF_REUSE_CALLER_PROFILE - Channel reuse caller profile
CF_CONTROLLED - Channel is under control
CF_PROXY_MODE - Channel has no media
CF_SUSPEND - Suspend i/o
CF_SERVICE,
CF_TAGGED,
CF_WINNER,
+ CF_REUSE_CALLER_PROFILE,
CF_CONTROLLED,
CF_PROXY_MODE,
CF_PROXY_OFF,
}
}
+SWITCH_STANDARD_APP(reuse_caller_profile_function)
+{
+ switch_channel_t *channel;
+ channel = switch_core_session_get_channel(session);
+ switch_channel_set_flag(channel, CF_REUSE_CALLER_PROFILE);
+}
+
SWITCH_STANDARD_APP(queue_dtmf_function)
{
switch_channel_queue_dtmf_string(switch_core_session_get_channel(session), (const char *) data);
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "deflect", "Send call deflect", "Send a call deflect.", deflect_function, "<deflect_data>", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "recovery_refresh", "Send call recovery_refresh", "Send a call recovery_refresh.", recovery_refresh_function, "", SAF_SUPPORT_NOMEDIA);
+ SWITCH_ADD_APP(app_interface, "reuse_caller_profile", "Reuse the caller profile", "Reuse the caller profile", reuse_caller_profile_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "queue_dtmf", "Queue dtmf to be sent", "Queue dtmf to be sent from a session", queue_dtmf_function, "<dtmf_data>",
SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "send_dtmf", "Send dtmf to be sent", "Send dtmf to be sent from a session", send_dtmf_function, "<dtmf_data>",
extension = "service";
}
- new_profile = switch_caller_profile_clone(session, profile);
+
+ if (switch_channel_test_flag(channel, CF_REUSE_CALLER_PROFILE)){
+ new_profile = switch_channel_get_caller_profile(channel);
+ } else {
+ new_profile = switch_caller_profile_clone(session, profile);
+ }
new_profile->dialplan = switch_core_strdup(new_profile->pool, use_dialplan);
new_profile->context = switch_core_strdup(new_profile->pool, use_context);
switch_core_session_rwunlock(other_session);
}
- switch_channel_set_caller_profile(channel, new_profile);
+ if (!switch_channel_test_flag(channel, CF_REUSE_CALLER_PROFILE)){
+ switch_channel_set_caller_profile(channel, new_profile);
+ }
switch_channel_set_state(channel, CS_ROUTING);
switch_channel_audio_sync(channel);