\param caller_profile the profile to assign
*/
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+SWITCH_DECLARE(void) switch_channel_step_caller_profile(switch_channel_t *channel);
/*!
\brief Retrieve the given channel's caller profile
\param channel channel to assign the profile to
\param caller_profile the profile to assign
*/
-SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+SWITCH_DECLARE(void) _switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+#define switch_channel_set_originator_caller_profile(_c, _cp) switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(_c), SWITCH_LOG_CRIT, "%s SET ORIGINATOR\n", switch_channel_get_name(_c)); _switch_channel_set_originator_caller_profile(_c, _cp)
SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
\param channel channel to assign the profile to
\param caller_profile the profile to assign
*/
-SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+SWITCH_DECLARE(void) _switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+#define switch_channel_set_originatee_caller_profile(_c, _cp) switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(_c), SWITCH_LOG_CRIT, "%s SET ORIGINATEE\n", switch_channel_get_name(_c)); _switch_channel_set_originatee_caller_profile(_c, _cp)
/*!
\brief Retrieve the given channel's originatee caller profile
SWITCH_DECLARE(void) switch_channel_state_thread_unlock(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_state_thread_trylock(switch_channel_t *channel);
+
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
if (node && other_session) {
switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
- switch_caller_profile_t *cloned_profile;
+ switch_caller_profile_t *cloned_profile, *a_cp, *b_cp;
const char *o_announce = NULL;
const char *record_template = switch_channel_get_variable(channel, "fifo_record_template");
char *expanded = NULL;
switch_channel_set_variable(other_channel, "fifo_serviced_by", my_id);
switch_channel_set_variable(other_channel, "fifo_serviced_uuid", switch_core_session_get_uuid(session));
-
switch_channel_set_flag(other_channel, CF_BREAK);
while (switch_channel_ready(channel) && switch_channel_ready(other_channel) &&
}
switch_channel_answer(channel);
- cloned_profile = switch_caller_profile_clone(other_session, switch_channel_get_caller_profile(channel));
+
+ a_cp = switch_channel_get_caller_profile(channel);
+ b_cp = switch_channel_get_caller_profile(other_channel);
+
+
+
+ cloned_profile = switch_caller_profile_clone(other_session, a_cp);
switch_assert(cloned_profile);
switch_channel_set_originator_caller_profile(other_channel, cloned_profile);
- cloned_profile = switch_caller_profile_clone(session, switch_channel_get_caller_profile(other_channel));
+ a_cp->callee_id_name = switch_core_strdup(a_cp->pool, b_cp->caller_id_name);
+ a_cp->callee_id_number = switch_core_strdup(a_cp->pool, b_cp->caller_id_number);
+
+
+ cloned_profile = switch_caller_profile_clone(session, b_cp);
switch_assert(cloned_profile);
switch_assert(cloned_profile->next == NULL);
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
+ b_cp->callee_id_name = switch_core_strdup(b_cp->pool, a_cp->caller_id_name);
+ b_cp->callee_id_number = switch_core_strdup(b_cp->pool, a_cp->caller_id_number);
+
+
ts = switch_micro_time_now();
switch_time_exp_lt(&tm, ts);
epoch_start = (long)switch_epoch_time_now(NULL);
switch_mutex_unlock(channel->profile_mutex);
}
+SWITCH_DECLARE(void) switch_channel_step_caller_profile(switch_channel_t *channel)
+{
+ switch_caller_profile_t *cp;
+
+ switch_mutex_lock(channel->profile_mutex);
+ cp = switch_caller_profile_clone(channel->session, channel->caller_profile);
+ switch_mutex_unlock(channel->profile_mutex);
+
+ switch_channel_set_caller_profile(channel, cp);
+}
SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
{
return profile;
}
-SWITCH_DECLARE(void) switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
+SWITCH_DECLARE(void) _switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
{
switch_assert(channel != NULL);
switch_assert(channel->caller_profile != NULL);
}
-SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
+SWITCH_DECLARE(void) _switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
{
switch_assert(channel != NULL);
switch_assert(channel->caller_profile != NULL);
switch_channel_set_variable(originator_channel, "original_caller_id_name", originator_cp->caller_id_name);
switch_channel_set_variable(originator_channel, "original_caller_id_number", originator_cp->caller_id_number);
+ switch_channel_step_caller_profile(originatee_channel);
+ switch_channel_step_caller_profile(originator_channel);
+
+ originator_cp = switch_channel_get_caller_profile(originator_channel);
+ originatee_cp = switch_channel_get_caller_profile(originatee_channel);
switch_channel_set_originator_caller_profile(originatee_channel, switch_caller_profile_clone(originatee_session, originator_cp));
switch_channel_set_originatee_caller_profile(originator_channel, switch_caller_profile_clone(originator_session, originatee_cp));
+
+ originator_cp->callee_id_name = switch_core_strdup(originator_cp->pool, originatee_cp->caller_id_name);
+ originator_cp->callee_id_number = switch_core_strdup(originator_cp->pool, originatee_cp->caller_id_number);
+
+ originatee_cp->callee_id_name = switch_core_strdup(originatee_cp->pool, originator_cp->caller_id_name);
+ originatee_cp->callee_id_number = switch_core_strdup(originatee_cp->pool, originator_cp->caller_id_number);
+
switch_channel_stop_broadcast(originator_channel);
switch_channel_stop_broadcast(originatee_channel);