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:
Anthony Minessale
2009-12-15 19:45:47 +00:00
parent 9d348910ef
commit c13c187a3a
15 changed files with 124 additions and 106 deletions

View File

@@ -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)

View File

@@ -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);