[Home]

Summary:ASTERISK-03554: Fax extension doesnt work with macros?
Reporter:deon (deon)Labels:
Date Opened:2005-02-21 01:58:42.000-0600Date Closed:2008-01-15 15:29:01.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have macros so that when an incoming call comes in my ZAP device, it goes to a "stdexten" macro - which has call forward options and voicemail options.

I also have fax detection turned on.

If I have an incoming call, which is a fax call, asterisk recognises its a fax, but doesnt redirect it to the fax extension.

If I dont use macros in the incoming contect, asterisk redirects it to the fax and it works.

****** ADDITIONAL INFORMATION ******

Some background:

* in zapata.conf (pruned):
signalling=fxs_ks
context=zap-caller
channel => 1

signalling=fxo_ks
context=default
channel => 2

(So, 1 is incoming PSTN, 2 is fax machine)

* in extension.conf (pruned)
[fax]
exten => fax,1,Dial(Zap/2|60|d)
exten => fax,2,Congestion
exten => fax,102,Congestion

[zap-caller]
include => voicemail
include => local-extensions
include => invalid-extension
include => timeout

exten => s,1,answer
exten => s,2,Ringing
exten => s,3,Macro(stdexten,200,SIP/200)

include => fax

* With the above extensions.conf, asterisk does NOT redirect to fax machine - the console shows this:
router*CLI>
   -- Hungup 'Zap/1-1'
   -- Starting simple switch on 'Zap/1-1'
   -- Detecting post-CID distinctive ring
Feb 21 18:33:20 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
Feb 21 18:33:21 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
Feb 21 18:33:23 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
   -- Detected ring pattern: 268,238,118
   -- Checking 265,235,115
   -- Distinctive Ring matched context zap-caller
   -- Executing Answer("Zap/1-1", "") in new stack
   -- Executing Ringing("Zap/1-1", "") in new stack
   -- Executing Macro("Zap/1-1", "stdexten|200|SIP/200") in new stack
   -- Executing DBget("Zap/1-1", "temp=CF/160103200") in new stack
   -- DBget: varname=temp, family=CF, key=160103200
   -- DBget: Value not found in database.
   -- Executing Goto("Zap/1-1", "s|10") in new stack
   -- Goto (macro-stdexten,s,10)
   -- Executing Dial("Zap/1-1", "SIP/200|20|t") in new stack
   -- Called 200
   -- SIP/200-15f2 is ringing
   -- Redirecting Zap/1-1 to fax extension
   -- Timeout on Zap/1-1
 == CDR updated on Zap/1-1
   -- Executing Ringing("Zap/1-1", "") in new stack
   -- Executing Wait("Zap/1-1", "2") in new stack
   -- Executing Playback("Zap/1-1", "invalid") in new stack
   -- Playing 'invalid' (language 'en')
   -- Executing Congestion("Zap/1-1", "") in new stack

* If I change extensions.conf to this:
[zap-caller]
include => voicemail
include => local-extensions
include => invalid-extension
include => timeout

exten => s,1,answer
exten => s,2,Ringing
exten => s,3,Dial(SIP/200|60|t)
include => fax

Then asterisk correctly connects call to fax:
router*CLI>
   -- Starting simple switch on 'Zap/1-1'
   -- Detecting post-CID distinctive ring
Feb 21 18:37:20 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
Feb 21 18:37:21 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
Feb 21 18:37:23 NOTICE[26780]: chan_zap.c:5426 ss_thread: Got event 2 (Ring/Answered)...
   -- Detected ring pattern: 268,239,119
   -- Checking 265,235,115
   -- Distinctive Ring matched context zap-caller
   -- Executing Answer("Zap/1-1", "") in new stack
   -- Executing Ringing("Zap/1-1", "") in new stack
   -- Executing Dial("Zap/1-1", "SIP/200|60|t") in new stack
   -- Called 200
   -- SIP/200-ad7d is ringing
   -- Redirecting Zap/1-1 to fax extension
   -- Executing Dial("Zap/1-1", "Zap/2|60|d") in new stack
   -- Called 2
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 is ringing
   -- Zap/2-1 answered Zap/1-1
   -- Attempting native bridge of Zap/1-1 and Zap/2-1
   -- Hungup 'Zap/2-1'
   -- Hungup 'Zap/1-1'


* Also, it seems strange, than I need to include the "fax" lines in both the zap-caller context and the macro-stdextn context otherwise asterisk complains about not having a fax extension configured, or invalid fax extension.
Comments:By: Olle Johansson (oej) 2005-02-26 01:46:46.000-0600

The fax extension is not in the current extension - the macro context.

By: deon (deon) 2005-02-26 01:52:32.000-0600

But it is - I've shown an example of my extensions.conf above...?

By: Brian West (bkw918) 2005-02-26 18:20:52.000-0600

he's saying that your exten => fax doesn't exist in [macro-stdexten]

/b

By: Brian West (bkw918) 2005-02-26 18:21:45.000-0600

Also move your include.. to the top.. or don't include it.  Just to test.

/b

By: Tilghman Lesher (tilghman) 2005-02-27 11:10:32.000-0600

The other problem you have is:

for the fax extension to work, you need to have a spot in your dialplan where you're listening for DTMF (i.e. Background()) for several seconds.  Otherwise, you're dialling your SIP extension immediately -- before Asterisk has a chance to detect the CNG tones (what the fax machine sends).

That's all that fax detection really is -- detecting the CNG tones and doing something different accordingly.  Put that in your dialplan, and I think you'll find that it works as advertised.

By: deon (deon) 2005-02-27 15:03:02.000-0600

Guys, your responses are not consistent with the problems Ive experienced:

bkw918: The fax extension does exist in [macro-stdextn], because if I remove the include => fax from [macro-stdexten], asterisk says "Incoming fax call but fax entension not defined" (or something to that effect).

bkw918: I did have the include => fax underneath the other include => * statements in [zap-caller] - however the results did not change. (I also had it as the first line and the last line in [macro-stdextn]...)

Croyden76: I'm confused why I need the background() when I dont have that in the 2nd part of my example (the example where I am not using macros, instead I am dialing the SIP device in the current context with Dial) and it works fine? So why do I need a background() when using macros?

In summary: Asterisk correctly recognises fax callers when one comes in. However, if I use a macro in the processing of a call, then the call doesnt make it to the fax extension.

When I DONT use macro's when processing a call it does make it to the fax extension.

Perhaps you can give me a working example with a macro? I'll happily try it and give you the results...

If there is some debugging I can turn on to trace what is happening, then I'd be happy to as well... I used asterisk -(many v's and many d's), but it didnt show too much...

By: Olle Johansson (oej) 2005-02-27 15:11:17.000-0600

Add a fax extension to the current context, the macro, and you'll see the difference. The macro executes in the macro context, not in the calling context, so there is no fax extension in the current context during execution of the macro.

By: Mark Spencer (markster) 2005-02-27 18:21:15.000-0600

Try latest CVS head.  I don't have a setup here with a fax to test it, but in principle now it should properly handle it without including "fax" in the macro (clearly the ideal behavior is that having it in the main context should work fine).

By: deon (deon) 2005-02-27 23:13:17.000-0600

Thanks markster - I'll test in two weeks, (I'm away at the moment...)

By: Mark Spencer (markster) 2005-03-03 16:58:53.000-0600

Presuming fixed, feel free to reopen the bug if it's not fixed for you in your testing in two weeks.

By: Russell Bryant (russell) 2005-03-27 23:42:53.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:26:23.000-0600

Repository: asterisk
Revision: 5100

U   trunk/channels/chan_zap.c

------------------------------------------------------------------------
r5100 | markster | 2008-01-15 15:26:23 -0600 (Tue, 15 Jan 2008) | 2 lines

Look for faxexten in the main context, too (bug ASTERISK-3554)

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

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

By: Digium Subversion (svnbot) 2008-01-15 15:29:01.000-0600

Repository: asterisk
Revision: 5283

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

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

look for the fax extension in the main context, as well (bug ASTERISK-3554)

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

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