lautram.mathieu at gma... Guest
|
Posted: Fri Sep 11, 2009 7:18 pm Post subject: [Freeswitch-users] Event-socket python uuid |
|
|
Hi there,
Here is my problem:
I'd like to set up a switchboard. I'm using python scripts called when a call is coming. Here is my public.xml:
<extension name="toto">
<condition field="destination_number" expression="[0-9]*">
<action application="python" data="test.test2" />
</condition>
</extension>
Next, in my test2.py, I put the uuid of the session in a database:
import os, cgi, MySQLdb, time
from freeswitch import *
def handler(session, args):
uuid = session.getVariable("uuid")
myconnection = MySQLdb.connect(host = "localhost", user = "root", passwd = "root", db = "testfreeswitch")
mycursor = myconnection.cursor()
mycursor.execute("INSERT INTO fileAttente VALUES (NULL, '0123456789', 'LIBRE', '" + uuid + "')")
session.execute("park")
Everything runs fine from here.
After this, I use telnet to have a connection to freeswitch.
And... I'm stuck.
I would like this:
a file corresponding to the caller (test2)
a file corresponding to the callee; This file will be pretty much the same that test2.
a file which will be run in the same time that Freeswitch; This file will dialog with Freeswitch and the database.
The real problem that I have is that I don't know how to create a new session corresponding to the callee (via a python script).
If somebody could help me, it could be really great =)
Thanks a lot
Mathieu |
|