Table of Contents

Snom LED Remote Control

Snom phones provide a set of programmable buttons, for example Snome 360 and 370 have 12 such buttons. You can extend by buying an extension panel.

Also, Snom provides a simple protocol to control this buttons from a remote site. See more about LED remote control on Snom site at:

Starting with v1.5.0, controlling the buttons with Kamailio only is trivial, by using uac module and uac_req_send().

This tutorial shows simple config to turn on/off the LEDs on your phone, showing available light modes by dialing special extensions (no answer, just busy tone back with LED light updates).

Dialing number:

When the function key is pressed, the Snom phone will call '432' (turn LED light off).

Snom Phone Setup

The only thing you have to do is to set the function key as button. With a web browser go to your phone, access “Functions Key” in menu, and set your preferred key as button.

In this example, I used a phone with username (extension) 101, registered to Kamailio running on 192.168.178.23. The key is P2 - here is a screenshot from Snom phone config page:

Kamailio Config

The config snippets in this section are for Kamailio v3.0.x. A tutorial about how to install v3.0.x from GIT repository is available at:

First, load uac module and set append_fromtag for rr module:

loadmodule "uac.so"
...
modparam("rr", "append_fromtag", 1)

Then, define a route block, named SNOMLRCINV, that handles the extensions for LED remote control.

# Snom LRC for INVITE
route[SNOMLRCINV] {
	if(!is_method("INVITE"))
		return;
	if (!($ua =~ "snom"))
		return;
 
	if(!($rU =~ "^4"))
		return;
 
	switch($rU) {
		case "431":
			$var(light) = "on";
		break;
		case "432":
			$var(light) = "off";
		break;
		case "433":
			$var(light) = "hold";
		break;
		case "434":
			$var(light) = "park";
		break;
		case "435":
			$var(light) = "pickup";
		break;
		case "436":
			$var(light) = "message";
		break;
		case "437":
			$var(light) = "offline";
		break;
		case "438":
			$var(light) = "seized";
		break;
		case "439":
			$var(light) = "record";
		break;
		case "440":
			$var(light) = "error";
		break;
		default:
			return;
	}
 
	sl_send_reply("404", "Not a call");
 
	$uac_req(method) = "MESSAGE";
	$uac_req(ruri) = $sel(contact.uri);
	$uac_req(furi) = "sip:server@" + $Ri;
	$uac_req(turi) = $tu;
	$uac_req(ouri) = "sip:" + $si + ":" + $sp;
	$uac_req(hdrs) = "Content-Type: application/x-buttons\r\n";
	$uac_req(body) = "k=2\r\nc=" + $var(light)
			+ "\r\nn=432\r\na=invite\r\nl=Ligth is " + $var(light);
 
	uac_req_send();
	exit;
}

Just copy and paste it in your kamailio.cfg, for example at the end of the file. If you use a different function key than 2, then update k=X in $uac_req(body).

Then call this route before doing lookup(“location”) in main route block, like:

	# add next line in your config
	route(SNOMLRCINV);
 
	if (!lookup("location")) {
	...

Testing

Dial numbers from 431 to 440 to see the type of LED light. Press the function key to turn LED light off.

kb.asipto.com_images_snom-370.jpg

Use cases

This example is not really useful in real world, its goal being to show how to send SIP messages from Kamailio to Snom in order to control the function keys. But there are many nice services you can provide to your customers using Snom phones:

See Also