<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello All,</p>
<p>I have been stuck on this for a few days now and need some help.</p>
I understand that the "params" parameter passed to my
xml_fetch(params) function should contain a switch event but I never
get anything else but params being a NoneType (i.e. not set). The
function is being called but I have no idea of what xml is being
requested.
<p>Can anyone give me any leads as to how I can load configuration
using python?</p>
<p>Setup below:<br>
</p>
<p>In autoload_configs/python.conf.xml I have:</p>
<p><configuration name="python.conf" description="PYTHON
Configuration"><br>
<settings><br>
<param name="xml-handler-script" value="ahf1"/><br>
<param name="xml-handler-bindings"
value="configuration,dialplan,directory"/><br>
</settings><br>
</configuration><br>
</p>
<p>In ahf1.py I have:</p>
<p># BIND TO AN XML LOOKUP<br>
#<br>
# default name for binding to an XML lookup is "xml_fetch" it can
be overridden with <modname>::<function><br>
# params a switch_event with all the relevant data about what is
being searched for in the XML registry.<br>
#<br>
def xml_fetch(params):<br>
</p>
<p><snip></p>
<p> if not params:<br>
consoleLog("info", 'ahf: No params\n')<br>
return xml<br>
<br>
purpose = Event.getHeader(params, 'purpose')<br>
profile = Event.getHeader(params, 'profile')<br>
key = Event.getHeader(params, 'key')<br>
<br>
consoleLog("info", 'ahfp1: ' + purpose + '\n')<br>
consoleLog("info", 'ahfp2: ' + profile + '\n')<br>
consoleLog("info", 'ahfp3: ' + key + '\n')<br>
return xml<br>
<br>
</p>
<font face="Verdana, Helvetica, Sans-Serif" color="#000000">Many
thanks & kind regards,<br>
<br>
Adrian Fretwell<br>
</font><small><small><small><br>
</small></small></small>
</body>
</html>