[Freeswitch-users] mod_python fetching data from mysql for VM

mbsip mbsip at gazeta.pl
Sat Feb 13 12:03:07 PST 2010


Hello,

I am trying to use mod_python to fetch data from Mysql db (through
ODBC) and execute voicemail application.
Below a part of my script:

db=MySQLdb.connect("localhost","root","","test")
       Cursor=db.cursor()
       sql = "SELECT email FROM VM WHERE called_num=%s" % the_dest
       Cursor.execute(sql)
       while (1):
               Results = Cursor.fetchone()
               if Results == None:
                       break
               consoleLog("debug", "Found email " + Results[0] +"\n")
               the_recipient = Results[0]
       db.close()

Now i have email address corresponding with called number. The
question is how to use it for voicemail application?
So it also means how to omit all /directory/default/....xml, where
there are all VM parameters set and use fetched data.

       session.answer()
       session.execute("voicemail", "default ${domain} " + the_dest)

Is this possible or should I start all VM app in python from the scratch?

Thanks,
Maciej




More information about the FreeSWITCH-users mailing list