diff --git a/src/mod/endpoints/mod_iax/mod_iax.c b/src/mod/endpoints/mod_iax/mod_iax.c index 6929c69852..186dea3e94 100644 --- a/src/mod/endpoints/mod_iax/mod_iax.c +++ b/src/mod/endpoints/mod_iax/mod_iax.c @@ -763,8 +763,17 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s assert(tech_pvt != NULL); switch (msg->message_id) { + case SWITCH_MESSAGE_INDICATE_REJECT: + { + if (tech_pvt->iax_session) { + iax_reject(tech_pvt->iax_session, msg->string_arg ? msg->string_arg : "Call Rejected"); + } + } + break; case SWITCH_MESSAGE_INDICATE_ANSWER: - channel_answer_channel(session); + { + channel_answer_channel(session); + } break; default: break; diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index bcabf92bc6..959515206e 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -1788,9 +1788,9 @@ static JSBool session_execute(JSContext * cx, JSObject * obj, uintN argc, jsval channel = switch_core_session_get_channel(jss->session); assert(channel != NULL); - - CHANNEL_SANITY_CHECK(); - + /* you can execute some apps before you answer */ + /* CHANNEL_SANITY_CHECK(); */ + if (argc > 0) { const switch_application_interface_t *application_interface;