提交 e1d49982 authored 作者: Anthony Minessale's avatar Anthony Minessale

avoiding segfault i should never be called

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2485 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 94571e3c
......@@ -1078,10 +1078,18 @@ static char *find_reg_url(switch_core_db_t *db, char *key, char *val, switch_siz
static switch_status_t exosip_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t *pool)
{
if (!outbound_profile->destination_number) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid Destination!\n");
return SWITCH_STATUS_GENERR;
}
if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) {
struct private_object *tech_pvt;
switch_channel_t *channel;
switch_core_session_add_stream(*new_session, NULL);
if ((tech_pvt =
(struct private_object *) switch_core_session_alloc(*new_session, sizeof(struct private_object))) != 0) {
......
......@@ -1415,6 +1415,11 @@ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
dest = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
if (!strchr(dest, '/')) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid Channel String\n");
return JS_TRUE;
}
if (argc > 2) {
dialplan = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论