Content
Syntax
Action URLs are basically HTTP "GET" requests and may contain variable names starting with $ as values in the query part of the url. Starting with version 8.9.3.X also the URL fragment can contain these variables. Key and value are separated by '=', key value pairs by '&':
http://192.168.X.X/test.php?key1=$variable1&key2=$variable2&... http://192.168.X.X/test.xml#key1=$variable1&key2=$variable2&...
The following variables may be used for your own pattern:
Static variables
Note: that you have to put a dollar sign ($) in front of the variable. Configuration Parameters stored on the phone's Settings page.
Note: private settings e.g. passwords are replaced by empty strings
Runtime variables
$local | the SIP URI of callee |
$remote | the SIP URI of caller |
$active_url | the SIP URI of the active outgoing identity |
$active_user | the user part of the SIP URI for the active outgoing identity |
$active_host | the host part of the SIP URI for the active outgoing identity |
$csta_id | CSTA ID |
$call-id | the call-id of the active call |
$display_local | used to display the name of callee |
$display_remote | used to display the name of caller. |
$expansion_module | |
$active_key | the Function Key (e.g. P1, P5, P32,..) associated with a call. |
$phone_ip | the current ip address of the phone (the L2TP ip address if the phone is connected via L2TP and $local_ip otherwise) |
$local_ip | the local ip address of the phone (the wlan or cable interface ip address) |
$nr_ongoing_calls | contains the number of active calls |
$context_url | used in log_on/off-action to provide the sip-uri of the logged-on/off |
$cancel_reason | when a call has been canceled/terminated via sip-cancel this will paste the content of the reason-header |
$longpress_key | returns the name of the Function Key, which was long pressed (longer than 2 seconds), if Settings/action_longpress_url is set (e.g. P1) |
$sip_header | returns the value of the sip_header name indicated. If inside an action url this is specified: sip_header=$sip_header(HEADER_NAME), then the value of the first incoming INVITE of that header is replaced inside the action url. The following exceptions exists, and cannot be named: Via, To, From, Call-ID, Expires, Route, Record-Route, Contact, Content-Type, CSeq, Content-Length, Max-Forwards. A subsequent Re-Invite will not update the header information concerning action URLs. |
Example:
The variable "$mac" will be dynamically replaced with the MAC-Address of the phone and "$user_name1 " will be replaced with the username of the first identity.
More Examples:
See the Examples section below to get a further understanding.
Events
On the Web User Interface --> Action URL Settings page predefined events for Action URL triggering are listed:
Action URL polling scheduler
One action URL get request can also be triggered by using the polling scheduler, listed on Web User Interface --> Action URL Settings as well.
The URL is configured via: action_poll_url and the the scheduler configuration details in settings action_poll_mode, action_poll_period, action_poll_time, and action_poll_time_rand_end are adapted from the functionality of the scheduler used for Provisioning Polling for desk phones.
Logging
The execution is logged on the phone and can be easily verified on the phone´s Log page:
[2] 11/4/2006 10:52:43: Sending post request host = 192.168.X.X:80, file = /test.php?your_pattern1=$variable1
Applications
Figure 1: "Function Keys" Overview
Figure 1 shows the "Function Keys" page which is accessible through the left menu of the web interface of your phone. Here you can change the behaviour of the function keys on the phone. This is the main page we will refer to in the following screenshots and descriptions.
A simple example: Let's suppose we have a Call Center. We have several agents, some are calling, some are busy preparing the call notes, some are out for lunch. Now an agent who was busy before is available for a call again, obviously he/she has to tell the call distributor about it. By provisioning a function key with such an option we can make the operators' life easier (see also the Auto Provisioning information). That's how it's done:
Figure 2: Select 'Action URL' from the menu
Go to the "Function Keys" page on the web interface and choose a function key to use. Select "Action URL" from the "Type" fields (see Figure 2).
Figure 3: Enter the desired URL in the field
Now type in the URL of your application server that needs to know about the current status of the agent.
e.g. http://192.168.0.1/free.php?number=$user_name1
Explanation: The phone will place a HTTP GET to http://192.168.0.1/free.php give the user name of the first identity in the parameter number. This can then be catched in the application and update the status of an agent.
Minibrowser
The Action URLs can also retrieve Minibrowser applications. Further details can be found at the Minibrowser XML Objects page.
Examples
Special Mailbox number on the 'Retrieve' button
Similar to modern cellular phones the 'Retrieve' Button takes the place of the Mailbox key, which is used to go to the mailbox of the account. Normally you don't have to worry about the number to dial to achieve this, since it is implemented in the MWI message from the server. But in some cases you want to use a special number on the retrieve key. That's how it's done:
Go to the 'Function Keys' page on the web-interface of your phone and select 'Speed Dial' as the type in the 'Retrieve' row, (see Figure 4).
Figure 4: Select "Speed Dial" from the menu
In the "Number" field, right next to the "Type" field, enter the number of your Mailbox. Please ask your operator for the proper number. Usually it is your own number, or a star code, e.g. *99.
Figure 5: Enter the number to dial
Note : The call will be made in the currently selected context, i.e. you have to manually select the identity you wish to use first. Also keep the active dial plans in mind.
... And Action! The "Action URL Settings"
Figure 6: The 'Action URL Settings' page
As you can see in Figure 6, we are using the 'Action URL Settings' to tell a server that the phone is in DND mode.
e.g. http://server.com/dnd.php?mac=$mac
Imagine another scenario: You are listening to your favourite MP3s at work and want to stop the player automatically when you have an incoming call. Or: You want to be alerted on your cell phone or your favourite Instant Messaging client, when you have missed a call.
As an Administrator: Keep an eye of the phones in your company and make sure, all phones are set up. And so on...
Further Information
Related articles