Maciej,<br><br>Take a look at the xml_hooks we have on mod_python. Might do the trick for you.<br><br><a href="http://svn.freeswitch.org/svn/freeswitch/trunk/src/mod/languages/mod_python/python_example.py">http://svn.freeswitch.org/svn/freeswitch/trunk/src/mod/languages/mod_python/python_example.py</a><br>
<br>JM<br>
<br><br><div class="gmail_quote">On Sat, Feb 13, 2010 at 6:59 PM, mbsip <span dir="ltr"><<a href="mailto:mbsip@gazeta.pl">mbsip@gazeta.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There is a lack of connection between fatched data and voicemail and I<br>
dont know how to achieve it.<br>
<br>
Thx,<br>
Maciej.<br>
<br>
<br>
2010/2/13 mbsip <<a href="mailto:mbsip@gazeta.pl">mbsip@gazeta.pl</a>>:<br>
<div><div></div><div class="h5">> Thx for prompt reply.<br>
><br>
> The main task is to be able to use Mysql db in conjunction with VM<br>
> (but not only voicemail_msgs, voicemail_prefs).<br>
><br>
> Lets imagine sb is calling 1000 and wants to record the message.<br>
> According to mod_voicemail settings message should be sent to some<br>
> email address.<br>
> But the information about user 1000 and his settings like email<br>
> address, passwd, quota should be fetched from Mysql db, not from<br>
> directory/default/1000.xml.<br>
> That's why I am using <action application="python" data="test"/> in my<br>
> dialplan to work with python script which in turn should do the magic.<br>
> The script should be able to gather all necessery data about user 1000<br>
> (like email address in shown example) and use them in VM.<br>
><br>
> So the problem is how to modify the script to force voicemail app to<br>
> use data from DB.<br>
> Currently session.execute("voicemail", "default ${domain} " +<br>
> the_dest) is still using .xml files.<br>
><br>
> Thx,<br>
> Maciej.<br>
><br>
><br>
> 2010/2/13 Michael Jerris <<a href="mailto:mike@jerris.com">mike@jerris.com</a>>:<br>
>> 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.<br>
>><br>
>> Mike<br>
>><br>
>> On Feb 13, 2010, at 3:03 PM, mbsip wrote:<br>
>><br>
>>> Hello,<br>
>>><br>
>>> I am trying to use mod_python to fetch data from Mysql db (through<br>
>>> ODBC) and execute voicemail application.<br>
>>> Below a part of my script:<br>
>>><br>
>>> db=MySQLdb.connect("localhost","root","","test")<br>
>>> Cursor=db.cursor()<br>
>>> sql = "SELECT email FROM VM WHERE called_num=%s" % the_dest<br>
>>> Cursor.execute(sql)<br>
>>> while (1):<br>
>>> Results = Cursor.fetchone()<br>
>>> if Results == None:<br>
>>> break<br>
>>> consoleLog("debug", "Found email " + Results[0] +"\n")<br>
>>> the_recipient = Results[0]<br>
>>> db.close()<br>
>>><br>
>>> Now i have email address corresponding with called number. The<br>
>>> question is how to use it for voicemail application?<br>
>>> So it also means how to omit all /directory/default/....xml, where<br>
>>> there are all VM parameters set and use fetched data.<br>
>>><br>
>>> session.answer()<br>
>>> session.execute("voicemail", "default ${domain} " + the_dest)<br>
>>><br>
>>> Is this possible or should I start all VM app in python from the scratch?<br>
>><br>
>><br>
>> _______________________________________________<br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
><br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>