[Freeswitch-users] event-lock in mod_erlang_event

Andrew Thompson andrew at hijacked.us
Fri Jun 25 07:59:58 PDT 2010


On Fri, Jun 25, 2010 at 10:41:37AM +0800, Seven Du wrote:
> Hi,
> 
> As I can see, You cannot do this in inbound erlang
> 
> sendmsg(FS, uuid, playback, "1.wav");
> sendmsg(FS, uuid, playback, "2.wav");
> sendmsg(FS, uuid, transfer, "xxxxx
> 
> because it's async, and it will play 2.wav immediately.
> 
> 
> 1) Sure if I know the length of 1.wav I can
> 
> sendmsg(FS, uuid, playback, 1.wav
> sleep(3000
> sendmsg(FS, uuid, playback, 2.wav
> 
> 2) Or I could wait the execute_complete event which will be a little complicated
> 
> 
> According to http://wiki.freeswitch.org/wiki/Event_socket_outbound
> 
> Is it possible to send a event-lock param to lock the message temporarily? like
> 
> sendmsg(FS, UUID, App, Args, [{"event-lock", "true"}]).
>

Yes, event-lock works from erlang too (its implemented down in the core
I think). I use it to prevent exactly this problem.

Feel free to update the wiki to note this is available.

Andrew



More information about the FreeSWITCH-users mailing list