Summary:ASTERISK-12057: [patch] Bad disposition on originated IAX2 calls
Reporter:Yves Räber (yraber)Labels:
Date Opened:2008-05-21 02:43:57Date Closed:2008-11-25 16:41:07.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 12694.2nd.diff
( 1) 12694.diff
( 2) iax2_debug
( 3) noanswer_with_patch.debug
Description:When using asterisk manager or a call files to originate a IAX2 call, disposition in cdr is always FAILED on unanswered calls (BUSY, NO ANSWER or FAILED).

* I was able to reproduce this with asterisk manager and call files, it makes no difference.
* The problem does not appear when originating to a SIP trunk.
* The problem does not appear if the call is externally originated (a SIP phone i.e.).

I've attached a IAX debug for the simplest case I could think about : originating a call with a call files, and the called line was busy on purpose. This resulted in a FAILED disposition in the CDR, who should obviously be BUSY.
Comments:By: Joshua C. Colp (jcolp) 2008-05-27 11:50:21

Please try the attached patch.

By: Yves Räber (yraber) 2008-05-28 03:55:25

I tested the patch, here are the results :

1) On BUSY, it's working. The CDR is right.

2) There is still a problem with the NO ANSWER case, this is what I get on the CLI (I set a WaitTime to 10sec in the call file)

*CLI> [May 28 10:59:33] NOTICE[28596]: pbx_spool.c:341 attempt_thread: Call failed to go through, reason (0) Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)

The iax debug is attached.

By: Yves Räber (yraber) 2008-05-28 03:59:19

Some more informations :

Call file

Channel: IAX2/remote_test/1234
Context: test
Extension: 1234
WaitTime: 10

Remote dialplan

exten => _X.,1,NoOp(Just waiting ...)
exten => _X.,2,Wait(300)

By: Jay Vaidya (vdyjay) 2008-08-20 04:30:55

hi i have same issue but i have issue with ZAP channels..i am using .call file to Call out.
cli shows
CLI> Attempting call on Zap/g1/9998073470 for s@outgoing:1 (Retry 1)
   -- Requested transfer capability: 0x00 - SPEECH
   [Aug 20 15:06:59] NOTICE[6084]: pbx_spool.c:341 attempt_thread: Call failed  to go through, reason (3) Remote end Ringing

this should be goes in to "no answer" but it shows "9998073470","Zap/1-1",,"Dial","0","FAILED"
in /var/log/asterisk/cdr-custom/Master.csv

it works fine on BUSY scenario.

asterisk version is "asterisk-"

By: Leif Madsen (lmadsen) 2008-10-27 12:30:28

murf: I've assigned this to you in the hopes you can pick up where file left off and maybe look into the other issues brought up here?

By: Steve Murphy (murf) 2008-11-19 14:11:34.000-0600

OK, I think I understand what's going on (or, in this case, NOT going on)!

The routine, ast_cdr_disposition() was testing and setting the CDR if the
cause was BUSY, but nothing was getting done for cause NOANSWER, which is
set in the __ast_request_and_dial() routine.

So, along with file's IAX fix, I've uploaded a patch to make ast_cdr_disposition
to the right thing. I tested it on my setup, and it turns FAIL to NO ANSWER, which makes it worth testing out. See the attached patch,  12694.2nd.diff

By: laura (laurav) 2008-11-24 03:55:01.000-0600

I tested the second patch on 1.4.19, using ami:

- BUSY disposition worked
- NO ANSWER disposition worked

However the patch in chan_iax2.c was in lines 7258 instead of 7414, i got the 1.4.19 version from:


Is there other location to get it? (for future problems)


By: Steve Murphy (murf) 2008-11-25 15:52:29.000-0600

Laura-- it is normal for patches to have line offsets when applied to different versions; as long as it applied, you are, in the vast majority of cases, OK.

I usually test and apply changes to the "latest" version of a release in SVN.

You can get that by making sure that subversion is installed on your machine, and doing this command:

svn co http://svn.digium.com/svn/asterisk/branches/1.4

It will create a '1.4' directory and populate it with the latest version.

Over time, your copy will get outdated. You can update your copy with:

svn update   (after you cd into the 1.4 dir, of course).

It's entirely possible that problems you might want to report have already been solved in following releases (1.4.19 isn't the latest release any more). It's always good to verify that the problem hasn't been fixed by checking out the release from SVN and giving it a quick spin to verify.

By: Digium Subversion (svnbot) 2008-11-25 16:41:05.000-0600

Repository: asterisk
Revision: 159316

U   branches/1.4/channels/chan_iax2.c
U   branches/1.4/main/cdr.c

r159316 | murf | 2008-11-25 16:41:05 -0600 (Tue, 25 Nov 2008) | 15 lines

(closes issue ASTERISK-12057)
Reported by: yraber
     12694.2nd.diff uploaded by murf (license 17)
Tested by: murf, laurav

Thanks to file (Joshua Colp) for his IAX fix.

the change to cdr.c allows no-answer to percolate
up into CDR's, and feels like the right place to
locate this fix; if BUSY is done here, no-answer
should be, too.