Hello Michael!
Thank
you for your reply! I know about sched_api and I use Python as a scripting
language. Also “sched_api” can be used inside python, using
session.execute. However the problem is that the “sched_api” timer
starts right after you initiate the SETUP of the second call leg. What I need
is to call something, after a call CONNECT instead. One workaround would be if
I can check what time it took to connect the call, but I do not know/see how to
do this. I do not see a CONNECT callback function either.
Best Regards, Delian Tashev
P.S. Dear enlightened people, thank you for providing help to
the community by replying to the list e-mails.
From: Michael Collins [mailto:msc@freeswitch.org]
Sent: Wednesday, August 26, 2009 11:28 PM
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Timers/DTMFs During a Call
Do you actually need Python for
the IVR, or is it that you're comfortable using a scripting lang for an IVR? I
like using XML for IVRs, but using scripting langs does give you a bit more
power & flexibility at the cost of some resources.
For the record, you can do this in the dialplan using XML and sched_api without
touching a scripting language. Checkout the sched_api channel variable on the
wiki - it may give you the functionality you need.
-MC
On Wed, Aug 26, 2009 at 7:59 AM, delianSPAM <delianspam@gmail.com> wrote:
Hello Everybody!
1. Scenario.
I am writing an IVR in Python that gets a destination from
the calling party (party A) and then connects to the destination (party B).
When the call is CONNECTED, I want to:
-
Receive DTMFs
-
Have a timer that can call a certain function in my
script. The script will have to play a message to party A.
-
Have a timer that can call a certain function in my
script. The script will have to drop the call.
Please notice that I want to do the things after the two
parties are connected, and not after I send the Invite to party B.
2. Problem.
I will be happy to receive help on:
-
Which methods should I look for to implement this.
3. Details
Here is how I connect the call currently:
session.execute("bridge",”sofia/internal/"
+ destination_number + "@domain.com”)
I have tried to create a timer callback function
“my_method()” using:
ivr_timer
=threading.Timer(30,my_method)
This never called the function “my_method()”.
Maybe I am wrong in using threading.Timer and the
“bridge” application? Maybe I need to create a new thread and a new
timer using the API of freeswitch, plus to use the
“session.setInputCallback”, plus use a conference rather than a
bridge? Can you please provide any suggestions or examples?
Thank you!
Best Regards, Delian Tashev
_______________________________________________
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