mod_radius_cdr: Add 'Freeswitch-Direction' av pair

This commit is contained in:
Mathieu Rene 2011-05-05 13:45:14 -04:00
parent eb13414051
commit a5170df009
3 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,7 @@
* Contributor(s):
*
* Chris Parker <cparker@segv.org>
* Mathieu Rene <mrene@avgs.ca>
*
*
* mod_radius_cdr.c -- RADIUS CDR Module
@ -628,6 +629,17 @@ static switch_status_t my_on_reporting(switch_core_session_t *session)
rc_destroy(rad_config);
goto end;
}
{
const char *direction_str = profile->direction == SWITCH_CALL_DIRECTION_INBOUND ? "inbound" : "outbound";
if (rc_avpair_add(rad_config, &send, PW_FS_DIRECTION, (void *) direction_str, -1, PW_FS_PEC) == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Freeswitch-Direction: %s\n", direction_str);
rc_destroy(rad_config);
goto end;
}
}
} else { /* no profile, can't create data to send */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "profile == NULL\n");
}

View File

@ -58,6 +58,7 @@
#define PW_FS_CALLANSWERDATE 21
#define PW_FS_CALLTRANSFERDATE 22
#define PW_FS_CALLENDDATE 23
#define PW_FS_DIRECTION 24
#endif

View File

@ -276,6 +276,7 @@ ATTRIBUTE Freeswitch-Callstartdate 20 string Freeswitch
ATTRIBUTE Freeswitch-Callanswerdate 21 string Freeswitch
ATTRIBUTE Freeswitch-Calltransferdate 22 string Freeswitch
ATTRIBUTE Freeswitch-Callenddate 23 string Freeswitch
ATTRIBUTE Freeswitch-Direction 24 string Freeswitch
#
# Freeswitch-Hangupcause