[Home]

Summary:ASTERISK-23804: Asterisk Manager API Action Originate / OriginateResponse
Reporter:kondik (kondik)Labels:Asterisk12
Date Opened:2014-05-29 08:31:39Date Closed:2014-05-30 09:38:52
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
is the original version of this clone:ASTERISK-14125 [patch] Asterisk Manager API Action Originate / OriginateResponse
Environment:Attachments:
Description:I have the following issue.  
When placing an outbound call with Asterisk Manager's Originate command, i.e:

{code}
Action: Originate
Channel: Local/konrad@test
Context: test
Exten: 5000
Priority: 1
Callerid: 22222222
Timeout: 10000
Variable: VAR1=23,VAR2=24,VAR3=25
ActionID: ABC45678901234567902
Async: True
{code}

When the call to konrad@test is timeout or no_answered, I get an OriginateResponse reason of `0` and `Failure` as the response.  
I should be getting a "No Answer" reason (should be "Reason: 1" ?? according to this: http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Originate)

below my OriginateResponse event:

{code}
Event: OriginateResponse
Privilege: call,all
ActionID: ABC45678901234567902
Response: Failure
Channel: Local/konrad@test-00000078;1
Context: test
Exten: 5000
Reason: 0
Uniqueid: 1401368963.512
CallerIDNum: 22222222
CallerIDName: <unknown>
{code}

I've tested on the following platforms:
Asterisk 12.1.1

The same case is when the called number is BUSY then "Reason" is "0" also.

Is any solution to fix this problem?

Thanks in advance,
Regards,
Konrad

Comments:By: Matt Jordan (mjordan) 2014-05-29 09:07:57.659-0500

As I mentioned on ASTERISK-14125, this is clearly not always the case. Something about your dialplan, or some other aspect of your system, is resulting in the reason code being returned as 0 (which is the default response code of "this thing got hung up on and didn't answer").

For starters, please do the following:
# Test with the latest from Asterisk 12 (12.3.0-rc2 or the branch)
# Provide your entire dialplan
# Provide a DEBUG log

By: Richard Mudgett (rmudgett) 2014-05-29 11:21:05.911-0500

The following commit corrected the regression that you are seeing:
{noformat}
r412581 | rmudgett | 2014-04-18 11:38:20 -0500 (Fri, 18 Apr 2014) | 25 lines

Originated calls: Fix several originate call problems.

* Restore the reason value set by pbx_outgoing_attempt() to use
AST_CONTROL_xxx values as all the consumers were expecting rather than
cause codes.

* Fixed the dial routines to set cause codes for more than just
ast_request() so pbx_outgoing_attempt() reason codes will function.

* Fix inconsistent locked_channel return status in pbx_outgoing_attempt().
The chanel may not have been locked or the channel may have been a stale
pointer.

* Fixed the OutgoingSpoolFailed channel to run dialplan whenever the
dialing fails for an originate exten and 1 < synchronous.

* Fix incorrect ast_cond_wait() usage in pbx_outgoing_attempt().
Indroduced by issue ASTERISK-22212 patch.

* Made struct pbx_outgoing use the ao2 lock instead of its own lock for
the cond wait mutex.  No sense in having two locks associated with the
same struct when only one is needed.

Review: https://reviewboard.asterisk.org/r/3421/
{noformat}


By: kondik (kondik) 2014-05-30 05:07:58.831-0500

Many thanks for your help.

I have installed Asterisk 12.3.0 and now it works!!!
So 12.1 version of Asterisk has a bug.

Regards,
Konrad

By: Richard Mudgett (rmudgett) 2014-05-30 09:38:52.905-0500

Was already fixed before the issue was reported.