static apt_bool_t mrcp_sofia_session_terminate_request(mrcp_session_t *session) { mrcp_sofia_session_t *sofia_session = session->obj; if(!sofia_session || !sofia_session->nh) { return FALSE; } nua_bye(sofia_session->nh,TAG_END()); return TRUE; }
static int luasofia_nua_handle_bye(lua_State *L) { /* get and check first argument (should be a luasofia_nua_handle_t) */ luasofia_nua_handle_t *lnh = (luasofia_nua_handle_t*) luaL_checkudata(L, 1, NUA_HANDLE_MTABLE); if (lnh->nh) { su_home_t *home = su_home_create(); /* get and check second argument (should be a tag table) */ tagi_t *tags = luasofia_tags_table_to_taglist(L, 2, home); nua_bye(lnh->nh, TAG_NEXT(tags)); su_home_unref(home); } return 0; }
static void bye_by_nua(struct dialog *dialog, nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...) { ta_list ta; struct message *bye; ta_start(ta, tag, value); nua_bye(nh, ta_tags(ta)); ta_end(ta); bye = s2_sip_wait_for_request(SIP_METHOD_BYE); fail_if(!bye); s2_sip_respond_to(bye, dialog, SIP_200_OK, TAG_END()); s2_sip_free_message(bye); fail_unless_event(nua_r_bye, 200); fail_unless(s2_check_callstate(nua_callstate_terminated)); }
static apt_bool_t mrcp_sofia_session_terminate_request(mrcp_session_t *session) { mrcp_sofia_session_t *sofia_session = session->obj; if(!sofia_session) { return FALSE; } sofia_session->terminate_requested = FALSE; apr_thread_mutex_lock(sofia_session->mutex); if(sofia_session->nh) { sofia_session->terminate_requested = TRUE; nua_bye(sofia_session->nh,TAG_END()); } apr_thread_mutex_unlock(sofia_session->mutex); if(sofia_session->terminate_requested == FALSE) { mrcp_sofia_session_destroy(sofia_session); mrcp_session_terminate_response(session); } return TRUE; }