Wrong status of MessageSend action


Im sending SIP MESSAGE with AMI. I’m reciving status:

Response: Success
Message: Message successfully sent

In log files i can find that message was sent:

[2018-06-21 11:51:04] DEBUG[31190] chan_sip.c: Header 0 [ 66]: MESSAGE sip:user@hostname;transport=TLS;ob SIP/2.0
[2018-06-21 11:51:04] DEBUG[31190] chan_sip.c: Header 1 [ 64]: Via: SIP/2.0/TLS hostname;branch=z9hG4bK31d7c98f;rport
[2018-06-21 11:51:04] DEBUG[31190] chan_sip.c: Header 2 [ 16]: Max-Forwards: 70

But client was offline and the answer didnt came. Dialog was destroyed:

[2018-06-21 11:51:36] DEBUG[1049] chan_sip.c: Auto destroying SIP dialog ‘32cc16b74fd9481e2fb50b9914e45b7f@hostname:5060’
[2018-06-21 11:51:36] DEBUG[1049] chan_sip.c: Destroying SIP dialog 32cc16b74fd9481e2fb50b9914e45b7f@hostname:5060
[2018-06-21 11:51:36] VERBOSE[1049] chan_sip.c: Really destroying SIP dialog ‘32cc16b74fd9481e2fb50b9914e45b7f@hostname:5060’ Method: MESSAGE

Can i somehow obtain information that message was not sent successfully?

Status “Message successfully sent” seems to be impropper for such case. Status is received instantly, but if client wont send OK 200 it wont be true:

Im using chan_sip. Asterisk 11.13

Best regards,

That appears to be a feature request, as it would require something similar in semantics to Answer() to be added, for out of dialogue messages, to handle cases where the intended result of receiving a message was not to send an outgoing message.

I hoped that info that message was not delivered would be in AMI Events, but i didnt managed to find it. Its appears to be only in log files.

Is there any way to catch such cases without tailing log files?

Not really, the status reflects whether the channel driver has accepted the request or not.

At least situation is clear :slight_smile:

Thanks very much for info!

One thing that may be causing me confusion is that SIP clients never send 200 OK status, they only send requests.

I had read it as you were objecting to:

SIP Client send MESSAGE to Asterisk
Asterisk responds 200 OK before disposing of messages.
Asterisk sends MESSAGE to SIP Server
TLS connection is stalled

whereas what you might be suggesting is that Asterisk is returning a success status to the dialplan, not the client, when the server fails to respond.

This is a case when Message is sent between two clients,

So Client A is sending MESSAGE to Asterisk. Asterisk is replying with OK 200 and creates a new Message to second client. Such situation will appear when Client B has lost connection and this MESSAGE is not delivered, and thus its answer was never confirmed.

We document this behavior as such too[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_MessageSend

Thanks very much for answer Joshua!

SIP user agents can be both clients and servers. In your case, the final recipient is a UAS (User Agent Server) when it receives the message, not a UAC.

Unfortunately, people tend to use client to mean the small, peripheral, machine, and server to mean the large central one, but that is not how SIP uses the terms.