How Do I Enable Instant Messaging Support For PJSIP Endpoints On Asterisk 13.1.0?

Home » Asterisk Users » How Do I Enable Instant Messaging Support For PJSIP Endpoints On Asterisk 13.1.0?
Asterisk Users 6 Comments

Hello,

I am looking for documentation support for enabling instant messaging between endpoints using Asterisk 13.1.0 and vanilla VoIP clients such as Zoiper. Where do I enable this support on the server side and does it need anything on the client side? I see plenty of online help for chan_sip, but nothing for chan_pjsip.

I imagine there is both pjsip.conf configuration and extensions.conf configuration?

Any help is appreciated.

Thanks, Sonny.

6 thoughts on - How Do I Enable Instant Messaging Support For PJSIP Endpoints On Asterisk 13.1.0?

  • The default message context for the pjsip is the same the call context, so to set the new message context for the pjsqip you need to modify your pjsip.endpoint_custom.conf and add the message context as in the example below :

    [100]

    type=endpoint

    aors0

    auth0-auth

    allow=ulaw,alaw,gsm,g726

    context=from-internal

    callerid

  • So, the only thing that is needed in the endpoint definition in pjsip.conf
    (there is no such file pjsip.endpoint_custom.conf) is

    *message_context=astsms*

    Is that correct? Anything I need to do in extensions.conf? I see that the messages are received at Asterisk (when I turn on pjsip set logger on) but they are not delivered to the other endpoint. What gives?

    Any help appreciated. Thanks!

  • According to what I have done , I add the message_context to the pjsip.endpoint_custom.conf in /etc/asterisk and then I create that message_context in the extension.conf, and it works.

  • Here is my extension .
    [astsms]
    exten => _.,1,NoOp(SMS receiving dialplan invoked)
    exten => _.,n,NoOp(To ${MESSAGE(to)})
    exten => _.,n,NoOp(From ${MESSAGE(from)})
    exten => _.,n,NoOp(Body ${MESSAGE(body)})
    exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
    exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
    exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
    exten => _.,n,GotoIf($[“${MESSAGE_SEND_STATUS}” != “SUCCESS”]?sendfailedmsg)
    exten => _.,n,Hangup()

    exten =>
    _.,n(sendfailedmsg),Set(MESSAGE(body)=”[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}]
    Your message to ${EXTEN} has failed. Retry later.”)
    exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)}) exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
    exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
    exten => _.,n,Hangup()
    exten => _.,n,Hangup()

  • I did this, but I do not see this as part of my dialplan. And the chat still does not work. Why is this not documented anywhere for Asterisk 13?
    Is this supported still, in Asterisk 13.x?