[Freeswitch-users] Using Python to open a channel to outgoing leg and play a prompt

fgastiaz francisco.gastiazoro at gmail.com
Wed Oct 29 11:46:11 PDT 2008

Hi guys,

I what I want to do is based on what one of the register extension dials,
contact another registered user but before bridging both legs i want to play
a file into the egress side, if possible using python


call Flow:

SIP Phone A --> FreeSwitch --> SIP Phone B.


a) SIP PHONE A dials "777"
b) a dialplan is executed based on the user-context, as a condition is
matched, then we starts a script ( python is the one i chose )
c) The scripts starts to run and it need to contact the SIP Phone B. when
the channel to B is open, I need to play a prompt "test.wav" to SIP PHONE B,
when the prompt is over i do the bridging between SIP PHONE A and SIP PHONE
B. If the SIP PHONE B hungs up during the prompt, both channels have to end.

I tried with something like:

newsession =  Session("sofia/internal/221144 at")
if ( newsession.ready() ):

but it doesn't work... 

Do you have some ideas for this... or it is impossible to achieve...

View this message in context: http://www.nabble.com/Using-Python-to-open-a-channel-to-outgoing-leg-and-play-a-prompt-tp20233448p20233448.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.

More information about the FreeSWITCH-users mailing list