mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
add some stuff to esl
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12086 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
+4
-1
@@ -450,6 +450,8 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con
|
||||
char cmd_buf[128] = "sendmsg";
|
||||
char app_buf[512] = "";
|
||||
char arg_buf[512] = "";
|
||||
const char *el_buf = "event-lock: true\n";
|
||||
const char *bl_buf = "blocking: true\n";
|
||||
char send_buf[1292] = "";
|
||||
|
||||
if (!handle->connected) {
|
||||
@@ -468,7 +470,8 @@ ESL_DECLARE(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, con
|
||||
snprintf(arg_buf, sizeof(arg_buf), "execute-app-arg: %s\n", arg);
|
||||
}
|
||||
|
||||
snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s\n", cmd_buf, app_buf, arg_buf);
|
||||
snprintf(send_buf, sizeof(send_buf), "%s\ncall-command: execute\n%s%s%s%s\n",
|
||||
cmd_buf, app_buf, arg_buf, handle->event_lock ? el_buf : NULL, handle->blocking_execute ? bl_buf : NULL);
|
||||
|
||||
return esl_send_recv(handle, send_buf);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,22 @@ eslEvent *eslConnection::getInfo()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int eslConnection::setBlockingExecute(const char *val)
|
||||
{
|
||||
if (val) {
|
||||
handle.blocking_execute = esl_true(val);
|
||||
}
|
||||
return handle.blocking_execute;
|
||||
}
|
||||
|
||||
int eslConnection::setEventLock(const char *val)
|
||||
{
|
||||
if (val) {
|
||||
handle.event_lock = esl_true(val);
|
||||
}
|
||||
return handle.event_lock;
|
||||
}
|
||||
|
||||
esl_status_t eslConnection::execute(const char *app, const char *arg, const char *uuid)
|
||||
{
|
||||
return esl_execute(&handle, app, arg, uuid);
|
||||
|
||||
@@ -270,6 +270,8 @@ typedef struct {
|
||||
int connected;
|
||||
struct sockaddr_in addr;
|
||||
esl_mutex_t *mutex;
|
||||
int blocking_execute;
|
||||
int event_lock;
|
||||
} esl_handle_t;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -83,7 +83,9 @@ class eslConnection {
|
||||
eslEvent *recvEventTimed(int ms);
|
||||
esl_status_t filter(const char *header, const char *value);
|
||||
esl_status_t events(const char *etype, const char *value);
|
||||
esl_status_t execute(const char *app, const char *arg, const char *uuid);
|
||||
esl_status_t execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
|
||||
int setBlockingExecute(const char *val);
|
||||
int setEventLock(const char *val);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user