14 December 2011

Out Of Office BLF with Snom & 3CX



Today I had someone asking me to configure some way to manually set the PBX to "in the office" or "out of office" and have the phone have lit LEDs to show the "out of office" being enabled.
To be honest I've never been asked to do so since most people are happy using the automatic "office hours" routing provided by 3CX.

So to configure this I had to get a little creative. I used the 3CX emergency dial code and the Snom Action URL

What you'll need:

-3CX commercial edition (since the dial code needed to enable/disable out of office is only included in the commercial version.)
-SNOM Phone (3xx/8xx) with version 8 Firmware

Step 1 : Configure the "EMERGENY DIAL CODE" in 3CX

Log into the 3CX Management console, and go to settings in the left pane.
Click advanced and then click the "dial codes" tab.
At the bottom you will see the "Emergency dial code" this field is empty and you must enter a value there, I used *123. (note that to enable out of office you need to dial *1232 , to disable *1231)

















Step 2: making the XML files needed by the Snom phones

We need to make 2 files, 1 to enable out of office and light up the LEDs on the phone, and one to disable out of office and the LEDs.

The config i used to enable the leds and out of office:

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
<Title>LED Control Feature</Title>
<Prompt>Prompt Text</Prompt>
<Text>Your message here</Text>
<Led number="1">Blink</Led>
<Led number="2">
Blink</Led>
<Led number="3">
Blink</Led>
<Led number="4">
Blink</Led>
<Led number="5">
Blink</Led>
<Led number="6">
Blink</Led>
<Led number="7">
Blink</Led>
<SoftKeyItem>
<Name>#(or another key you like)</Name>
<URL>http://127.0.0.1/command.htm?number=*1232&outgoing_uri=IP OF 3CX</URL>
</SoftKeyItem>
</SnomIPPhoneText>


And to disable the LEDs and out of office:

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText>
<Title>your title</Title>
<Prompt>Prompt Text</Prompt>
<Text>Your message</Text>
<Led number="1">Off</Led> 
<Led number="2">
Off</Led>
<Led number="3">
Off</Led>
<Led number="4">
Off</Led>
<Led number="5">
Off</Led>
<Led number="6">
Off</Led>
<Led number="7">
Off</Led>
<SoftKeyItem>
<Name>#(or another key you like)</Name>
<URL>http://127.0.0.1/command.htm?number=*1231&outgoing_uri=IP OF 3CX</URL>
</SoftKeyItem>
</SnomIPPhoneText>


These XMLs are used by the Snom "minibrowser" and will be read by configuring an URL in the snom (more of that later)
<Text>Your message</Text>  this will be displayed when using the XML on the phone's lcd.
I used something like "to enable/disable out of office press # , then press X)


<Led number="1">Off</Led>this is used to define the LED's state, you can set it to On/Off/Blink
<SoftKeyItem>
<Name>#(or another key you like)</Name>
Here we define a "softkey to the phone (in my case #) that will be used to send a command to the phone to actually call the *1232 or whatever dial code you defined in 3CX.
<URL>http://127.0.0.1/command.htm?number=*1231&outgoing_uri=IP OF 3CX</URL>
</SoftKeyItem>
This is used to enter the command being sent to the phone , number=the emergency code you defined, and outgoing_uri is your 3CX IP.

Save both files as a .XML file and upload them to the 3CX provisioning folder (or another webserver)
You can find the provisioning folder under :
C:\docs&sett\allusers\application data\3CX\Data\http\interface\provsioning or C:\programdata\3CX\Data\http\interface\provsioning

Step 3: Configuring the Snom to use your XML in an Action URL

First make sure your snom is atleast version 8.
Then log on to the phone's webconsole and in the left pane select "function keys" then choose the buttons you would like to use. I used the two bottom ones.

From the drop down menu select "Action URL" and in the value field enter the url to the XML.
In case you used the 3CX provisioning folder:
http://YOURPBX:5000/provisioning/ENABLEOUTOFOFFICE.xml

and in the other button:
http://YOURPBX:5000/provisioning/DISABLEOUTOFOFFICE.xml





Then click save and you're done. Now a user can press the configured button to enable/disbale the leds and complete by pressing the commandbound button to send a phonecall to the the PBX enabling/disbaling the out of office

3 comments:

nick said...

Hello, this looks great.
I am wondering if you know how to do this for a CISCO SPA525g Phone as well ?

nick said...

For the CISCO SPA525g in the .ph.xml file to change the LED it is : c=r;p=f

and to create the softkey :

...;PSK1;PSK2;
fnc=sd;ext=*1231@192.168.2.5;vid=20;nme=IN

But how to make it switch between the IN or OUT of office ???

$3t4*$0uj1r0 said...

Hi Nick,

Sorry for the delayed reply,

You need to go into the dial codes tab of 3CX. (Settings --> Advanced--> Dial codes)
There is a tab with dial codes , which you can define.

There is a dial code at the bottom "emergency code" there you can set one.

Please note that this is only available in the paid version.