Asterisk originate response says successfully queued but nothing more

孤街浪徒 提交于 2019-12-20 03:24:19

问题


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.


回答1:


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!




回答2:


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


来源:https://stackoverflow.com/questions/10940113/asterisk-originate-response-says-successfully-queued-but-nothing-more

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!