epretlac
04-28-09, 10:14 AM
Solution:
There are many ways to do this, but the simplest is to make small modification to the default dialplan. (I used a Warp with the 2.0.2.5 images.)
The only change I made was to add this line…
exten => fax,1,goto(fax-rx,s,1)
…to the [demo] context after this line…
exten => s,n,WaitExten ; Wait for an extension to be dialed.
Here’s what the demo context looks like now…
[demo]
;
; We start with what to do when a call first comes in.
;
exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.
exten => fax,1,goto(fax-rx,s,1) ;***** I ADDED THIS LINE ******
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations
In other words, now if we detect a fax calling tone on the line, we direct the call to the [fax-rx] context which then receives the fax. I’ve included the [fax-rx] context below for illustration purposes only -- I haven’t made any changes to it.
; FAX Send and Recv Rules (see below for extensions)
[fax-rx]
exten => s,1,Set(LOCALSTATIONID=123456789)
exten => s,n,Set(LOCALHEADERINFO="Warp Rx Fax Test Page %P Time: %H:%M To: %l From: %r")
exten => s,n,Set(FAXFILE=/tmp/warpfax-${UNIQUEID}.tif)
exten => s,n,Wait(1)
exten => s,n,PIKARxFax(${FAXFILE})
exten => s,n,NoOp(${REMOTESTATIONID})
exten => s,n,NoOp(${FAXPAGES})
exten => s,n,NoOp(${FAXBITRATE})
exten => s,n,NoOp(${FAXRESOLUTION})
By the way, the line I added already exists in the default dialplan at line 545...I just moved it up into the [demo] context. Previously, by default Asterisk plays the standard “demo-congrats” message. Now, we can handle either voice or fax calls on the same line (as I said, if we detect a fax calling tone on the line, we direct the call to the [fax-rx] context which then receives the fax.)
Eric Pretlac
Technical Support Specialist
PIKA Technologies
There are many ways to do this, but the simplest is to make small modification to the default dialplan. (I used a Warp with the 2.0.2.5 images.)
The only change I made was to add this line…
exten => fax,1,goto(fax-rx,s,1)
…to the [demo] context after this line…
exten => s,n,WaitExten ; Wait for an extension to be dialed.
Here’s what the demo context looks like now…
[demo]
;
; We start with what to do when a call first comes in.
;
exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.
exten => fax,1,goto(fax-rx,s,1) ;***** I ADDED THIS LINE ******
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations
In other words, now if we detect a fax calling tone on the line, we direct the call to the [fax-rx] context which then receives the fax. I’ve included the [fax-rx] context below for illustration purposes only -- I haven’t made any changes to it.
; FAX Send and Recv Rules (see below for extensions)
[fax-rx]
exten => s,1,Set(LOCALSTATIONID=123456789)
exten => s,n,Set(LOCALHEADERINFO="Warp Rx Fax Test Page %P Time: %H:%M To: %l From: %r")
exten => s,n,Set(FAXFILE=/tmp/warpfax-${UNIQUEID}.tif)
exten => s,n,Wait(1)
exten => s,n,PIKARxFax(${FAXFILE})
exten => s,n,NoOp(${REMOTESTATIONID})
exten => s,n,NoOp(${FAXPAGES})
exten => s,n,NoOp(${FAXBITRATE})
exten => s,n,NoOp(${FAXRESOLUTION})
By the way, the line I added already exists in the default dialplan at line 545...I just moved it up into the [demo] context. Previously, by default Asterisk plays the standard “demo-congrats” message. Now, we can handle either voice or fax calls on the same line (as I said, if we detect a fax calling tone on the line, we direct the call to the [fax-rx] context which then receives the fax.)
Eric Pretlac
Technical Support Specialist
PIKA Technologies