FSCORE-357

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13274 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-05-11 16:52:01 +00:00
parent 1aca63d2ec
commit bf4dbe097a
3 changed files with 17 additions and 2 deletions

View File

@ -886,6 +886,7 @@ typedef enum {
CF_FS_RTP,
CF_REPORTING,
CF_PARK,
CF_TIMESTAMP_SET,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CF_FLAG_MAX
} switch_channel_flag_t;

View File

@ -2507,6 +2507,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(switch_channel_t *
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, legbillusec);
switch_channel_set_variable(channel, "flow_billusec", tmp);
switch_channel_set_flag(channel, CF_TIMESTAMP_SET);
return status;
}

View File

@ -2048,12 +2048,24 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
if (cdr_var) {
for (i = 0; i < and_argc; i++) {
switch_channel_t *channel;
if (!originate_status[i].peer_session) {
continue;
}
channel = switch_core_session_get_channel(originate_status[i].peer_session);
switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_REPORTING, 5000);
switch_yield(100000);
switch_channel_wait_for_flag(channel,
CF_TIMESTAMP_SET,
SWITCH_TRUE,
5000,
NULL);
if (!switch_channel_test_flag(channel, CF_TIMESTAMP_SET) || !switch_core_session_running(originate_status[i].peer_session)) {
switch_core_session_reporting_state(originate_status[i].peer_session);
}
if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) {
if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total);