When free-box extension called make a http request with parameters

Hello Guys,
I’m ok with free-box when I need to make telephony but I need some additional task to solve here.
I need to make that if I call the 200*123456 the freepbx calls a URL with parameters like:
*http : //iphere:port/endpoint_200?ext:200&id:123456

Can someone guide me howto make it?

bűn

Maybe this would be a good start for you to look into how to create custom contexts:

1 Like

The solution was this:
[from-internal-custom]
exten => _200X.,1,NoOp(Calling custom URL)
exten => _200
X.,n,Set(CALLER_EXT=${CALLERID(num)})
exten => _200X.,n,Set(ID=${EXTEN:4})
exten => _200
X.,n,Set(URL=“http : //iphere:port/endpoint_200?ext=${CALLER_EXT}&id=${ID}”)
exten => _200X.,n,NoOp(Sending request to URL: ${URL})
exten => _200
X.,n,Answer()
exten => _200X.,n,Wait(2)
exten => _200
X.,n,Set(RESULT=${CURL(${URL})})
exten => _200X.,n,NoOp(CURL result: ${RESULT})
exten => _200
X.,n,Hangup()

In this case if an extesnion calls 200XXXXXX the aterisk will drop the 200 and will send the caller party as ext and the XXXXXX as id to the given IP with query string parameter.
I leave this here for later folks.

needed to add this into the /etc/asterisk/custom_extension.conf

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