Hi guys,
I now have this working as follows:
On each extention goto edit - Advanced - Messages Context - Add myMessages
save
apply Config
goto Admin - Config Edit
edit extensions_custom.conf
Add the following
[myMessages] ; myMessages is the name of the dialplan and can be changed to whatever you want ( also change in extensions )
exten => _.,1,NoOp(mymessage 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(mymessage Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != "SUCCESS"]?sendfailedmsg)
exten => _.,n,Hangup()
;
; Handle failed messaging
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) ; ServiceCenter is just a name for the sender of the message
exten => _.,n,Hangup()
exten => _.,n,Hangup()
In my mobile app I send and device messages okay. I also noticed that a Grandstream GPX1628 we use for testing also gets messages.
I also had
;100
message_context=myMessages added in pjsip.endpoint_custom_post.conf ( not sure what this does ) I removed it and the messaging still works.
One anomaly if the extension does not have Advanced - Messages Context = myMessages when you send a message to that extension it rings. You can answer the call but nothing happens and you can end the call. ( Any ideas ?)
Hope this helps…
Any better ways to achieve this please add to post.