freeswitch - How to set Application-UUID for Applications executed from ESL -
i know triggering executeapplication call each channel_execute event. in managed esl's executeasync method there no parameter supporting this. signature is:
public eslevent executeasync(string app, string arg, string uuid)
when app started executeasync freeswitch generates uuid application , presen't in subsequent channel_execute event's application-uuid header field. problem executeasynch call doesn't return uuid. makes tricky track channel_execute events if there multiple running applications. event returned executeasynch has following form (no uuid present):
{ "event-name": "socket_data", "content-type": "command/reply", "reply-text": "+ok" }
for example api call execution bgapi supports job_uuid parameter value of job-uuid header field related background_job events.
public eslevent bgapi(string cmd, string arg, string job_uuid)
how can same achieved dialplan applications playback?
i have checked if maybe hidden managed wrapper, esl_execute function in esl.c (wich used wrapper's executeasync method) doesn't seem support either:
esl_declare(esl_status_t) esl_execute(esl_handle_t *handle, const char *app, const char *arg, const char *uuid)
according documentation of sendmsg event-uuid
header value designed purpose. esl_execute
function in api uses esl_send_recv
send self composed sendmsg
message, unfortunately not provide way set field. 1 way go compose similar sendmsg
message contains event-uuid
field , send via esl_send_recv
.
for example managed esl:
public void executeapplication(eslconnection conn, string application, string appparams, string uiid, string jobid) { var header = new dictionary<string, string> { {"call-command", "execute"}, {"execute-app-name", application }, {"execute-app-arg", appparams }, {"loops", "1" }, {"event-uuid", jobid }, }; string newline = "\n"; var cmd = $"sendmsg {uiid}{newline}" + string.join(newline, header.select(kvp => $"{kvp.key}: {kvp.value}")); var e = conn.sendrecv(cmd); ... }
so message sent have following form:
sendmsg bb2652fa-467c-44a1-a2f0-0f5e4363e2f3 call-command: execute execute-app-name: playback execute-app-arg: d:\vox\sample.vox loops: 1 event-uuid: play command id 369
Comments
Post a Comment