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

mbsip mbsip at gazeta.pl
Sat Feb 13 13:59:13 PST 2010


There is a lack of connection between fatched data and voicemail and I
dont know how to achieve it.

Thx,
Maciej.


2010/2/13 mbsip <mbsip at gazeta.pl>:
> Thx for prompt reply.
>
> The main task is to be able to use Mysql db in conjunction with VM
> (but not only voicemail_msgs, voicemail_prefs).
>
> Lets imagine sb is calling 1000 and wants to record the message.
> According to mod_voicemail settings message should be sent to some
> email address.
> But the information about user 1000 and his settings like email
> address, passwd, quota should be fetched from Mysql db, not from
> directory/default/1000.xml.
> That's why I am using <action application="python" data="test"/> in my
> dialplan to work with python script which in turn should do the magic.
> The script should be able to gather all necessery data about user 1000
> (like email address in shown example) and use them in VM.
>
> So the problem is how to modify the script to force voicemail app to
> use data from DB.
> Currently  session.execute("voicemail", "default ${domain} " +
> the_dest) is still using .xml files.
>
> Thx,
> Maciej.
>
>
> 2010/2/13 Michael Jerris <mike at jerris.com>:
>> Can you describe what your trying to accomplish, I don't understand what the goal is.  What feature are you looking for that does not already exist in mod_voiceamil.
>>
>> Mike
>>
>> On Feb 13, 2010, at 3:03 PM, mbsip 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?
>>
>>
>> _______________________________________________
>> 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
>>
>




More information about the FreeSWITCH-users mailing list