How To Determine If AMI MessageSend Succeeded?

Home » Asterisk Users » How To Determine If AMI MessageSend Succeeded?
Asterisk Users 2 Comments

I am using Asterisk 11.0.0 and have a SIP user called 100. The user registers via SIP but their network connection is cut off.

I then proceed to use AMI to send a message to them.

root@yumyum:~# telnet 127.0.0.1 5038
Trying 127.0.0.1… Connected to 127.0.0.1. Escape character is ‘^]’. Asterisk Call Manager/1.3
Action: Login Username: admin Secret: test

Response: Success Message: Authentication accepted

Event: FullyBooted Privilege: system,all Status: Fully Booted

Action: MessageSend To: sip:100
From: Test
Body: This is a test.

Response: Success Message: Message successfully sent

However, clearly the message is not sent since the device lost its network connection. How can I know that it failed? Even the log does not appear to show anything unless I turn sip debug on.

2 thoughts on - How To Determine If AMI MessageSend Succeeded?

  • I would recommend two things. Number one would be to tweak your logger.conf to separate out error messages. Number two would be to make your ami call do this:

    Set sip debug on

    Ami action

    Set sip debug off

    This lets you get what you need without making a huge log file.

    From: asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Wen Li Sent: Tuesday, November 06, 2012 4:48 PM
    To: asterisk-users@lists.digium.com Subject: [asterisk-users] How to determine if AMI MessageSend succeeded?

    I am using Asterisk 11.0.0 and have a SIP user called 100. The user registers via SIP but their network connection is cut off.

    I then proceed to use AMI to send a message to them.

    root@yumyum:~# telnet 127.0.0.1 5038

    Trying 127.0.0.1…

    Connected to 127.0.0.1.

    Escape character is ‘^]’.

    Asterisk Call Manager/1.3

    Action: Login

    Username: admin

    Secret: test

    Response: Success

    Message: Authentication accepted

    Event: FullyBooted

    Privilege: system,all

    Status: Fully Booted

    Action: MessageSend

    To: sip:100

    From: Test >

    Body: This is a test.

    Response: Success

    Message: Message successfully sent

    However, clearly the message is not sent since the device lost its network connection. How can I know that it failed? Even the log does not appear to show anything unless I turn sip debug on.

  • Thanks for your help! Do you know if there’s a way to read the sip debug messages without opening the log file on the disk, such as through AMI?