提交 21482f01 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3521 --resolve that was not a git diff, anyway i would prefer to not feed…

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
上级 329033ee
......@@ -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));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论