static switch_status_t my_on_routing(switch_core_session_t *session)
{
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
rc_handle *rad_config;
switch_status_t retval = SWITCH_STATUS_TERM;
static switch_status_t my_on_reporting(switch_core_session_t *session)
{
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
rc_handle *rad_config;
switch_status_t retval = SWITCH_STATUS_TERM;
static JSBool session_cdr(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
{
struct js_session *jss = JS_GetPrivate(cx, obj);
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
/*Always a pessimist... sheesh! */
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
static switch_status_t my_on_reporting(switch_core_session_t *session)
{
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
char *xml_text = NULL;
char *path = NULL;
char *curl_xml_text = NULL;
SWITCH_DECLARE(char *) CoreSession::getXMLCDR()
{
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
this_check((char *)"");
sanity_check((char *)"");
char tmp[512], *f;
int cdr_off = 0, v_off = 0, cd_off = 0;
- if (!(cdr = switch_xml_new("cdr"))) {
- return SWITCH_STATUS_SUCCESS;
+ if (*xml_cdr) {
+ cdr = *xml_cdr;
+ } else {
+ if (!(cdr = switch_xml_new("cdr"))) {
+ return SWITCH_STATUS_SUCCESS;
+ }
}
if (!(x_channel_data = switch_xml_add_child_d(cdr, "channel_data", cdr_off++))) {
}
if (switch_channel_down(peer_channel) && switch_true(switch_channel_get_variable(peer_channel, SWITCH_COPY_XML_CDR_VARIABLE))) {
- switch_xml_t cdr;
+ switch_xml_t cdr = NULL;
char *xml_text;
switch_channel_wait_for_state(peer_channel, caller_channel, CS_DESTROY);