[Home]

Summary:ASTERISK-04356: Fax detection will not properly jump to fax detection if inside a macro
Reporter:Kevin P. Fleming (kpfleming)Labels:
Date Opened:2005-06-05 23:16:57Date Closed:2011-06-07 14:10:19
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_adsi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 4368.headcommit.txt
( 1) 4471.stable.patch.txt
Description:I've been having the following problem today :<br />
I have a quite simple dialplan made to receive a fax:<br />
<br />
[answer-extension]<br />
exten => 1,1,Answer<br />
exten => 1,2,Macro(setcallerid)<br />
exten => 1,3,Ringing<br />
exten => 1,4,Wait(3)<br />
exten => 1,5,Macro(stdfwd3iax-notransfer,${EXTENSION},${EXTENSION},${EXTENSION})<br />
<br />
exten => fax,1,Goto(faxreceive,1,1)<br />
<br />
The Wait(3) is there simply to give the system a bit of time to detect if it's a fax calling, this has worked so far in all cases except today.<br />
I received a fax from overseas and it seems that Asterisk has been unable to detect that it was a fax in the 3 seconds wait. Changing to 5s was sufficient to receive the fax. But obviously this is not a solution I want to adopt all the time as 1-it's a tool long wait, 2-what happens if 5s is still not enough another time.<br />
<br />
So Asterisk recognized that a fax was being received while executing the macro stdfwd3iax-notransfer (this extension simply check if it can call a SIP phone and forward to voicemail if not)<br />
<br />
And I saw the following message in the console:<br />
   -- Executing VoiceMail("Zap/10-1", "u200") in new stack<br />
   -- Playing '/data/asterisk/var/spool/asterisk/voicemail/default/200/unavail' (language 'en')<br />
   -- Redirecting Zap/10-1 to fax extension<br />
May 25 01:19:34 WARNING[17629]: pbx.c:2412 ast_pbx_run: Timeout, but no rule 't' in context 'answer-extension'<br />
   -- Hungup 'Zap/10-1'<br />
<br />
It seems that Asterisk once entered in a Macro is unable to jump to the fax extension and gave me a timeout (which I do not handle in my dialplan). If I change the Wait(3) into Wait(0) the problem can be easily reproduced at all times.<br />
<br />
I then added a fax extension in the Macro just in case, but it made no difference whatsoever.<br />
<br />
The fully log is below.<br />
<br />
   -- Accepting call from '' to '85735200' on channel 0/10, span 1<br />
   -- Executing AGI("Zap/10-1", "getnumber.agi|200") in new stack<br />
   -- Launched AGI Script /data/asterisk/var/lib/asterisk/agi-bin/getnumber.agi<br />
   -- AGI Script getnumber.agi completed, returning 0<br />
   -- Executing Set("Zap/10-1", "EXTENSION=00") in new stack<br />
   -- Executing Goto("Zap/10-1", "answer-extension|1|1") in new stack<br />
   -- Goto (answer-extension,1,1)<br />
   -- Executing Answer("Zap/10-1", "") in new stack<br />
   -- Executing Macro("Zap/10-1", "setcallerid") in new stack<br />
   -- Executing GotoIf("Zap/10-1", "11?10:11") in new stack<br />
   -- Goto (macro-setcallerid,s,10)<br />
   -- Executing Set("Zap/10-1", "CALLERID(number)=''") in new stack<br />
   -- Executing GotoIf("Zap/10-1", "0?20") in new stack<br />
   -- Executing Ringing("Zap/10-1", "") in new stack<br />
   -- Executing Wait("Zap/10-1", "0") in new stack<br />
   -- Executing Macro("Zap/10-1", "stdfwd3iax-notransfer|200|200|100") in new stack<br />
   -- Executing DBget("Zap/10-1", "temp=CFIM/200") in new stack<br />
   -- DBget: varname=temp, family=CFIM, key=200<br />
   -- DBget: Value not found in database.<br />
   -- Executing Goto("Zap/10-1", "3") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s,3)<br />
   -- Executing Dial("Zap/10-1", "IAX2/iax100|20|tr") in new stack<br />
May 25 01:19:21 NOTICE[17629]: app_dial.c:972 dial_exec_full: Unable to create channel of type 'IAX2' (cause 3)<br />
 == Everyone is busy/congested at this time (1:0/0/1)<br />
   -- Executing NoOp("Zap/10-1", "CHANUNAVAIL") in new stack<br />
   -- Executing Goto("Zap/10-1", "s-CHANUNAVAIL|1") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s-CHANUNAVAIL,1)<br />
   -- Executing Goto("Zap/10-1", "s|400") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s,400)<br />
   -- Executing Dial("Zap/10-1", "SIP/ipp100|20|tr") in new stack<br />
May 25 01:19:21 NOTICE[17629]: app_dial.c:972 dial_exec_full: Unable to create channel of type 'SIP' (cause 3)<br />
 == Everyone is busy/congested at this time (1:0/0/1)<br />
   -- Executing Goto("Zap/10-1", "s2-CHANUNAVAIL|1") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s2-CHANUNAVAIL,1)<br />
   -- Executing Goto("Zap/10-1", "s|200") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s,200)<br />
   -- Executing DBget("Zap/10-1", "temp=CFBS/200") in new stack<br />
   -- DBget: varname=temp, family=CFBS, key=200<br />
   -- DBget: Value not found in database.<br />
   -- Executing Goto("Zap/10-1", "202") in new stack<br />
   -- Goto (macro-stdfwd3iax-notransfer,s,202)<br />
   -- Executing VoiceMail("Zap/10-1", "u200") in new stack<br />
   -- Playing '/data/asterisk/var/spool/asterisk/voicemail/default/200/unavail' (language 'en')<br />
   -- Redirecting Zap/10-1 to fax extension<br />
May 25 01:19:34 WARNING[17629]: pbx.c:2412 ast_pbx_run: Timeout, but no rule 't' in context 'answer-extension'<br />
   -- Hungup 'Zap/10-1'<br />
<br />
Comments:By: Michael Jerris (mikej) 2005-06-17 20:58:55

stable patch covers chan_zap.c only as vpb and modem_i4l do not include the fax stuff in stable.

By: Russell Bryant (russell) 2005-06-22 10:02:37

fixed in 1.0 with some mods to the patch

1) The channel structure in 1.0 does not have a member 'cid'.  In 1.0, all of the callerid stuff is in one string - callerid.

2) I had to change target_context to just 'char *' rather than 'const char *' because that is what those functions expect in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:39:00.000-0600

Repository: asterisk
Revision: 5967

U   branches/v1-0/channels/chan_zap.c

------------------------------------------------------------------------
r5967 | russell | 2008-01-15 15:39:00 -0600 (Tue, 15 Jan 2008) | 2 lines

correctly jump to fax extension when inside of a macro (bug ASTERISK-4356)

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

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