Unable to send Messages between clients

I am new to asterisk. My last company used 3CX, but this place uses asterisk, which I like better for its simplicity.

I am however having trouble getting messaging setup with users.

this is my test group in my sip conf

 accept_outofcall_message = yes
 outofcall_message_context=astsms

 [1001]
  type=friend
 context=internal
 host=dynamic
 secret=Chaz1429
 callerid="Upstairs Office" <1001>
 mailbox=1001@default
 disallow=all
 allow=ulaw
 allow=alaw
 allow=gsm
 nat=force_rport,comedia
 directmedia=no
 message_context=astsms
 
 [1005]
 type=friend
 context=internal
 host=dynamic
 secret=Chaz1429
 callerid="Charles Mobile" <1005>
 mailbox=1005@default
 disallow=all
 allow=ulaw
 allow=alaw
 allow=gsm
 nat=force_rport,comedia
 directmedia=no
 message_context=astsms
 
 [1006]
 type=friend
 context=internal
 host=dynamic
 secret=Chaz1429
 callerid="Home PC" <1006>
 mailbox=1006@default
 disallow=all
 allow=ulaw
 allow=alaw
 allow=gsm
 nat=force_rport,comedia
 directmedia=no
 message_context=astsms

and this is my extensions.conf

 [astsms]
 exten => _X.,1,NoOp(SMS receiving dialplan invoked)
 exten => _X.,n,NoOp(To ${MESSAGE(to)})
 exten => _X.,n,NoOp(From ${MESSAGE(from)})
 exten => _X.,n,NoOp(Body ${MESSAGE(body)})
 exten => _X.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
 exten => _X.,n,MessageSend(sip:${ACTUALTO}@SipServerIP,${MESSAGE(from)})
 exten => _X.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
 exten => _X.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != "SUCCESS"]?sendfailedmsg)
 exten => _X.,n,Hangup()
 exten => _X.,n(sendfailedmsg),Set(MESSAGE(body)="${STRFTIME(${EPOCH},,%d%m%Y-H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.")
 exten => _X.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
 exten => _X.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
 exten => _X.,n,MessageSend(sip:${ACTUALFROM}@SipServerIP,ServiceCenter)
 exten => _X.,n,Hangup()

and this is my log when I send a message

     -- Executing [1005@astsms:1] NoOp("Message/ast_msg_queue", "SMS receiving dialplan invoked") in new stack
     -- Executing [1005@astsms:2] NoOp("Message/ast_msg_queue", "To sip:1005@SipServerIP") in new stack
     -- Executing [1005@astsms:3] NoOp("Message/ast_msg_queue", "From "Home PC" <sip:1006@SipServerIP>") in new stack
     -- Executing [1005@astsms:4] NoOp("Message/ast_msg_queue", "Body hi") in new stack
     -- Executing [1005@astsms:5] Set("Message/ast_msg_queue", "ACTUALTO=sip:1005") in new stack
     -- Executing [1005@astsms:6] MessageSend("Message/ast_msg_queue", "sip:sip:1005@SipServerIP,"Home PC" <sip:1006@SipServerIP>") in new stack
     -- Executing [1005@astsms:7] NoOp("Message/ast_msg_queue", "Send status is SUCCESS") in new stack
     -- Executing [1005@astsms:8] GotoIf("Message/ast_msg_queue", "0?sendfailedmsg") in new stack
     -- Executing [1005@astsms:9] Hangup("Message/ast_msg_queue", "") in new stack
   == Spawn extension (astsms, 1005, 9) exited non-zero on 'Message/ast_msg_queue'
     -- Executing [1006@astsms:1] NoOp("Message/ast_msg_queue", "SMS receiving dialplan invoked") in new stack
     -- Executing [1006@astsms:2] NoOp("Message/ast_msg_queue", "To sip:1006@SipServerIP;transport=UDP") in new stack
     -- Executing [1006@astsms:3] NoOp("Message/ast_msg_queue", "From <sip:1005@SipServerIP;transport=UDP>") in new stack
     -- Executing [1006@astsms:4] NoOp("Message/ast_msg_queue", "Body Yo") in new stack
     -- Executing [1006@astsms:5] Set("Message/ast_msg_queue", "ACTUALTO=sip:1006") in new stack
     -- Executing [1006@astsms:6] MessageSend("Message/ast_msg_queue", "sip:sip:1006@SipServerIP,<sip:1005@SipServerIP;transport=UDP>") in new stack
     -- Executing [1006@astsms:7] NoOp("Message/ast_msg_queue", "Send status is SUCCESS") in new stack
     -- Executing [1006@astsms:8] GotoIf("Message/ast_msg_queue", "0?sendfailedmsg") in new stack
     -- Executing [1006@astsms:9] Hangup("Message/ast_msg_queue", "") in new stack
   == Spawn extension (astsms, 1006, 9) exited non-zero on 'Message/ast_msg_queue'

Any help would be greatly appreciated :slight_smile:

On Wednesday 29 May 2024 at 23:10:39, chartmann1590 via Asterisk Community
wrote:

I am new to asterisk.

this is my test group in my sip conf

Which Asterisk version are oy using?

Antony.


There’s a good theatrical performance about puns on in the West End. It’s a
play on words.

                                               Please reply to the list;
                                                     please *don't* CC me.

Asterisk 16.2.1~dfsg-2ubuntu1 built by nobody @ buildd.debian.org on a unknown running Linux on 2020-02-12 22:54:27 UTC

These two are incompatible, although this is unlikely to be the specific issue here.

The latest version of Asterisk doesn’t have chan_sip and it hasn’t been effectively maintained for some years.

You need to get your support from Debian, as Asterisk 16, all versions, is past end of life, and this is a very early sub-version of Asterisk 16.

Both requests claim to have worked, and you have provided no evidence to the contrary.

Sorted it out. Updated my extensions.conf and simplified it alot

[messages]
exten => _.,1,NoOp(Message received from ${MESSAGE(from)})
same => n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
same => n,MessageSend(${ACTUALTO},${MESSAGE(from)})
same => n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
same => n,Hangup()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.