]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_radius_cdr: Add 'Freeswitch-Direction' av pair
authorMathieu Rene <mrene@avgs.ca>
Thu, 5 May 2011 17:45:14 +0000 (13:45 -0400)
committerMathieu Rene <mrene@avgs.ca>
Thu, 5 May 2011 17:45:21 +0000 (13:45 -0400)
src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c
src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.h
src/mod/event_handlers/mod_radius_cdr/radius/dictionary

index 440cbf90a7cff3aff4e6381a5b18d947c77a42aa..1d4ec1335a0bda3ee7f044f5a9b45438425ae33c 100644 (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");
                }
index e4e5a38afcb2d0a1dda51c416c366164b0c679b2..12badeb6657afad860447e53cbcbe2558100a4e7 100644 (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
index 8c04c6dd937f1619852632bac9c9f6078ccaf1c5..e496fb321506316ece742cc376972dff14a85bee 100644 (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