]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3521 --resolve that was not a git diff, anyway i would prefer to not feed null...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Aug 2011 13:46:40 +0000 (08:46 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 25 Aug 2011 13:46:40 +0000 (08:46 -0500)
src/include/switch_utils.h
src/switch_ivr_originate.c

index f798e92386d9c61d6ee8ac6362c8cf5a9bf26dd2..b5a1fa1868f3b21521451af4fb7a168d99d2b271 100644 (file)
@@ -426,6 +426,8 @@ static inline char *switch_sanitize_number(char *number)
        char warp[] = "/:";
        int i;
 
+       switch_assert(number);
+
        if (!(strchr(p, '/') || strchr(p, ':') || strchr(p, '@'))) {
                return number;
        }
index 2c84f760a7827665a073df6e593a26daf7f2ad4d..c2c8f5072757ec2843c8e3116f6a6f50ac076d6b 100644 (file)
@@ -2353,6 +2353,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        }
                                }
 
+                               if (zstr(new_profile->destination_number)) {
+                                       if (caller_channel) {
+                                               switch_channel_hangup(caller_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                                       }
+                                       status = SWITCH_STATUS_FALSE;
+                                       goto done;
+                               }
+
                                new_profile->callee_id_name = switch_core_strdup(new_profile->pool, "Outbound Call");
                                new_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(new_profile->pool, new_profile->destination_number));