Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Trying to load xml using mod_python3


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
adrian at a2es.co.uk
Guest





PostPosted: Mon Nov 14, 2022 5:33 pm    Post subject: [Freeswitch-users] Trying to load xml using mod_python3 Reply with quote

Hello All,
I have been stuck on this for a few days now and need some help. 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.
Can anyone give me any leads as to how I can load configuration using python?
Setup below:

In autoload_configs/python.conf.xml I have:
<configuration name="python.conf" description="PYTHON Configuration">
  <settings>
    <param name="xml-handler-script" value="ahf1"/>
    <param name="xml-handler-bindings" value="configuration,dialplan,directory"/>
  </settings>
</configuration>

In ahf1.py I have:
# BIND TO AN XML LOOKUP
#
# default name for binding to an XML lookup is "xml_fetch" it can be overridden with <modname>::<function>
# params a switch_event with all the relevant data about what is being searched for in the XML registry.
#
def xml_fetch(params):

<snip>
    if not params:
        consoleLog("info", 'ahf: No params\n')
        return xml

    purpose = Event.getHeader(params, 'purpose')
    profile = Event.getHeader(params, 'profile')
    key = Event.getHeader(params, 'key')

    consoleLog("info", 'ahfp1: ' + purpose + '\n')
    consoleLog("info", 'ahfp2: ' + profile + '\n')
    consoleLog("info", 'ahfp3: ' + key + '\n')
    return xml

Many thanks & kind regards,

Adrian Fretwell
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services