Synopsis:
Flashes a Zap TrunkDescription:
Flash()Sends a flash on a zap trunk. A switchook flash (or link) is an on-hook condition that lasts no less than 200ms, and no more than 1200ms. The actual length is different for different systems (400-600ms is probably the safest). You can perform a flash by pressing the link button on an analog set so equipped, or simply hold down the hookswitch for about half a second (be careful: too long and you'll hang up - too short and it'll be ignored). Note that in the UK BT chose to use a 80ms flash time (aka Recall).
If you have any link-enabled features on your line, a flash is typically how you would access them.
Here's a macro that will perform a link-transfer, which will allow you to transfer calls to an external number from your system without tying up a channel (the incoming line will be freed when the transfer is completed).
[macro-cell_user]
exten => s,1,Playback(transfer)
exten => s,2,Flash()
exten => s,3,SendDTMF(${ARG1})
exten => s,4,Hangup()
exten => s,1,Playback(transfer)
exten => s,2,Flash()
exten => s,3,SendDTMF(${ARG1})
exten => s,4,Hangup()
To call the macro, try something like this:
[globals]
MyCellPhone = 4165551234
[remote_sets]
exten => 6004,1,Macro(cell_user,${MyCellPhone})
MyCellPhone = 4165551234
[remote_sets]
exten => 6004,1,Macro(cell_user,${MyCellPhone})
NOTE: This will only work if link-transfer functionality is available on the incoming line. This is usually a feature you would pay extra for, so don't assume it is there. Call your telco to find out about availabilty and cost in your area. Also, it might be wise to test it out with an analog line directly connected to the circuit so that you can be sure it the feautre functions correctly (as opposed to driving yourself nuts troubleshooting it).
Return codes
Returns 0 on success or -1 if this is not
a zap trunk
Example of Call Waiting with incoming POTS line (Zap)
Most POTS lines use a single hook flash for Call Waiting. The following will allow for the hook flash to be done any time during a call.
extensions.conf
[globals]
DYNAMIC_FEATURES=>zapflash
DYNAMIC_FEATURES=>zapflash
features.conf
[applicationmap]
zapflash => *0,callee,flash,()
zapflash => *0,callee,flash,()
To complete the setup, in Asterisk console run:
reload res_features.so
extensions reload
extensions reload
Once you hear the Call Waiting signal, just press *0 to switch to the other caller. You can press *0 as many times as you want to switch between the two parties.
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Comments
333Re: X100P + Call-Waiting how-to.
Also, putting DYNAMIC_FEATURES=>zapflash into the globals section of extensions.conf means you will not need to separately Set() it for any extra contexts you have.
extensions.conf
globals
DYNAMIC_FEATURES=>zapflash
features.conf
applicationmap
zapflash => *0,callee,flash,()
333Re: flash transfer problem in asterisk integration with old PBX
thantx
Carlos ventura
Carlos@gvr.com.do
333Re: Call waiting Flash Hook
thantx
Carlos ventura
Carlos@gvr.com.do
333Re: X100P + Call-Waiting how-to.
thantx
Carlos ventura
Carlos@gvr.com.do
333Re: flash transfer problem in asterisk integration with old PBX
I've set:
flash = 200 (the defualt was 750 ms)
in the extensions.conf the code is for example:
exten => 42,1,Flash()
exten => 42,2,SendDTMF(42,250)
exten => 42,3,Hangup()
now the transfer with flash works correctly
333flash transfer problem in asterisk integration with old PBX
I have a traditional PBX connected with a zap channel to Asterisk that acts like an IVR:
TELCO line --> traditional PBX (FXS) --> (FXO) Asterisk
From the TELCO line I can make a call to the traditional PBX and reach Asterisk, the IVR system on Asterisk answers the call and I can dial an extension (for example 42 that is on the traditional PBX). In the asterisk dialplan I've set to transfer the call using Flash() like in this example:
exten => 42,1,Flash()
exten => 42,2,Background(silence/1) wait 1 second for the traditional PBX
exten => 42,3,SendDTMF(42,250)
exten => 42,4,Background(silence/1) wait 1 second for the traditional PBX
exten => 42,5,Hangup()
When I dial the extension 42, the phone 42 on the traditional PBX rings but when I answer there isn't communication with the call from the TELCO line and after a few seconds the line hangup.
Here you can see what happen in asterisk CLI console:
Executing Answer("Zap/4-1", "") in new stack
— Executing BackGround("Zap/4-1", "a_suoni_plink/menu_esterno2") in new stack
— Playing 'a_suoni_plink/menu_esterno2' (language 'it')
== CDR updated on Zap/4-1
— Executing Flash("Zap/4-1", "") in new stack
— Flashed channel Zap/4-1
— Executing BackGround("Zap/4-1", "silence/1") in new stack
— Playing 'silence/1' (language 'it')
— Executing SendDTMF("Zap/4-1", "42") in new stack
— Executing BackGround("Zap/4-1", "silence/1") in new stack
— Playing 'silence/1' (language 'it')
— Executing Hangup("Zap/4-1", "") in new stack
== Spawn extension (incoming, 42, 5) exited non-zero on 'Zap/4-1'
— Hungup 'Zap/4-1'
I've tried the following changes to the dialplan in my example but transfer still doesn't work:
- I've tried to use wait(1) instead of Background(silence/1)
- I've tried without Background(silence/1) or wait(1):
exten => 42,1,Flash()
exten => 42,2,SendDTMF(42,250)
exten => 42,3,Hangup()
- I've tried without the Hangup() instructions at the end
Has anyone the same problem like me and any suggestions?
333
I have everythng working on my * all the features that I want exept one.
I have a SPA-1000 connected to my home phones and X100P for the POTS line. The SPA gives me call waiting indication(beep) but when I press flash I just get dial tone. is it SPA-1000 thats doing something wrong or * not flashing the card ? Please help me with this issue because with out call waiting I cant use my * at all. Thank you.
333Flash() on a SIP line?
333Flash timing
Can someone advice me on this?
333Re: X100P + Call-Waiting how-to.
extensions.conf
context
exten => s,n,Set(DYNAMIC_FEATURES=zapflash)
exten => s,n,Dial(SIP/xxxx,15,tw)
features.conf
applicationmap
zapflash => *3,caller,flash,() <<<<<<<<<< needs a comma between flash and ()