SIP / SIMPLE text messages in Asterisk

During the next telephony of the next office, I noticed that in the MicroSIP softphone we selected there was some built-in “chat”, which, however, did not work out of the box.

image

This program uses the SIP MESSAGE method ( RFC 3428 ), also known as the SIMPLE protocol, to forward messages .

In Asterisk, its support appeared in version 10, but the documentation here, as often happens, was far behind progress. First, I had to search the forums for various configuration options for a long time, and then try them out by trial and error.

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

accept_outofcall_message = yes
outofcall_message_context = messages
auth_message_requests = no


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

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


Put the number X in accordance with the number of digits in your extension numbers.

Hooray, everything works!

image

you can send messages to hardware phones:

image

Well, craftsmen can modify the dialplan for various purposes, for example, to send SMS or e-mail. 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 compatibility problems may arise here.

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

Also popular now: