switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->file, "", msg->line, "", SWITCH_LOG_DEBUG, "Deliver %s => %s %s\n", msg->from_jid, msg->to_jid, iks_string(iks_stack(msg->payload), msg->payload));
actor->send_fn(actor, msg);
switch_mutex_unlock(actor->mutex);
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
} else if (!msg->is_reply) {
/* unknown actor */
RAYO_SEND_REPLY(globals.server, msg->from_jid, iks_new_error(msg->payload, STANZA_ERROR_ITEM_NOT_FOUND));
/**
* Get access to Rayo actor with JID.
* @param jid the JID
- * @return the actor or NULL. Call RAYO_UNLOCK() when done with pointer.
+ * @return the actor or NULL. Call RAYO_RELEASE() when done with pointer.
*/
struct rayo_actor *rayo_actor_locate(const char *jid, const char *file, int line)
{
/**
* Get exclusive access to Rayo actor with internal ID
* @param id the internal ID
- * @return the actor or NULL. Call RAYO_UNLOCK() when done with pointer.
+ * @return the actor or NULL. Call RAYO_RELEASE() when done with pointer.
*/
struct rayo_actor *rayo_actor_locate_by_id(const char *id, const char *file, int line)
{
/**
* Increment actor ref count - locks from destruction.
*/
-void rayo_actor_rdlock(struct rayo_actor *actor, const char *file, int line)
+void rayo_actor_retain(struct rayo_actor *actor, const char *file, int line)
{
if (actor) {
switch_mutex_lock(globals.actors_mutex);
}
/**
- * Unlock rayo actor
+ * Release rayo actor reference
*/
-void rayo_actor_unlock(struct rayo_actor *actor, const char *file, int line)
+void rayo_actor_release(struct rayo_actor *actor, const char *file, int line)
{
if (actor) {
switch_mutex_lock(globals.actors_mutex);
actor->ref_count--;
if (actor->ref_count < 0) {
/* too many unlocks detected! */
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "", line, "", SWITCH_LOG_WARNING, "Unlock %s: ref count = %i\n", RAYO_JID(actor), actor->ref_count);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "", line, "", SWITCH_LOG_WARNING, "Release %s: ref count = %i\n", RAYO_JID(actor), actor->ref_count);
} else {
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "", line, "", SWITCH_LOG_DEBUG, "Unlock %s: ref count = %i\n", RAYO_JID(actor), actor->ref_count);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "", line, "", SWITCH_LOG_DEBUG, "Release %s: ref count = %i\n", RAYO_JID(actor), actor->ref_count);
}
if (actor->ref_count <= 0 && actor->destroy) {
rayo_actor_destroy(actor, file, line);
if (actor && is_call_actor(actor)) {
return RAYO_CALL(actor);
} else if (actor) {
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
return NULL;
}
if (actor && is_call_actor(actor)) {
return RAYO_CALL(actor);
} else if (actor) {
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
return NULL;
}
/**
* Get access to Rayo mixer data.
* @param mixer_name the mixer name
- * @return the mixer or NULL. Call RAYO_UNLOCK() when done with mixer pointer.
+ * @return the mixer or NULL. Call RAYO_RELEASE() when done with mixer pointer.
*/
static struct rayo_mixer *rayo_mixer_locate(const char *mixer_name, const char *file, int line)
{
if (actor && !strcmp(RAT_MIXER, actor->type)) {
return RAYO_MIXER(actor);
} else if (actor) {
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
return NULL;
}
}
/* parent can now be destroyed */
- RAYO_UNLOCK(RAYO_COMPONENT(actor)->parent);
+ RAYO_RELEASE(RAYO_COMPONENT(actor)->parent);
}
/**
component = RAYO_COMPONENT(rayo_actor_init(RAYO_ACTOR(component), pool, type, subtype, id, jid, rayo_component_cleanup, rayo_component_send, file, line));
if (component) {
- RAYO_RDLOCK(parent);
+ RAYO_RETAIN(parent);
component->client_jid = switch_core_strdup(pool, client_jid);
component->ref = switch_core_strdup(pool, ref);
component->parent = parent;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Removing %s from peer server %s\n", RAYO_JID(client), RAYO_JID(rserver));
switch_core_hash_delete(rserver->clients, key);
RAYO_CLIENT(client)->peer_server = NULL;
- RAYO_UNLOCK(client);
+ RAYO_RELEASE(client);
RAYO_DESTROY(client);
}
switch_core_hash_destroy(&rserver->clients);
if (!strcmp(RAT_CLIENT, client->type)) {
on_client_presence(RAYO_CLIENT(client), iq);
}
- RAYO_UNLOCK(client);
+ RAYO_RELEASE(client);
}
return;
}
} else if (b_call->joined) {
/* don't support multiple joined calls */
response = iks_new_error_detailed(node, STANZA_ERROR_CONFLICT, "multiple joined calls not supported");
- RAYO_UNLOCK(b_call);
+ RAYO_RELEASE(b_call);
} else {
/* bridge this call to call-uri */
switch_channel_set_variable(switch_core_session_get_channel(session), "bypass_media", bypass);
RAYO_SEND_REPLY(call, iks_find_attrib_soft(request, "from"), result);
iks_delete(call->pending_join_request);
}
- RAYO_UNLOCK(b_call);
+ RAYO_RELEASE(b_call);
}
return response;
}
goto done;
} else if (b_call->joined) {
response = iks_new_error_detailed(iq, STANZA_ERROR_SERVICE_UNAVAILABLE, "b-leg already joined to another call");
- RAYO_UNLOCK(b_call);
+ RAYO_RELEASE(b_call);
goto done;
}
app = "bridge";
app_args = switch_core_strdup(dtdata->pool, rayo_call_get_uuid(b_call));
- RAYO_UNLOCK(b_call);
+ RAYO_RELEASE(b_call);
} else {
/* conference */
app = "conference";
/* destroy call */
RAYO_DESTROY(call);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
break;
}
case SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR:
/* destroy call */
if (call) {
RAYO_DESTROY(call);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
/* destroy if not a local client (connected via peer_server) and is OFFLINE */
if (rclient->peer_server && rclient->availability == PS_OFFLINE) {
RAYO_DESTROY(rclient);
- RAYO_UNLOCK(rclient);
+ RAYO_RELEASE(rclient);
}
pause_when_offline();
call->joined = 0;
call->joined_id = NULL;
switch_mutex_unlock(RAYO_ACTOR(call)->mutex);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
/* send mixer unjoined event to member DCP */
/* remove from hash and destroy */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s, destroying mixer: %s\n", RAYO_JID(mixer), rayo_mixer_get_name(mixer));
- RAYO_UNLOCK(mixer); /* release original lock */
+ RAYO_RELEASE(mixer); /* release original lock */
RAYO_DESTROY(mixer);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "destroy: NULL mixer\n");
iks_insert_attrib(x, "mixer-name", rayo_mixer_get_name(mixer));
RAYO_SEND_MESSAGE(call, call->dcp_jid, add_member_event);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
/* broadcast member joined event to subscribers */
iks_delete(add_member_event);
if (lmixer) {
- RAYO_UNLOCK(lmixer);
+ RAYO_RELEASE(lmixer);
}
}
/* TODO speaking events */
done:
- RAYO_UNLOCK(mixer);
+ RAYO_RELEASE(mixer);
}
/**
}
switch_mutex_unlock(RAYO_ACTOR(call)->mutex);
}
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
/**
if (zstr(call->dial_request_id) && !call->dial_request_failed) {
switch_event_dup(&call->end_event, event);
RAYO_DESTROY(call);
- RAYO_UNLOCK(call); /* decrement ref from creation */
+ RAYO_RELEASE(call); /* decrement ref from creation */
}
switch_mutex_unlock(RAYO_ACTOR(call)->mutex);
- RAYO_UNLOCK(call); /* decrement this ref */
+ RAYO_RELEASE(call); /* decrement this ref */
}
}
switch_event_get_header(event, "variable_rayo_call_jid"),
switch_event_get_header(event, "variable_rayo_dcp_jid"));
RAYO_SEND_MESSAGE(call, RAYO_JID(rclient), revent);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
RAYO_SEND_MESSAGE(call, RAYO_JID(rclient), revent);
}
switch_mutex_unlock(RAYO_ACTOR(call)->mutex);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
}
iks_insert_attrib_printf(joined, "call-uri", "%s", b_call->joined_id);
RAYO_SEND_MESSAGE(b_call, rayo_call_get_dcp_jid(b_call), revent);
- RAYO_UNLOCK(b_call);
+ RAYO_RELEASE(b_call);
}
/* send A-leg event */
RAYO_SEND_MESSAGE(call, RAYO_JID(rclient), revent);
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
iks_insert_attrib_printf(unjoined, "call-uri", "%s", joined_id);
RAYO_SEND_MESSAGE(call, RAYO_JID(rclient), revent);
}
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
struct rayo_call *call = RAYO_CALL_LOCATE_BY_ID(switch_event_get_header(event, "Unique-ID"));
if (call) {
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(RAYO_ID(call)), SWITCH_LOG_DEBUG, "Application %s execute\n", switch_event_get_header(event, "Application"));
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(RAYO_ID(call)), SWITCH_LOG_DEBUG, "Application %s execute complete: %s \n",
app,
switch_event_get_header(event, "Application-Response"));
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
}
/* TODO orphaned call... maybe allow events to queue so they can be delivered on reconnect? */
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid), SWITCH_LOG_DEBUG, "Orphaned call event %s to %s\n", switch_event_name(event->event_id), dcp_jid);
}
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
}
/* don't need to keep call reference count incremented in session- call is destroyed after all apps finish */
if (call) {
- RAYO_UNLOCK(call);
+ RAYO_RELEASE(call);
}
/* is outbound call already under control? */
/* previously unknown client - add it */
struct rayo_peer_server *rserver = RAYO_PEER_SERVER(xmpp_stream_get_private(stream));
actor = RAYO_ACTOR(rayo_client_create(jid, xmpp_stream_get_jid(stream), PS_UNKNOWN, rayo_client_send, rserver));
- RAYO_RDLOCK(actor);
+ RAYO_RETAIN(actor);
} else if (strcmp(RAT_CLIENT, actor->type)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s, not a client: %s\n", xmpp_stream_get_jid(stream), jid);
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
actor = NULL;
}
} else {
actor = RAYO_ACTOR(xmpp_stream_get_private(stream));
- RAYO_RDLOCK(actor);
+ RAYO_RETAIN(actor);
}
return actor;
}
if (actor) {
rayo_client_presence_check(RAYO_CLIENT(actor));
rayo_client_command_recv(RAYO_CLIENT(actor), stanza);
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
} else if (!strcmp("presence", name)) {
const char *from = iks_find_attrib_soft(stanza, "from");
struct rayo_actor *actor = xmpp_stream_client_locate(stream, from);
if (actor) {
on_client_presence(RAYO_CLIENT(actor), stanza);
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
} else if (!strcmp("message", name)) {
const char *from = iks_find_attrib_soft(stanza, "from");
if (actor) {
rayo_client_presence_check(RAYO_CLIENT(actor));
on_client_message(RAYO_CLIENT(actor), stanza);
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
}
}
/* destroy peer server / client associated with this stream */
void *actor = xmpp_stream_get_private(stream);
if (actor) {
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
RAYO_DESTROY(actor);
}
}
stop_deliver_message_threads();
if (globals.console) {
- RAYO_UNLOCK(globals.console);
+ RAYO_RELEASE(globals.console);
RAYO_DESTROY(globals.console);
globals.console = NULL;
}
if (globals.server) {
- RAYO_UNLOCK(globals.server);
+ RAYO_RELEASE(globals.server);
RAYO_DESTROY(globals.server);
globals.server = NULL;
}
extern struct rayo_actor *rayo_actor_locate(const char *jid, const char *file, int line);
extern struct rayo_actor *rayo_actor_locate_by_id(const char *id, const char *file, int line);
extern int rayo_actor_seq_next(struct rayo_actor *actor);
-extern void rayo_actor_rdlock(struct rayo_actor *actor, const char *file, int line);
-extern void rayo_actor_unlock(struct rayo_actor *actor, const char *file, int line);
+extern void rayo_actor_retain(struct rayo_actor *actor, const char *file, int line);
+extern void rayo_actor_release(struct rayo_actor *actor, const char *file, int line);
extern void rayo_actor_destroy(struct rayo_actor *actor, const char *file, int line);
#define RAYO_LOCATE(jid) rayo_actor_locate(jid, __FILE__, __LINE__)
#define RAYO_JID(x) RAYO_ACTOR(x)->jid
#define RAYO_ID(x) RAYO_ACTOR(x)->id
#define RAYO_POOL(x) RAYO_ACTOR(x)->pool
-#define RAYO_RDLOCK(x) rayo_actor_rdlock(RAYO_ACTOR(x), __FILE__, __LINE__)
-#define RAYO_UNLOCK(x) rayo_actor_unlock(RAYO_ACTOR(x), __FILE__, __LINE__)
+#define RAYO_RETAIN(x) rayo_actor_retain(RAYO_ACTOR(x), __FILE__, __LINE__)
+#define RAYO_RELEASE(x) rayo_actor_release(RAYO_ACTOR(x), __FILE__, __LINE__)
#define RAYO_DESTROY(x) rayo_actor_destroy(RAYO_ACTOR(x), __FILE__, __LINE__)
#define RAYO_SEQ_NEXT(x) rayo_actor_seq_next(RAYO_ACTOR(x))
if (actor && is_component_actor(actor)) {
return RAYO_COMPONENT(actor);
} else if (actor) {
- RAYO_UNLOCK(actor);
+ RAYO_RELEASE(actor);
}
return NULL;
}
{
component->complete = 1;
RAYO_SEND_REPLY(component, iks_find_attrib(response, "to"), response);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
}
} else {
switch_log_printf(SWITCH_CHANNEL_UUID_LOG(RAYO_COMPONENT(component)->parent->id), SWITCH_LOG_DEBUG, "Skipping CPA event\n");
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
if (component) {
stop_cpa_detectors(CPA_COMPONENT(component));
rayo_component_send_complete(RAYO_COMPONENT(component), COMPONENT_COMPLETE_HANGUP);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
if (zstr(url)) {
stop_cpa_detectors(component);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Missing grammar URL");
}
if (switch_core_hash_find(component->signals, url)) {
free(url_dup);
stop_cpa_detectors(component);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Duplicate URL");
}
} else {
free(url_dup);
stop_cpa_detectors(component);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, error_str);
}
if (!have_grammar) {
stop_cpa_detectors(component);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "No grammar defined");
}
switch_event_destroy(&execute_event);
}
rayo_call_set_faxing(RAYO_CALL(call), 0);
- RAYO_UNLOCK(sendfax_component);
+ RAYO_RELEASE(sendfax_component);
} else {
/* component starting... */
rayo_component_send_start(RAYO_COMPONENT(sendfax_component), iq);
} else {
response = iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "failed to create txfax event");
rayo_call_set_faxing(RAYO_CALL(call), 0);
- RAYO_UNLOCK(sendfax_component);
+ RAYO_RELEASE(sendfax_component);
}
return response;
switch_event_destroy(&execute_event);
}
rayo_call_set_faxing(RAYO_CALL(call), 0);
- RAYO_UNLOCK(receivefax_component);
+ RAYO_RELEASE(receivefax_component);
} else {
/* component starting... */
rayo_component_send_start(RAYO_COMPONENT(receivefax_component), iq);
} else {
response = iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "failed to create rxfax event");
rayo_call_set_faxing(RAYO_CALL(call), 0);
- RAYO_UNLOCK(receivefax_component);
+ RAYO_RELEASE(receivefax_component);
}
return response;
rayo_component_send_complete_event(RAYO_COMPONENT(component), result);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
}
if (component->speech_mode && handler->voice_component) {
/* don't allow multi voice input */
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_CONFLICT, "Multiple voice input is not allowed");
}
/* if recognition engine is different, we can't handle this request */
if (!zstr(handler->last_recognizer) && strcmp(component->recognizer, handler->last_recognizer)) {
handler->voice_component = NULL;
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Must use the same recognizer for the entire call");
} else if (zstr(handler->last_recognizer)) {
if (!grammar) {
handler->voice_component = NULL;
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, stanza_error, error_detail);
}
/* parse the grammar */
if (!(component->grammar = srgs_parse(globals.parser, iks_find_cdata(input, "grammar")))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Failed to parse grammar body\n");
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "Failed to parse grammar body");
}
/* fire up media bug to monitor lifecycle */
if (switch_core_media_bug_add(session, "rayo_input_component", NULL, input_handler_bug_callback, handler, 0, SMBF_READ_REPLACE, &handler->bug) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Failed to create input handler media bug\n");
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "Failed to create input handler media bug");
}
/* handler bug was destroyed */
switch_mutex_unlock(handler->mutex);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Input handler media bug is closed\n");
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "Input handler media bug is closed\n");
}
switch_mutex_lock(input_component->handler->mutex);
input_component->stop = 1;
if (input_component->speech_mode) {
+ switch_mutex_unlock(input_component->handler->mutex);
switch_ivr_stop_detect_speech(session);
+ switch_mutex_lock(input_component->handler->mutex);
rayo_component_send_complete(RAYO_COMPONENT(component), COMPONENT_COMPLETE_STOP);
}
switch_mutex_unlock(input_component->handler->mutex);
if (session) {
switch_mutex_lock(input_component->handler->mutex);
if (input_component->speech_mode) {
+ switch_mutex_unlock(input_component->handler->mutex);
switch_ivr_detect_speech_start_input_timers(session);
+ switch_mutex_lock(input_component->handler->mutex);
} else {
input_component->last_digit_time = switch_micro_time_now();
input_component->start_timers = 1;
rayo_component_send_complete(component, INPUT_NOMATCH);
}
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
} else if (!strcasecmp("begin-speaking", speech_type)) {
char *component_id = switch_mprintf("%s-input-voice", uuid);
if (component && INPUT_COMPONENT(component)->barge_event) {
send_barge_event(component);
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
} else if (!strcasecmp("closed", speech_type)) {
char *component_id = switch_mprintf("%s-input-voice", uuid);
struct rayo_component *component = RAYO_COMPONENT_LOCATE(component_id);
/* shouldn't get here... */
rayo_component_send_complete(component, COMPONENT_COMPLETE_ERROR);
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
switch_safe_free(event_str);
stream.write_function(&stream, "}fileman://rayo://%s", RAYO_JID(component));
if (switch_ivr_displace_session(session, stream.data, 0, "m") == SWITCH_STATUS_SUCCESS) {
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
} else {
if (component->complete) {
/* component is already destroyed */
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
} else {
/* need to destroy component */
if (OUTPUT_COMPONENT(component)->document) {
rayo_component_api_execute_async(component, "conference", stream.data);
switch_safe_free(stream.data);
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
return NULL;
}
if (status != SWITCH_STATUS_SUCCESS && context->component) {
/* complete error event will be sent by calling thread */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Status = %i\n", status);
- RAYO_UNLOCK(context->component);
+ RAYO_RELEASE(context->component);
}
return status;
/* done */
iks_delete(PROMPT_COMPONENT(prompt)->iq);
- RAYO_UNLOCK(prompt);
+ RAYO_RELEASE(prompt);
RAYO_DESTROY(prompt);
break;
/* done */
iks_delete(PROMPT_COMPONENT(prompt)->iq);
- RAYO_UNLOCK(prompt);
+ RAYO_RELEASE(prompt);
RAYO_DESTROY(prompt);
break;
/* TODO assume final timeout, for now */
complete_record(component, RECORD_COMPLETE_FINAL_TIMEOUT);
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
if (start_call_record(session, component)) {
rayo_component_send_start(component, iq);
} else {
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR);
}
complete_record(component, RECORD_COMPLETE_FINAL_TIMEOUT);
}
}
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
}
}
/* mixer doesn't allow "send" */
if (!strcmp("send", iks_find_attrib_soft(record, "direction"))) {
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error(iq, STANZA_ERROR_BAD_REQUEST);
}
if (start_mixer_record(component)) {
rayo_component_send_start(component, iq);
} else {
- RAYO_UNLOCK(component);
+ RAYO_RELEASE(component);
RAYO_DESTROY(component);
return iks_new_error(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR);
}