VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
mszlazak at aol.com Guest
|
Posted: Fri Mar 13, 2009 1:53 am Post subject: [Freeswitch-users] How do I notify FreeSwitch that a phone h |
|
|
If I originate an outgoing call from FreeSwitch and want to tts a phrase or play an audio once the call has been answered (i.e, someone answered their cell phone or I got their voicemail) then how do I detect that.
Otherwise, I've tried the following but it relies in getting the timing right which won't always work or looping the tts phrase over and over.
var s;
while (tryCalling()) {}
s.hangup();
exit();
function tryCalling() {
s = new Session("sofia/gateway/spa3102/12223334444@10.0.0.5:5061");
s.waitForAnswer(10000);
if (s.cause == "USER_BUSY") {
return true;
}
if (s.ready()) {
s.sleep(10000);
s.speak("cepstral","Callie","Hello from FreeSwitch");
}
return false;
}
Another way is to keep replaying the tts phrase by replacing
if (s.ready()) {
s.sleep(10000);
s.speak("cepstral","Callie","Hello from FreeSwitch");
}
with something like:
while (s.ready()) {
s.speak("cepstral","Callie","Hello from FreeSwitch");
}
Thanks. Mark.
A Good Credit Score is 700 or Above. See yours in just 2 easy steps! |
|
Back to top |
|
|
davidwdan at gmail.com Guest
|
Posted: Fri Mar 13, 2009 8:53 am Post subject: [Freeswitch-users] How do I notify FreeSwitch that a phone h |
|
|
Try ignore early media.
On 3/13/09, mszlazak@aol.com <mszlazak@aol.com> wrote:
Quote: | If I originate an outgoing call from FreeSwitch and want to tts a phrase or
play an audio once the call has been answered (i.e, someone answered their
cell phone or I got their voicemail) then how do I detect that.
Otherwise, I've tried the following but it relies in getting the timing
right which won't always work or looping the tts phrase over and over.
var s;
while (tryCalling()) {}
s.hangup();
exit();
function tryCalling() {
??? s = new Session("sofia/gateway/spa3102/12223334444@10.0.0.5:5061");
??? s.waitForAnswer(10000);
???
??? if (s.cause == "USER_BUSY") {
??? ?? ?return true;
??? }
??? if (s.ready()) {
??? ?? ?s.sleep(10000);
??? ?? ?s.speak("cepstral","Callie","Hello from FreeSwitch");
??? }
??? return false;
}
Another way is to keep replaying the tts phrase by replacing
? if (s.ready()) {
??? ?? ?s.sleep(10000);
??? ?? ?s.speak("cepstral","Callie","Hello from FreeSwitch");
??? }
with something like:
while (s.ready()) {
??? ?? ?s.speak("cepstral","Callie","Hello from FreeSwitch");
??? }
Thanks. Mark.
|
--
Sent from my mobile device
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|