]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix dest parser to not hit false positive
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 4 Nov 2009 16:46:17 +0000 (16:46 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 4 Nov 2009 16:46:17 +0000 (16:46 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15350 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 2dc54d22bb0ac8a8796deface53f3e09c24fa0f4..6b2e221187498fc63a3dc5e5b6641dd7b33a0476 100644 (file)
@@ -3069,12 +3069,18 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
        switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
 
        dest_num = switch_core_session_strdup(nsession, dest);
-       if ((p = strchr(dest_num, ':'))) {
-               dest_num = p + 1;
-               if ((p = strchr(dest_num, '@'))) {
-                       *p = '\0';
+       if ((p = strchr(dest_num, '@'))) {
+               *p = '\0';
+               
+               if ((p = strrchr(dest_num, '/'))) {
+                       dest_num = p + 1;
+               } else if ((p = (char *)switch_stristr("sip:", dest_num))) {
+                       dest_num = p + 4;
+               } else if ((p = (char *)switch_stristr("sips:", dest_num))) {
+                       dest_num = p + 5;
                }
        }
+       
 
        caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
        caller_profile->destination_number = switch_core_strdup(caller_profile->pool, dest_num);