[Freeswitch-users] XML lib curl - what is the best practice for directory binding?

can_man at gmx.de can_man at gmx.de
Mon Jan 5 07:16:04 PST 2009


Hello,

I have been looking into the xml curl directory binding and I would like to update the wiki with the accepted best practice. I have listed the HTTP POST request I am getting and how I respond. If there is a better way please let me know and I will update the wiki accordingly. Btw, what I have done works - so no bug hunting this time ;-)
I will make a pylons webserver available in the next few days, starting with dialplan and directory support.

Thank you,
Phil
 

At boot:
HTTP POST request 1

[('hostname', u'voip'), ('section', u'directory'), ('tag_name', u''), ('key_name', u''), ('key_value', u'')]

my response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory" description="arbitrary stuff here">
</section>
</document>

I have left the response empty as I want to provide the users at runtime. 

----------------------------------------------------------------------- 
At boot:
HTTP POST request 2

[('hostname', u'voip'), ('section', u'directory'), ('tag_name', u''), ('key_name', u''), ('key_value', u'')]

my response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory" description="arbitrary stuff here">
</section>
</document>
 
----------------------------------------------------------------------- 
At boot:
HTTP POST request 3

[('hostname', u'voip'), ('section', u'directory'), ('tag_name', u'domain'), ('key_name', u'name'), ('key_value', u'192.168.178.22'), ('domain', u'192.168.178.22'), ('purpose', u'network-list')]

my response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory" description="arbitrary stuff here">
</section>
</document>

 
What is meant by network list here? If all the users should be loaded at boot time, is this the request which should get a response with the complete list?

---------------------------------------------------------------------- 

During runtime following this action:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="RE Dial Plan For FreeSwitch">
<context name="public">
<extension name="test10000">
<condition field="destination_number" expression="^(10000)$">
<action application="voicemail" data="default $${domain} 315"/>
</condition>
</extension>
</context>
</section>
</document>


HTTP POST request:
('hostname', u'voip'), ('section', u'directory'), ('tag_name', u'domain'), ('key_name', u'name'), ('key_value', u'192.168.178.22'), ('mailbox', u'315'), ('key', u'id'), ('user', u'315'), ('domain', u'192.168.178.22'), ('ip', u'217.10.79.9')

my response:
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
   <document type="freeswitch/xml">
      <section name="directory" description="arbitrary stuff here">
         <domain name="192.168.178.22"> //change to your domain
           <groups>
             <group name="default">
               <users>
                 <user id="315" mailbox="315">
                   <params>
                     <param name="password" value="1234"/>
                       <param name="vm-password" value="0000"/>
                     </params>
                     <variables>
                       <variable name="accountcode" value="315"/>
                       <variable name="user_context" value="default"/>
                       <variable name="vm_extension" value="315"/>
                       <variable name="max_calls" value="1"/>
                       <variable name="fail_over" value="415"/>
                       <variable name="cringback" value="us-ring"/>
                     </variables>
                   </user>
                 </users>
               </group>
             </groups>
           </domain>
         </section>
     </document>
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger




More information about the FreeSWITCH-users mailing list