Freepbx https call via virtual extension or custom destination?


(Charles) #1

Running FreePBX 14.0.13.26 at the moment and i want to know if its possible todo an url call somehow.
I want to call this url from a button on the phone.
We are running a Gira Homeserver that has endpoints enabled and i call those like this:

https://{ipserver}/endpoints/call?key=CO@4_5_0&method=set&value=1&user={user}&pw={pw}

Now 2 questions:

  1. Is it possible to do this from Freepbx/Asterisk?
  2. The Homeserver has a self signed certificate, will Freepbx do that? or block it?

(Lorne Gaetz) #2

Nothing to it, you want a Custom Destination. Add something like the following to extensions_custom.conf:

[from-internal-Dujith]
exten => s,1,Noop(Entering user defined context [from-internal-Dujith] in extensions_custom.conf)
exten => s,n,Set(result=${CURL(url_goes-here)})
exten => s,n,Return

The create a Custom Destination with a goto string of from-internal-Dujith,s,1, select the return option and choose the destination where the call goes next after the URL is loaded. If you need a dialable feature code, that’s a Misc Application

Certs on the PBX are irrelevant. The only uncertainty in my mind is the special characters in the URL, the @ and {} may need to be escaped by preceding each with a \ character. .


IVR with PIN + API query
Execute HTTP request on custom numbers
#3

I believe that you do have to disable certificate verification. See
https://marcelog.github.io/articles/asterisk_json_curl_dialplan.html
search for ssl_verifypeer


(Charles) #4

@Stewart1 @lgaetz
Thank you very much i’ll get to work with this.


(Charles) #5

@Stewart1
I had to add the line
same => n,Set(CURLOPT(ssl_verifypeer)=0)
to get it to accept the selfsigned cert. Thanks for the tip

@lgaetz
That worked like a charm (with the ssl adjustment), i was wondering if there was a way to end this with a nice beep or something? right now it will just hangup.

Edit: Found it, still getting head wrapped around the non-gui stuff. But after rephrasing my question in google found this:
exten => s,n,Playback(confbridge-leave)
exten => s,n,Hangup

Thanks for the help! reading up on macro’s and stuff like that.


(system) closed #6

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