提交 a5170df0 authored 作者: Mathieu Rene's avatar Mathieu Rene

mod_radius_cdr: Add 'Freeswitch-Direction' av pair

上级 eb134140
......@@ -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");
}
......
......@@ -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
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论