1

I've got an installation of FusionPBX with a FreeSWITCH and PostgreSQL backend. I've been reading online in various places that it's possible to use mod_xml_curl to retrieve SIP credentials stored in a MySQL database instead of the static XML files that FreeSWITCH uses.

I am interested, however, in how I can retrieve SIP credentials from the PostgreSQL database that FusionPBX uses using an HTTP GET request. I am currently studying up the fs_curl contribution made by Raymond Chandler (intralanman) but I am a novice developer trying to learn the ropes so any assistance would be very much appreciated.

Dmitry S
  • 4,990
  • 2
  • 24
  • 32
Kismet Agbasi
  • 557
  • 2
  • 8
  • 28

1 Answers1

1

To get started, make changes in xml_curl.conf

<binding name="directory"> <param name="gateway-url" value="http://<directoryserverip>/directory" method="GET" bindings="directory"/> </binding>

Create a web server (directory) that can handle your web request /directory. You should be able to see all the request headers.

create a function to return a dynamic directory xml for that user as mentioned here https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_curl

Note: you know the user name from request header. so make a connection to get the actual password for that user in your DB and substitute in xml and return it as response

Freeswitch will allow the registration if requested password and the one you sent in directory xml matches else it send forbidden.

Sasi Varunan
  • 2,806
  • 1
  • 23
  • 34