add copy_xml_cdr variable

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8955 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-07-09 16:03:03 +00:00
parent fedca0da08
commit 9413988993
2 changed files with 15 additions and 0 deletions

View File

@ -100,6 +100,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_PATH_SEPARATOR "/"
#endif
#define SWITCH_URL_SEPARATOR "://"
#define SWITCH_COPY_XML_CDR_VARIABLE "copy_xml_cdr"
#define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
#define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
#define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"

View File

@ -382,6 +382,20 @@ static switch_status_t audio_bridge_on_exchange_media(switch_core_session_t *ses
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
if (switch_true(switch_channel_get_variable(channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
switch_xml_t cdr;
char *xml_text;
if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) {
if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
switch_channel_set_variable_partner(channel, "b_leg_cdr", xml_text);
switch_safe_free(xml_text);
}
switch_xml_free(cdr);
}
}
return SWITCH_STATUS_FALSE;
}