]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4620 --resolve expose to dl_to_user and dl_to_host as chan vars
authorKen Rice <krice@freeswitch.org>
Fri, 21 Feb 2014 22:44:07 +0000 (16:44 -0600)
committerKen Rice <krice@freeswitch.org>
Fri, 21 Feb 2014 22:51:40 +0000 (16:51 -0600)
src/mod/endpoints/mod_dingaling/mod_dingaling.c

index baf21a0c76c29f7a13ad3c509820bea042668411..b6f4f9bc1ca0b80fd425308af9fd378c9edfc9cd 100644 (file)
@@ -4238,6 +4238,22 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                }
 
                                tech_pvt->them = switch_core_session_strdup(session, ldl_session_get_callee(dlsession));
+
+                               if (tech_pvt->them && (tmp = strdup(tech_pvt->them))) {
+                                       char *p, *q;
+
+                                       if ((p = strchr(tmp, '@'))) {
+                                               *p++ = '\0';
+                                               if ((q = strchr(p, '/'))) {
+                                                       *q = '\0';
+                                               }
+                                               switch_channel_set_variable(channel, "dl_to_user", tmp);
+                                               switch_channel_set_variable(channel, "dl_to_host", p);
+                                       }
+
+                                       switch_safe_free(tmp);
+                               }
+
                                tech_pvt->us = switch_core_session_strdup(session, ldl_session_get_caller(dlsession));
 
                                if (tech_pvt->us && (tmp = strdup(tech_pvt->us))) {