switch_caller_profile_flag_t flags;
struct switch_caller_profile *originator_caller_profile;
struct switch_caller_profile *originatee_caller_profile;
+ struct switch_caller_profile *origination_caller_profile;
struct switch_caller_profile *hunt_caller_profile;
struct switch_channel_timetable *times;
struct switch_caller_extension *caller_extension;
*/
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_profile(switch_channel_t *channel);
+/*!
+ \brief Set the given channel's origination caller profile
+ \param channel channel to assign the profile to
+ \param caller_profile the profile to assign
+*/
+SWITCH_DECLARE(void) switch_channel_set_origination_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile);
+
+/*!
+ \brief Retrive the given channel's origination caller profile
+ \param channel channel to retrive the profile from
+ \return the requested profile
+*/
+SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_origination_caller_profile(switch_channel_t *channel);
+
/*!
\brief Retrive the given channel's unique id
switch_mutex_unlock(channel->profile_mutex);
}
+SWITCH_DECLARE(void) switch_channel_set_origination_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
+{
+ switch_assert(channel != NULL);
+ switch_assert(channel->caller_profile != NULL);
+
+ switch_mutex_lock(channel->profile_mutex);
+
+ if (channel->caller_profile) {
+ caller_profile->next = channel->caller_profile->origination_caller_profile;
+ channel->caller_profile->origination_caller_profile = caller_profile;
+ }
+ switch_assert(channel->caller_profile->origination_caller_profile->next != channel->caller_profile->origination_caller_profile);
+ switch_mutex_unlock(channel->profile_mutex);
+}
+
+SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_origination_caller_profile(switch_channel_t *channel)
+{
+ switch_caller_profile_t *profile = NULL;
+ switch_assert(channel != NULL);
+
+ switch_mutex_lock(channel->profile_mutex);
+ if (channel->caller_profile) {
+ profile = channel->caller_profile->origination_caller_profile;
+ }
+ switch_mutex_unlock(channel->profile_mutex);
+
+ return 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_channel_set_originator_caller_profile(peer_channel, cloned_profile);
}
}
+
+
+ if ((profile = switch_channel_get_caller_profile(peer_channel))) {
+ if ((cloned_profile = switch_caller_profile_clone(session, profile)) != 0) {
+ switch_channel_set_origination_caller_profile(channel, cloned_profile);
+ }
+ }
+
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
cp_off += switch_ivr_set_xml_profile_data(x_main_cp, caller_profile, 0);
+ if (caller_profile->origination_caller_profile) {
+ switch_caller_profile_t *cp = NULL;
+ int off = 0;
+ if (!(x_o = switch_xml_add_child_d(x_main_cp, "origination", cp_off++))) {
+ goto error;
+ }
+
+ for (cp = caller_profile->origination_caller_profile; cp; cp = cp->next) {
+ if (!(x_caller_profile = switch_xml_add_child_d(x_o, "origination_caller_profile", off++))) {
+ goto error;
+ }
+ switch_ivr_set_xml_profile_data(x_caller_profile, cp, 0);
+ }
+ }
+
if (caller_profile->originator_caller_profile) {
switch_caller_profile_t *cp = NULL;
int off = 0;