[Home]

Summary:ASTERISK-05454: Problem with app_dial & cause handling
Reporter:Manuel Guesdon (mguesdon)Labels:
Date Opened:2005-11-04 11:11:21.000-0600Date Closed:2008-01-15 15:54:35.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Having

[TEST]
exten => 120,1,NoOp(=== 120 === accountcode=${ACCOUNTCODE} )
exten => 120,2,NoOp()
exten => 120,3,NoOp()
exten => 120,4,Dial(SIP/012345@NotExistingPeer)
exten => 120,5,NoOp(In 120 Success-DIALSTATUS=${DIALSTATUS})
exten => 120,105,NoOp(In 120 Failure-DIALSTATUS=${DIALSTATUS})

Produce:
   -- Executing NoOp("SIP/oxy_stdphone2-3bf0", "=== 120 === accountcode=oxy_stdphone2 ") in new stack
   -- Executing NoOp("SIP/oxy_stdphone2-3bf0", "") in new stack
   -- Executing NoOp("SIP/oxy_stdphone2-3bf0", "") in new stack
   -- Executing Dial("SIP/oxy_stdphone2-3bf0", "SIP/012345@NotExistingPeer") in new stack
Nov  4 17:39:39 WARNING[9377]: chan_sip.c:1947 create_addr: No such host: NotExistingPeer
Nov  4 17:39:39 NOTICE[9377]: app_dial.c:978 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination)
 == Everyone is busy/congested at this time (1:0/0/1)
   -- Executing NoOp("SIP/oxy_stdphone2-3bf0", "In 120 Failure-DIALSTATUS=CHANUNAVAIL") in new stack
Nov  4 17:39:49 WARNING[9377]: pbx.c:2420 __ast_pbx_run: Timeout, but no rule 't' in context 'TEST'

We have a good dialstatus: CHANUNAVAIL produced by chan_sip (cause 3 - No route to destination) around line 11494:
if (create_addr(p, host)) {
*cause = AST_CAUSE_UNREGISTERED;

BUT app_dial.c do a ast_cdr_busy (via HANDLE_CAUSE around line "Unable to create channel of type '%s'") instead of doing ast_cdr_failed() which seems more appropriate. HANDLE_CAUSE also process congestion and unregistered as BUSY disposition which doesn't seems appropriate, IMHO.
I think we should at least set it to 'failed' or may be better: adding some dispositions like those returned in DIALSTATUS (CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL | DONTCALL | TORTURE)




Comments:By: Kevin P. Fleming (kpfleming) 2005-11-07 20:15:07.000-0600

Fixed in CVS HEAD. Thanks for the detailed bug report!

By: Digium Subversion (svnbot) 2008-01-15 15:54:35.000-0600

Repository: asterisk
Revision: 7006

U   trunk/ChangeLog
U   trunk/apps/app_dial.c

------------------------------------------------------------------------
r7006 | kpfleming | 2008-01-15 15:54:35 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5454

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7006