Interrogate an external html server

My experience is with web servers. I have a reasonable understanding of FreePBX.
I understand that its possible to write a module that would do an external HTML enquiry.

What I what is assistance in creating the module and integrating it in to FreePBX.

The module needs to take input from the users phone and then pass that number via HTML to an external server which would then respond with another number which could be one of an internal extension, Ring Group or an external number.

Any assistance would be appreciated.

Possibly https://www.voip-info.org/asterisk-func-curl/ will do what you want, but please provide more details about your application.

Assuming that you want an incoming caller to reach an IVR, press option keys and then be routed to an extension, ring group or misc destination (external number), that’s built into FreePBX. What does the external server ‘know’ that can’t be easily be done directly in FreePBX?

The external server will be making decisions about what number to have the call transferred based on level of credit, time of day, day of week, and a few other criteria.

There will be in excess of 1,000 possible incoming number to choose from, hopefully grow to 10,000 or more.

The external server runs a website based on the same data and it makes sense to have just the one database to maintain.

OK. so route the DID to a Custom Destination whose context executes a Read; see https://www.voip-info.org/asterisk-cmd-read/ .

Then, do the URL lookup as described earlier and Goto the destination returned by the lookup.

Not saying a web lookup would be the wrong choice, but connecting to a remote service through a listener process is no different than many of the Caller ID scripts that run now.

Another possibility is to write a service caller on your server that runs in the shell and execute that to pull the data in a “more raw” format. This might be easier than pulling data from a web page. You can then connect the local service caller program using one of many different methods, including “system()” calls.

There are LOTS of ways to skin this cat. I’m sure we can help you find one that satisfies your need.

Third party module dynroutes may do most of what your looking for:

Hi. I’ve down;loaded and had a look at the files but can’t see anything that gives me an overview of what the package does or how to access it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.