1

I'm adjusting simple application that among other things should be able to call another party using Asterisk AMI Originate command.

I'm stuck and I believe that my originate command is wrong.

Where/how can I see log of Originate commands that Asterisk creates when I use regular phone so I can compare it to my hand crafted one?

Milan
  • 969
  • 2
  • 16
  • 34

1 Answers1

2

Use a network sniffer, such as tcpdump or wireshark, and capture the packets that come and go to/from asterisk. By default, it uses 5038/tcp. Check your manager.conf file, and look for the bindaddr and port options to be sure you capture the right traffic.

If you are using ssl (sslenable=yes), then you will have to configure wireshark with your ssl keys, so it can decrypt the traffic or just use normal tcp (without ssl) for debugging and then switch to ssl.

You should see the Action: Originate coming in to asterisk, and the asterisk response and the associated events. Look for the ActionID parameter of the action so you can trace which responses and events correspond to each issued action.

Take into account that an async originate (async: true) will return a response as soon as the action is received by asterisk, but it will then send asynchronous events to inform the call status (once finished). On the other hand, when using async: false, the call will be placed and the response will have the status.

A few more resources on the originate action:

Another question related to the async parameter: Asterisk originate response says successfully queued but nothing more

Hope it helps!

EDIT: Asterisk does not create the originate command, but will dial a target (a channel) based on an incoming originate action, or call file, so your application (the ami client) will issue an originate action and then asterisk will react to it by doing the call. If your call is originating from a phone, it's more probable that the call is being originated by a dial() command in your dialplan.

Community
  • 1
  • 1
marcelog
  • 7,062
  • 1
  • 33
  • 46
  • Well i am using PAMI and when the extension picks up the call it dials other local extension numbers automatically and does not dial to the customer number :( – shzyincu Sep 28 '17 at 10:44