📜 ⬆️ ⬇️

SIP / SIMPLE text messages in Asterisk

During the regular telephony of the next office, I noticed that in the microSIP softphone we chose there is some built-in “chat”, which however does not work “out of the box”.

image

For sending messages, this program uses the SIP MESSAGE ( RFC 3428 ) method, also known as the SIMPLE protocol.
')
In Asterisk, its support appeared in version 10, but the documentation here, as is often the case, is far behind progress. I had to first search the forums for a long time for various configuration options, and then by trial and error to test them.

As a result, such a working configuration was developed (true for Asterisk 11.6.0).
In the [general] section of the sip.conf file (for owners of FreePBX-based systems, the following lines are added to the sip_general_custom.conf file):

accept_outofcall_message = yes outofcall_message_context = messages auth_message_requests = no 


And in dialplan (for FreePBX, the context is added to the extensions_custom.conf file):

 [messages] exten => _XXX,1,MessageSend(sip:${EXTEN},"${CALLERID(name)}"${MESSAGE(from)}) 


Enter the number X in accordance with the number of digits in your internal numbers.

Hooray, everything works!

image

You can send messages to hardware phones:

image

Well, craftsmen can modify the dialplan for different purposes, for example, to send SMS or email. The content of the message is in the variables $ {MESSAGE (from)} $ {MESSAGE (to)} and $ {MESSAGE (body)}

It also makes sense to try setting auth_message_requests = yes - but there may be compatibility issues.

It is also important not to confuse what we are talking about in the article with the textsupport setting - this setting in Asterisk is responsible for a completely different protocol, ITU-T T.140 realtime text .

Source: https://habr.com/ru/post/207622/


All Articles