Category:HowTo:Action URL

From Snom User Wiki

(Redirected from Features/Action URL)
Jump to: navigation, search

Contents

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

$localthe 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 used to show which Expansion Module do you use and
$active_key the Function Key (e.g. P1, P5, P32,..) associated with a call.
$phone_ip the current ip address of the phone
$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)

Note: These variables don't work with all events.

Example:

http://some.server.com/path/to/app.php?mac=$mac&user=$user_name1

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:

http://192.168.X.X/test.php?language=$language
http://192.168.X.X/test.php?redirectnr=$redirect_number&redirecttime=$redirect_time
http://192.168.X.X/test.php?callingto=$remote&callingid=$local

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:

DND on
DND off
Call Forwarding on
Call Forwarding off
Incoming call
Outgoing call
Setup finished
On offhook
On onhook
Missed call
Registration failed
On Connected
On Disconnected
Log on
Log off
Hold call
Unhold call
Transfer call
Blind transfer
Attended transfer
Received Attended transfer
Line Key Long Press

Logging

The execution is logged on the phone and can be easily verified on the phone┬┤s Log page (V6/V7):

[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. It is accessible through the web interface of your phone.


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 Mass deployment 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

--Evgenij tovba 13:44, 24 April 2006 (CEST)

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:

Figure 4: Select 'Speed Dial' from the menu

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 5: Enter the number to dial

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.
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'

--Evgenij tovba 13:44, 24 April 2006 (CEST)

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

Explanation: We tell the dnd.php application that the phone with the MAC address $mac is in DND mode. The server could for example update a presence setting in a database.

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...

This category currently contains no pages or media.

Personal tools
Interoperability