Sip SIMPLE messages with chan_pjsip

I was wondering how do i setup pjsip to accept sip SIMPLE messages and send them to a custom context. this blog highsecurity.blogspot.in/2012/03 … r-sip.html
works great for chan_sip … but i am curious how to do something like this with pjsip?

thanks!

I can confirm I have the same issue. I have a FreePBX system and a few extensions that use chan_sip and all the others use chan_pjsip.

On Bria on my iPhone I can send messages from a chan_sip extension to itself and other chan_sip extensions, but not to other chan_pjsip extensions.

From a chan_pjsip extension on Bria I can’t send to itself or to others; it simply doesn’t work.

In Asterisk, the logs state the following:

[2016-08-17 13:43:35] VERBOSE[3031][C-00000000] pbx.c: Executing [s-CHANUNAVAIL@macro-vm:2] VoiceMail("Message/ast_msg_queue", "115@default,u") in new stack [2016-08-17 13:43:35] ERROR[3031][C-00000000] channel.c: Unable to set format because channel Message/ast_msg_queue supports no formats [2016-08-17 13:43:35] WARNING[3031][C-00000000] file.c: Unable to open /var/spool/asterisk/voicemail/default/115/unavail (format (none)): Function not implemented [2016-08-17 13:43:35] ERROR[3031][C-00000000] channel.c: Unable to set format because channel Message/ast_msg_queue supports no formats [2016-08-17 13:43:35] WARNING[3031][C-00000000] file.c: Unable to open vm-intro (format (none)): Function not implemented

What is strange is with chan_pjsip the message attempts to send like a phone call… and goes to voicemail recordings and can’t transcode because the message isn’t an RTP audio stream… which makes sense.

What am I missing? Is a module not implemented that needs to be for pjsip, or do I need to enable some other similar variables for chan_pjsip to allow messages?

Have you set the message_context endpoint option?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Configuration_res_pjsip#Asterisk13Configuration_res_pjsip-endpoint_message_context

How do you recommend to do this in FreePBX? I tried modifying /etc/asterisk/pjsip.endpoint_custom.conf and adding

[115]
message_context=messages

And ran fwconsole reload and it didn’t take affect when I ran

asterisk -rx ‘pjsip show endpoint 115’

EDIT: Looks like adding a parameter for an extension in custom that is already in pjsip.endpoint.conf will not work. As a test I added message_context to pjsip.endpoint.conf and ran asterisk -rx ‘core reload’ and I could send from that extension to itself.

Now the problem I see is that when there are multiple contacts registered to that same extension, they all aren’t getting the text message, only one. I am using the dialplan that Sanjay had shared to the world in 2011: http://highsecurity.blogspot.com/2012/03/asterisk-10-110-sms-messaging-or-sip.html

If out of call message support is a feature supported in FreePBX, you should raise this on their issue tracker and/or community site.

That’s not going to take into account PJSIP, although the general premises are still the same.

Given that the option you’re referring to is an endpoint setting, so long as the inbound MESSAGE request is identified as belonging to that endpoint, the message_context setting should still apply. My guess is that when you have multiple contacts registered to an AoR, they still have different endpoint objects - which means you’ll need to hunt those down and add the message_context value to those endpoints as well.

If that isn’t the case, you’ll need to debug and figure out what endpoint those requests are being mapped to.

has anyone had any luck figuring out to get message_context into the endpoint’s message_context with out having to modify the pjsip.endpoint.conf directly?

thx