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

João Mesquita jmesquita at freeswitch.org
Sat Feb 13 14:00:05 PST 2010


Not sure what you are asking since you provided the answer yourself...

Yes it is possible and that is the way to do it.

JM


On Sat, Feb 13, 2010 at 5:03 PM, mbsip <mbsip at gazeta.pl> wrote:

> 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
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100213/8fc53e30/attachment-0002.html 


More information about the FreeSWITCH-users mailing list