2

I once used pre-configured asterisk to make calls (using AMI). When I do that the response from originate used to have channel and unique id infos. Now I'm trying to build a new Asterisk. Everything is set but when I call originate only info that response has is "call successfully queued".

Is there any option like "Show extra info on response" hidden somewhere?

You can find the two different responses I get.

this one is the old one, includes some valuable info.

Response: Success
ActionID: 6bf11dfb-4e6c-4eb4-85cd-6c8b8026019f
Message: Originate successfully queued

Event: Newchannel
Privilege: call,all
Channel: SIP/1030-000058aa
State: Down
CallerIDNum: <unknown>
CallerIDName: <unknown>
Uniqueid: 1339103821.22750

Event: Newcallerid
Privilege: call,all
Channel: SIP/1030-000058aa
CallerID: 05359348602
CallerIDName: <Unknown>
Uniqueid: 1339103821.22750
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: ExtensionStatus
Privilege: call,all
Exten: 1030
Context: ext-local
Status: 8

Event: Newstate
Privilege: call,all
Channel: SIP/1030-000058aa
State: Ringing
CallerID: 05359348602
CallerIDName: <unknown>
Uniqueid: 1339103821.22750

Event: Newstate
Privilege: call,all
Channel: SIP/1030-000058aa
State: Up
CallerID: 05359348602
CallerIDName: <unknown>
Uniqueid: 1339103821.22750

Event: ExtensionStatus
Privilege: call,all
Exten: 1030
Context: ext-local
Status: 1

and this is the new one, says nothing

Response: Success
ActionID: 98518f9a-c7cb-4b63-8de4-e185f57508d8
Message: Originate successfully queued

Thanks.

Savas
  • 77
  • 2
  • 10

2 Answers2

3

You are not giving much information about the actual action you are sending (its parameters), but I'll take a (long?) shot. I think that probably you are sending an async originate action, but you really want the sync behavior.

An "async originate action" means that asterisk will accept the command, but will place the call asynchronously, and then will let you know if it succeeded or not with an event that will arrive sometime later.

So, in your case, asterisk is just letting you know that the command arrived, and the call will be placed eventually. In this case, you should listen for incoming events that have the actionid of the action that originated the call, and react upon at that time.

But, if you want to know in a synchronous way if the call actually was answered or not (i.e: get asterisk to not respond to your action until the call has a dialstatus), try setting the async argument of the originate action to false.

See: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_Originate . Notice the "async" argument, that's what you're looking for.

This is also descibed here: http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate

Hope it helps!

marcelog
  • 7,062
  • 1
  • 33
  • 46
  • thanks for the response. I'm calling it from web browser (in a .net desktop app.) like, `code string url = string.format( "http://someip/asterisk/rawman?action=originate&channel=SIP/{0}&exten={1}&Callerid={2}&priority=1&Async=False&ActionID={3}&Context=from-internal",...); ` – Savas Jun 08 '12 at 05:14
  • can you post the resulting action that is sent to asterisk? – marcelog Jun 08 '12 at 10:34
  • do you mean action=status url? – Savas Jun 10 '12 at 08:18
  • No, the action sent to asterisk. You can capture it with tcpdump/wireshark or maybe in the same way you captured the output pasted in the question – marcelog Jun 10 '12 at 12:26
  • my first comment is the action that I send to Asterisk. By the way I used the way you suggested, after the originate I send status and get the unique id then I send monitor. It now has extra one action but it works. Thanks. – Savas Jun 11 '12 at 13:34
1

I experienced the same problem regarding receiving no OriginateResponse when using Async: true and the problem turned out to be permissions for the manager user account.

The AMI user account needs to have either write permission "all" or write permission "call" (originate is not sufficient). Something like this:

[username]
secret=hello
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read=orignate,call
write=originate,command,system,call