Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] howto originate fs call from webapp (python)


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
alexander at degreiff.com
Guest





PostPosted: Tue Feb 24, 2009 4:34 pm    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

hi all,

i come from asterisk an i am new to freeswitch. after my with days with freeswitch i am very excited!

but trying to migrate our deployment i have three challenges. one of them is:

i need to call freeswitch from a webapp (e.g. python) and pass number1 and number2. i then need freeswitch to call number1. as soon as it is picked up say a short confirmaton text, call number2 and bridge the two.

my first approach was to call via xml_rpc like described in the wiki but when i call like

server.freeswitch.api("originate","sofia/gategay/gateway1/{number1} &bridge(sofia/gateway/gateway2/{number2})")

but in this case both numbers are called in parallel and the first number to pick up gets a ringback tone until the other number picks up. how can i get the sequence described above?

thanks for your help
alex

_______________________________________________
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
freeswitch-users at li...
Guest





PostPosted: Tue Feb 24, 2009 4:36 pm    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

Quote:
my first approach was to call via xml_rpc like described in the wiki
but when i call like

server.freeswitch.api("originate","sofia/gategay/gateway1/{number1}
&bridge(sofia/gateway/gateway2/{number2})")

but in this case both numbers are called in parallel and the first
number to pick up gets a ringback tone until the other number picks
up. how can i get the sequence described above?

thanks for your help alex

You are probably getting early media when dialing number 1. Try :

server.freeswitch.api("originate","{ignore_early_media=true}sofia/gategay/gateway1/{number1}
&bridge(sofia/gateway/gateway2/{number2})")


_______________________________________________
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
msc at freeswitch.org
Guest





PostPosted: Tue Feb 24, 2009 4:53 pm    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

On Tue, Feb 24, 2009 at 1:09 PM, Alexander de Greiff
<alexander@degreiff.com> wrote:
Quote:
hi all,

i come from asterisk an i am new to freeswitch. after my with days with freeswitch i am very excited!

Welcome to FreeSWITCH!

Quote:

but trying to migrate our deployment i have three challenges. one of them is:

i need to call freeswitch from a webapp (e.g. python) and pass number1 and number2. i then need freeswitch to call number1. as soon as it is picked up say a short confirmaton text, call number2 and bridge the two.

my first approach was to call via xml_rpc like described in the wiki but when i call like

 server.freeswitch.api("originate","sofia/gategay/gateway1/{number1} &bridge(sofia/gateway/gateway2/{number2})")

but in this case both numbers are called in parallel and the first number to pick up gets a ringback tone until the other number picks up. how can i get the sequence described above?

thanks for your help
alex

Do you have any other requirements? For example, what happens if the
first bridge fails? Does your Python app need to "do anything"? Just
curious.

Thanks,
MC

_______________________________________________
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
alexander at degreiff.com
Guest





PostPosted: Wed Feb 25, 2009 3:37 am    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

hi,

oops, i must have been very tired when i wrote my first mail to the list...

thanks for your replies. {ignore_early_media=true} really worked for me.

i try very hard to "unlearn" asterisk.

with asterisk i did not do much more with the python script, but i would like the pthon script to interact more with freeswitch like:

- call number1
- say a welcome message with cepstral voice
- call number2
- bridge


other scenario:

enter telephone number in webapp
python script have fs to call number
say "please enter the pin code from the website"
validate dtmf code
pass back to webapp: correct or not correct

unfortunately just from reading the wiki i don't know how to do it in my python script.

can you share your experience?

thanks
alex

_______________________________________________
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
anthony.minessale at g...
Guest





PostPosted: Wed Feb 25, 2009 9:23 am    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

from the freeswitch build root <the place you type make install from>
cd libs/esl

if you have python-devel or the equiv

make pymod
from there if you cd python you will see a python module you can use to control freeswitch.


On Wed, Feb 25, 2009 at 2:30 AM, Alexander de Greiff <alexander@degreiff.com (alexander@degreiff.com)> wrote:
Quote:
hi,

oops, i must have been very tired when i wrote my first mail to the list...

thanks for your replies. {ignore_early_media=true} really worked for me.

i try very hard to "unlearn" asterisk.

with asterisk i did not do much more with the python script, but i would like the pthon script to interact more with freeswitch like:

- call number1
- say a welcome message with cepstral voice
- call number2
- bridge


other scenario:

enter telephone number in webapp
python script have fs to call number
say "please enter the pin code from the website"
validate dtmf code
pass back to webapp: correct or not correct

unfortunately just from reading the wiki i don't know how to do it in my python script.

can you share your experience?

thanks
alex


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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





--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
msc at freeswitch.org
Guest





PostPosted: Wed Feb 25, 2009 1:28 pm    Post subject: [Freeswitch-users] howto originate fs call from webapp (pyth Reply with quote

Quote:
enter telephone number in webapp
python script have fs to call number
say "please enter the pin code from the website"
validate dtmf code
pass back to webapp: correct or not correct

unfortunately just from reading the wiki i don't know how to do it in my python script.

can you share your experience?

You definitely need to become familiar with the event socket. However,
to become familiar with the event socket you need also to become
familiar with some of the basic FreeSWITCH API functions, like "bgapi"
and "originate" as well as what kinds of events come over the event
socket.

Here is some recommended reading:
#1 - The reporting bugs page on the wiki. It may sound crazy, but I
promise you that if you at least skim over it then it will save you
time when you start having to debug things.
http://wiki.freeswitch.org/wiki/Reporting_Bugs

#2 - The event socket page on the wiki:
http://wiki.freeswitch.org/wiki/Mod_event_socket

#3 - The commands page on the wiki. Pay special attention to the
"originate," "bridge," and "bgapi" commands because they will be
extremely useful to you in your application:
http://wiki.freeswitch.org/wiki/Mod_commands

#4 - The Asterisk/FreeSWITCH Rosetta Stone wiki page. In some cases
you can leverage your Asterisk knowledge. This page gives you some
tips on how to do stuff in FS that you already know how to do with
Asterisk:
http://wiki.freeswitch.org/wiki/Rosetta_stone

You have lots of reading to do! Smile You will also need to start doing
test phone calls. Make test calls and see how things work. Watch the
debug information on the CLI to see what FS is doing with each call.
It's very interesting.

Join us on IRC when you have questions and want to talk in real-time.
-MC (IRC: mercutioviz)

_______________________________________________
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
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services