Message/ast_msg_queue stuck on Hangup() Application


#1

I’m using asterisk 13.23.1 and I noted that any SIP message sent from one device to another, despite being correctly delivered to the intended destination, get stuck in the Message/ast_msg_queue channel on the Hangup() application, as shown here:

lab-asterisk-1*CLI> core show channels 
Channel              Location             State   Application(Data)             
Message/ast_msg_queu 202@SIPmsgs:5        Up      Hangup()                      
0 active channels
0 active calls
4 calls processed

My sip.conf is:

[general]
accept_outofcall_message=yes
outofcall_message_context=SIPmsgs

My extensions.conf is:

[SIPmsgs]
exten => _X.,1,Verbose(SIP message received)
 same => n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
 same => n,MessageSend(${ACTUALTO},${MESSAGE(from)})
 same => n,Verbose(Send status is ${MESSAGE_SEND_STATUS})
 same => n,Hangup()
 same => n,Hangup()

When a message is sent the Asterisk console shows:

SIP message received
Send status is SUCCESS

I’m using as reference this document

Does anybody knows what I’m doing wrong to cause messages to stuck on Hangup()?

EDIT

With SIP debug enabled, this is what appears when a message is sent from x202 to x201:

lab-asterisk-1*CLI> sip set debug on
SIP Debugging enabled

<--- SIP read from UDP:172.17.79.5:5070 --->
MESSAGE sip:201@172.17.77.234 SIP/2.0
Via: SIP/2.0/UDP 172.17.79.5:5070;branch=z9hG4bK152815559;rport
From: <sip:202@172.17.77.234>;tag=449170377
To: <sip:201@172.17.77.234>
Call-ID: 1093198086-5070-46@BHC.BH.HJ.F
CSeq: 250 MESSAGE
Contact: <sip:202@172.17.79.5:5070>
X-Grandstream-PBX: true
Max-Forwards: 70
User-Agent: Grandstream GXP2160 1.0.9.69
Supported: replaces, path, timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Type: text/plain; charset=UTF-8
Content-Length: 12

teste novo 2
<------------->
--- (14 headers 1 lines) ---
Sending to 172.17.79.5:5070 (no NAT)
Receiving message!
Looking for 201 in SIPmsgs (domain 172.17.77.234)

<--- Transmitting (no NAT) to 172.17.79.5:5070 --->
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP 172.17.79.5:5070;branch=z9hG4bK152815559;received=172.17.79.5;rport=5070
From: <sip:202@172.17.77.234>;tag=449170377
To: <sip:201@172.17.77.234>;tag=as36efd2f6
Call-ID: 1093198086-5070-46@BHC.BH.HJ.F
CSeq: 250 MESSAGE
Server: Asterisk PBX 13.23.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '1093198086-5070-46@BHC.BH.HJ.F' in 32000 ms (Method: MESSAGE)
SIP message received
Reliably Transmitting (no NAT) to 172.17.79.21:5060:
MESSAGE sip:201@172.17.79.21:5060 SIP/2.0
Via: SIP/2.0/UDP 172.17.77.234:5060;branch=z9hG4bK512ce2ba
Max-Forwards: 70
From: "Unknown" <sip:202@172.17.77.234>;tag=as04e4b995
To: <sip:201@172.17.79.21:5060>
Contact: <sip:202@172.17.77.234:5060>
Call-ID: 7fcfce165486ad600022dd855e596426@172.17.77.234:5060
CSeq: 102 MESSAGE
User-Agent: Asterisk PBX 13.23.1
Content-Type: text/plain;charset=UTF-8
Content-Length: 12

teste novo 2
---
Scheduling destruction of SIP dialog '7fcfce165486ad600022dd855e596426@172.17.77.234:5060' in 6400 ms (Method: MESSAGE)
Send status is SUCCESS

<--- SIP read from UDP:172.17.79.21:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.17.77.234:5060;branch=z9hG4bK512ce2ba
From: "Unknown" <sip:202@172.17.77.234>;tag=as04e4b995
To: <sip:201@172.17.79.21:5060>;tag=3074602480
Call-ID: 7fcfce165486ad600022dd855e596426@172.17.77.234:5060
CSeq: 102 MESSAGE
User-Agent: Yealink SIP VP-T49G 51.80.0.120
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '7fcfce165486ad600022dd855e596426@172.17.77.234:5060' Method: MESSAGE
lab-asterisk-1*CLI> 

No mater how much time has elapsed, that channel remain stuck at Hangup().
If Hangup() is removed, the channel get stuck on the immediately preceding command.