Action Urls#
Info
This function is available in Release 1.4 A
Action Urls are http-get-request that are either send from your phone to a PC/PBX/server (any IP you configure) or the other way around, in which case the phone is the http-server.
Incoming Action Urls#
Incoming Action Urls (i.e. phone is http-server) are used to control the phone from a PC or wherever. I.e. make it call some one or put a call on hold or transfer it.
Setup#
You need to allow incoming Action Urls, they are off by default. In the phone go to settings
-> access
and enable allow action URLs
Usage#
You can send Action Urls directly from the phones website. Log in and then change the addressbar to e.g.: https://[yourPhonesIp]/api/v1/exec/command?action=call&number=42
.
You may also use any other tool to send http-get-requests (aka Action Urls) to the phone. Unix users might want to use curl
. The phone uses tokens to verify http-requests from outside the Web-UI. You can generate such tokens in the Web-UI under Access. Use such a token either as value of an http-header named Authorization or pass it as query-parameter. E.g. (if token is abcefg):
curl --insecure -H "Authorization: Bearer abcdefg" -i "https://[yourPhonesIp]/api/v1/exec/command?action=call&number=42"
curl --insecure -i "https://[yourPhonesIp]/api/v1/exec/command?action=call&number=42&AuthToken=abcdefg"
commands#
The list of available commands can be fetched by sending the Action Url https://[yourPhonesIp]/api/v1/exec/command?action=?
.
Version 1.4 supports these commands: log
, resume
, accept
, terminate
, show
, call
, transfer
, hold
, join
, conference
, dtmf
.
A detailed description of parameters and usage of each command can be obtained here or by sending the Action Url https://[yourPhonesIp]/api/v1/exec/command?action=[aAction]&help
.
Outgoing Action Urls#
Outgoing Action Urls (i.e. phone sends http-get-requests) are used to inform a PC/PBX/server about calls. I.e. a new incoming call, a call got held, a call has ended and so on.
Setup#
You need to tell the phone where to send those events. In the phone go to settings
-> access
and enter an IP in action URL server
. You may also add path and protocol like http://my.server/events
or https://my.server/auerswald/incomingActionUrls
. Whenever this setting is not empty and there is a change in the calls the phone has, then it tries to issue an http-get-request to the given server.
Usage/Events#
Whenever the phone sends an Action Url, it adds all relevant details to the query of the http-get-request. Always part of the query is the mac-address of the phone in case it is needed by your server to differentiate between multiple phones.
-
?event=incoming&callId=TC@1&accountId=1&number=42&name=Peter
-> new incoming call on first identity from Peter whose tel-nr is 42 -
?event=outgoing&callId=TC@2&accountId=1&number=43
-> new outgoing call on first identity to 43 -
?event=remoteUpdate&callId=TC@2&number=43&name=Franz
-> new details (name and or number) for call TC@2 -
?event=connected&callId=TC@2
-> call TC@2 got connected, i.e. both parties can now talk to each other. This event is issued whenever a call was accepted or resumed from hold. -
?event=holding&callId=TC@2
-> call TC@2 got put on hold -
?event=disconnected&callId=TC@1
-> call TC@1 has ended / was hung up -
?event=conferenced&callId=TC@1&callId2=TC@2
-> call TC@1 and TC@2 are now in a conference -
?event=unconferenced&callId=TC@1&callId2=TC@2
-> conference with calls TC@1 and TC@2 was dissolved (does not mean that the calls have ended) -
?event=transferred&callId=TC@1&number=45
-> person on other side of call TC@1 has changed, call was transferred and user is now talking to 45 -
?event=transfer_done&callId=TC@1&number=46
-> call TC@1 has been transferred away. Person on other side is no longer talking to this phones user but instead with whoever answers 46 -
?event=transfer_initiated&callId=TC@1&callId2=TC@2
-> phone is trying to connect calls TC@1 and TC@2. I.e. an attended transfer, if it works both remote parties will be talking to each other. -
?event=transfer_failed&callId=TC@1&callId2=TC@2
-> attended transfer failed, could be a network issue or maybe one of the remote parties canceled the transfer. -
?event=transfer_done&callId=TC@1&callId2=TC@2
-> attended transfer was successful
Advanced#
Action Urls are scripted. I.e. in our phones there are scripts which control how the Action Urls work. These scripts are written in lua and can be changed. You can download the settings from your phone, adapt them and re-upload (i.e. via provisioning or restore backup). You will find the scripts in the luaAutoStarters section. I.e. you could modify them to always send the number-parameter in Action Urls events or never the mac. You can also add new scripts that automatically accept, transfer or terminate calls from a certain number.
If you are using Pbx CallAssist with an Auerswald PBX you should probably leave the incoming Action Url script as is because our PBX is assuming the phone to have the standard behaviour. You can still create your improoved version through copy-paste and changing the path where the script listens for http-commands.