[Freeswitch-users] Javascript: stream, speak, stream - cepstral cut offs 2nd stream

Birgit Arkesteijn birgit at westhawk.co.uk
Tue Nov 18 07:14:48 PST 2008


Hi,

Thanks, Anthony, for your reply.
mSession.sleep(100);
does indeed do the trick!

Cheers, Birgit

On 17/11/08 19:51, Anthony Minessale wrote:
> you never want to msleep during a js running on a call
> you should use session.sleep(500);
> msleep blocks the whole thread and thus the audio.
> 
> 
> On Mon, Nov 17, 2008 at 1:05 PM, Birgit Arkesteijn <birgit at westhawk.co.uk>wrote:
> 
>> Hi,
>>
>> In javascript I doing the following:
>>
>> var consumer_name = "Birgit Arkesteijn";
>> var endpoint_url = 'sofia/gateway/westhawk/0662';
>> var mSession = new Session("{ignore_early_media=true,originate_timeout=8}"
>>         + endpoint_url);
>> var ready = mSession.ready();
>> // log("merchant answered: " + ready);
>> if (ready == true)
>> {
>>     mSession.streamFile("westhawk/lead_waiting.wav", dummy);
>>     mSession.speak("cepstral", "Diane", "<break time='2s'/>" +
>> consumer_name);
>>     // msleep(500);
>>     mSession.streamFile("westhawk/consumer_hungup.wav",
>>                         dummy);
>>     exit();
>> }
>> function dummy(session, type, data, arg){}
>>
>>
>> No matter what I try, cepstral somehow cuts off the beginning two
>> seconds of the second streamFile().
>> Adding a msleep(500) in between 'speak' and 'streamFile' makes it only
>> worse.
>>
>> I'm running
>> FreeSWITCH Version 1.0.trunk (597:10325M) Started.
>> and
>> Cepstral_Diane_x86-64-linux_5.1.0/
>> on Linux Suse 10.0 x86_64
>>
>> Any ideas?
>>
>> Thanks, Birgit

-- 
-- Birgit Arkesteijn, birgit at westhawk.co.uk,
-- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
-- Company no: 1769350
-- Registered Office:
-- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK.
-- tel.: +44 (0)161 237 0660
-- <URL: http://www.westhawk.co.uk>




More information about the FreeSWITCH-users mailing list