FAQ/How to change settings using SIP message

From Snom User Wiki

Jump to: navigation, search
Languages: English • Deutsch

Answer

Starting with Version 8.7.3 you can change the phone settings by sending a SIP MESSAGE.

Here is an example on how to do this:

1) Configure these settings on the phone┬┤s web interface

Support broken Registrar: "on"
Filter Packets from Registrar: "off"
Network identity (port): 5060
Allow SIP Settings: "on"

2) Re-boot (!!) the phone but do NOT reset it!

3) Set up at least one identity (e.g. 430@10.10.12.150:5060) on the phone and select it as outgoing identity.

4) Let's assume you want to change the setting log_level and set its value to 9. Place the following lines into a plain textfile (ie. settingsmessage.txt) and replace with your applicable values. (If you want to change more settings, just add one line in the xml for each setting)

MESSAGE sip:430@10.10.12.150:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.59:5055
From: <sip:sipsak@192.168.10.59>;tag=2502
To: <sip:430@10.10.12.150>;tag=2502
Call-ID: blablub@snomxxx
CSeq: 1 MESSAGE
Max-Forwards: 70
Event: snom-settings
Content-Type: application/xml
Content-Length: 88

<settings>
<phone-settings>
<log_level>9</log_level>
</phone-settings>
</settings>

or since 8.7.5 you can use event-type snom-action and an action-xml to change the settings (you need to activate "allow SIP XML-actions" first):

MESSAGE sip:430@10.10.12.150:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.59:5055
From: <sip:sipsak@192.168.10.59>;tag=2502
To: <sip:430@10.10.12.150>;tag=2502
Call-ID: blablub@snomxxx
CSeq: 1 MESSAGE
Max-Forwards: 70
Event: snom-action
Content-Type: application/xml
Content-Length: 129

<action>   
  <assign when="on notify">
    <source value="9"/>
    <destination context="setting" id="log_level"/>
  </assign>
</action>

5) Make sure the Content-Length header in the file in the previous step is correct. Content-Length is the correct sum of characters in the content, keeping in mind that we must count 2 extra characters for each line because at the end of every line there is a \r\n to represent the newline which we don't see (for example here the actual text has 78 characters, and we must add 2 more for each line. The sum is 78+2*5=78+10=88, so the header is 'Content-Length: 88')

6) Install sipsak on any computer in your network (Linux/ Windows versions available) and enter the following command:

sipsak -i -O ID -l 5055 -f settingsmessage.txt -s sip:430@10.10.12.150:5060 -v


Troubleshooting

  • See the SIP trace in order to check if the SIP message has reached the phone e.g.:
MESSAGE sip:430@10.10.12.150:5060;...
  • The message is sent to a specific identity on the phone, e.g., 430@10.10.12.150 therefore the phone must be set to that identity before (!!) --> The message can be matched then and the phone answers "200 OK" otherwise "404 Not Found"


Example of SIP flow

Received from udp:192.168.10.59:5055 at 31/5/2012 03:15:05:737 (387 bytes):

MESSAGE sip:430@10.10.12.150:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.59:5055
From: <sip:sipsak@192.168.10.59>;tag=2502
To: <sip:430@10.10.12.150>;tag=2502
Call-ID: blablub@snom320xxx
CSeq: 1 MESSAGE
Max-Forwards: 70
Event: snom-settings
Content-Type: application/xml
Content-Length: 88

<settings>
<phone-settings>
<log_level>9</log_level>
</phone-settings>
</settings>

Sent to udp:192.168.10.59:5055 at 31/5/2012 03:15:05:787 (200 bytes):

SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.10.59:5055
From: <sip:sipsak@192.168.10.59>;tag=2502
To: <sip:430@10.10.12.150>;tag=2502
Call-ID: blablub@snom320xxx
CSeq: 1 MESSAGE
Content-Length: 0
Personal tools
Interoperability