add origination_caller_profile to log all attempted calls for a paticular leg
This commit is contained in:
parent
f3c6512ca0
commit
977a8ad7ce
|
@ -103,6 +103,7 @@ SWITCH_BEGIN_EXTERN_C
|
||||||
switch_caller_profile_flag_t flags;
|
switch_caller_profile_flag_t flags;
|
||||||
struct switch_caller_profile *originator_caller_profile;
|
struct switch_caller_profile *originator_caller_profile;
|
||||||
struct switch_caller_profile *originatee_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_caller_profile *hunt_caller_profile;
|
||||||
struct switch_channel_timetable *times;
|
struct switch_channel_timetable *times;
|
||||||
struct switch_caller_extension *caller_extension;
|
struct switch_caller_extension *caller_extension;
|
||||||
|
|
|
@ -215,6 +215,20 @@ SWITCH_DECLARE(void) switch_channel_set_originatee_caller_profile(switch_channel
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_caller_profile_t *) switch_channel_get_originatee_caller_profile(switch_channel_t *channel);
|
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
|
\brief Retrive the given channel's unique id
|
||||||
|
|
|
@ -2035,6 +2035,36 @@ SWITCH_DECLARE(void) switch_channel_set_hunt_caller_profile(switch_channel_t *ch
|
||||||
switch_mutex_unlock(channel->profile_mutex);
|
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_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 != NULL);
|
||||||
|
|
|
@ -524,6 +524,14 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_outgoing_channel(switch_
|
||||||
switch_channel_set_originator_caller_profile(peer_channel, cloned_profile);
|
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) {
|
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_OUTGOING) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
|
|
@ -2012,6 +2012,21 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_
|
||||||
|
|
||||||
cp_off += switch_ivr_set_xml_profile_data(x_main_cp, caller_profile, 0);
|
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) {
|
if (caller_profile->originator_caller_profile) {
|
||||||
switch_caller_profile_t *cp = NULL;
|
switch_caller_profile_t *cp = NULL;
|
||||||
int off = 0;
|
int off = 0;
|
||||||
|
|
Loading…
Reference in New Issue