From: Michael Jerris Date: Wed, 17 Jun 2015 15:34:35 +0000 (-0500) Subject: FS-7650: #resolve [mod_verto] Fix crash when making a call from a verto user with... X-Git-Tag: v1.6.2~462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2d0de3d8e246e42ab636cd931736cfa4a17ea36;p=thirdparty%2Ffreeswitch.git FS-7650: #resolve [mod_verto] Fix crash when making a call from a verto user with profile-variables in their user profile --- diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 9554f8ec41..2c3579f6a8 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -3301,8 +3301,6 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock err = 1; goto cleanup; } - switch_ivr_set_user(session, jsock->uid); - channel = switch_core_session_get_channel(session); switch_channel_set_direction(channel, SWITCH_CALL_DIRECTION_INBOUND); @@ -3402,6 +3400,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock } + switch_ivr_set_user(session, jsock->uid); for (hp = jsock->user_vars->headers; hp; hp = hp->next) { switch_channel_set_variable(channel, hp->name, hp->value); diff --git a/src/switch_ivr.c b/src/switch_ivr.c index ad9d5c4578..b9c773d14c 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -3284,7 +3284,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_set_user_xml(switch_core_session_t *s } } - if ((x_params = switch_xml_child(x_user, "profile-variables"))) { + if (switch_channel_get_caller_profile(channel) && (x_params = switch_xml_child(x_user, "profile-variables"))) { for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) { const char *var = switch_xml_attr(x_param, "name"); const char *val = switch_xml_attr(x_param, "value");