]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9080 - [mod_spy] Making mod_spy work with Verto channels
authorItalo Rossi <italorossib@gmail.com>
Mon, 18 Apr 2016 17:58:47 +0000 (14:58 -0300)
committerItalo Rossi <italorossib@gmail.com>
Mon, 18 Apr 2016 17:58:52 +0000 (14:58 -0300)
src/mod/applications/mod_spy/mod_spy.c

index 1a697fed06e5e62febff20038850aa28f35682c2..cc737517c113a91acefda8bc0708436dd67dc914 100644 (file)
@@ -165,8 +165,8 @@ static switch_status_t process_event(switch_event_t *event)
 {
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        switch_core_session_t *session = NULL;
-       char *username[4] = { NULL };
-       char *domain[4] = { NULL };
+       char *username[5] = { NULL };
+       char *domain[5] = { NULL };
        char key[512];
        char *uuid = NULL, *my_uuid = NULL;
        int i;
@@ -191,6 +191,18 @@ static switch_status_t process_event(switch_event_t *event)
        username[3] = switch_event_get_header(event, "variable_sip_to_user");
        domain[3] = switch_event_get_header(event, "variable_domain_name");
 
+       username[4] = switch_event_get_header(event, "variable_verto_user");
+       domain[4] = switch_event_get_header(event, "variable_verto_host");
+
+       if (username[4] && domain[4]) {
+               char *argv[5] = { 0 };
+               int argc = 0;
+               argc = switch_split(username[4], '@', argv);
+               if (argc > 0) {
+                       username[4] = argv[0];
+               }
+       }
+
        for (i = 0; i < 4; i++) {
 
                if (username[i] && domain[i]) {