12 Dec
2008
12 Dec
'08
11:38 a.m.
Hi, I'm working on a simple dialer, and I have the following problem: the audio file starts playing before the user answeres the phone (while it's ringing). It only works when I introduce a delay, but that doesn't seem right. For instance in the asterisk context referred in the call files, I had: exten => s,4,Answer exten => s,n,Wait(2) exten => s,n,Background(${SOUNDFILE}) And indeed it played a soundfile 2 seconds after the called person picked up the phone In FS I currently initiate calls like this: session.waitForAnswer(10000); if (session.ready()) { session.sleep(2000); session.streamFile(/*...*/); } Is this right?