mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
change execute and executeAsync to return the last event instead of status since it will almost always be 0
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15973 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -148,13 +148,19 @@ int ESLconnection::setEventLock(const char *val)
|
||||
return handle.event_lock;
|
||||
}
|
||||
|
||||
int ESLconnection::execute(const char *app, const char *arg, const char *uuid)
|
||||
ESLevent *ESLconnection::execute(const char *app, const char *arg, const char *uuid)
|
||||
{
|
||||
return esl_execute(&handle, app, arg, uuid);
|
||||
if (esl_execute(&handle, app, arg, uuid) == ESL_SUCCESS) {
|
||||
esl_event_t *event;
|
||||
esl_event_dup(&event, handle.last_sr_event);
|
||||
return new ESLevent(event, 1);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int ESLconnection::executeAsync(const char *app, const char *arg, const char *uuid)
|
||||
ESLevent *ESLconnection::executeAsync(const char *app, const char *arg, const char *uuid)
|
||||
{
|
||||
int async = handle.async_execute;
|
||||
int r;
|
||||
@@ -163,7 +169,13 @@ int ESLconnection::executeAsync(const char *app, const char *arg, const char *uu
|
||||
r = esl_execute(&handle, app, arg, uuid);
|
||||
handle.async_execute = async;
|
||||
|
||||
return r;
|
||||
if (r == ESL_SUCCESS) {
|
||||
esl_event_t *event;
|
||||
esl_event_dup(&event, handle.last_sr_event);
|
||||
return new ESLevent(event, 1);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ESLconnection::sendEvent(ESLevent *send_me)
|
||||
|
@@ -87,8 +87,8 @@ class ESLconnection {
|
||||
ESLevent *recvEventTimed(int ms);
|
||||
ESLevent *filter(const char *header, const char *value);
|
||||
int events(const char *etype, const char *value);
|
||||
int execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
|
||||
int executeAsync(const char *app, const char *arg = NULL, const char *uuid = NULL);
|
||||
ESLevent *execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
|
||||
ESLevent *executeAsync(const char *app, const char *arg = NULL, const char *uuid = NULL);
|
||||
int setAsyncExecute(const char *val);
|
||||
int setEventLock(const char *val);
|
||||
int disconnect(void);
|
||||
|
Reference in New Issue
Block a user