[Freeswitch-users] question about outbound socket async

Seven Du dujinfang at gmail.com
Sat Jan 29 14:54:33 MSK 2011


For sure I'm using a recent git.

I test with nc and didn't found a problem, but in erlang it does has
problem I didn't test much so I just sleep some milliseconds after I
sendmsg break that works for now.

Let me tell you what I was trying to do:

an erlang FSM (like outbound event socket) controls a channel and can

playback to channel
listen to DTMF and send to a UDP server
listen to a UDP and break the current playback and play new voice on
new instruction

The problem is that it can get UDP instructions any time and can be
very quick( say, get 2 playback instruction at the same time).

So I want to listen to CHANNEL_EXECUTE to make sure a playback is
actually executing and CHANNEL_EXECUTE_COMPLETE to make sure if it
stopped. And also for the break APP.

The state machine would be complicated if I need to worry about all
the races. It might be better to implement in C but it's actually a
simple program which I think it's overkill for now.

Thanks for your help, a simple sleep works for now. Will worry about this later.

On Sat, Jan 29, 2011 at 10:10 AM, Peter Olsson
<peter.olsson at visionutveckling.se> wrote:
> I don't think it's possible to "auto break" playback. However, break should work ok here, I use it like this all the time in an ESL application. Are you using latest git? About a year ago I submitted a patch to fix some timing for this - but I guess you're not running a version old like that :)
>
> /Peter
>
> ----- Reply message -----
> Från: "Seven Du" <dujinfang at gmail.com>
> Datum: lör, jan 29, 2011 07:36
> Rubrik: [Freeswitch-users] question about outbound socket async
> Till: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
>
> Thank you Peter. Yes I sendmsg break with event-lock, but the playback
> is not using event-lock since I want to stop it at anytime, I need
> more test to figure out. At the same time I still want to know if
> there's an option to auto-break the running app on a channel.
>
> Thanks.
>
> On Fri, Jan 28, 2011 at 10:08 AM, Peter Olsson
> <peter.olsson at visionutveckling.se> wrote:
>> Are you using sendmsg break when issuing a break? That forces it to be queued in the execute queue the same way as playback, and it should be impossible to break the second file when not supposed to (since that should be the next one in queue).
>>
>> /Peter
>>
>>
>> ----- Reply message -----
>> Från: "Seven Du" <dujinfang at gmail.com>
>> Datum: fre, jan 28, 2011 07:59
>> Rubrik: [Freeswitch-users] question about outbound socket async
>> Till: "freeswitch-users" <freeswitch-users at lists.freeswitch.org>
>>
>> Hi all,
>>
>> I'm using mod_erlang_event and I think it's equivalent to event_socket
>> async full.
>>
>> When I run sendmsg playback wav1 and then playback wav2, wav2 will
>> stop wav1 and when wav2 is done, wav1 continues by default. Is there a
>> way to automatically break wav1 when play wav2 ?
>>
>> I could send break to wav1 but because everything is async, sometimes
>> break also breaks wav2 even with event-lock = true which made async
>> mode a sort of pain.
>>
>> It seems like there is a var can control this but I cannot recall. Any
>> help is appreciated.
>>
>> Thanks.
>>
>> --
>> About: http://about.me/dujinfang
>> Blog: http://www.dujinfang.com
>> Proj:  http://www.freeswitch.org.cn
>>
>> _______________________________________________
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>



More information about the FreeSWITCH-users mailing list