mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 00:22:35 +00:00
FS-3521 --resolve that was not a git diff, anyway i would prefer to not feed null to this function by practice because its the sign o f a bigger problem so I added an assert so we can tell if it happens again and protected against it from where its actually happening because NULL destination is not acceptable
This commit is contained in:
parent
329033ee86
commit
21482f011c
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user