Dial a number on one extension, and transfer it to another immediately

The quick and dirty:
Is there a way something can be set up so if I dial a phone number on one extension (ideally with a code in front of it) it will hang up the current extension (or 3 way so I can hang up the current extension) ring another extension, and connect the dialed call to the other extension?

Additional information that may help provide a useful answer:
I have a Bluetooth headset connected to a cellular telephone that I use Zopier free edition. This cell phone is used for the sole purpose of Zoiper (Has no sim card) and remains plugged in to charge. Moving this phone is difficult. It is set up this way because I can use the button on the headset to answer the phone, as I can’t seem to get that to work under windows. This is extension 105.
I have a softphone (Zoiper free again) on a windows computer. This is extension 104. It is set up so I can make phone calls from my usual seat without needing to get up and walk over to the cell phone with extension 105, but has a wired headset.
Ideally I would like to be able to dial a telephone number on extension 104 (The windows computer) for an outside number, ideally with a prefix (perhaps *88555-555-1212) and extension 105 will ring, and when 105 is answered it will complete the call (Or if needed join the call already in progress)
Is there a way to make this happen? Or another way to accomplish the same thing?

Hi, I’m not a FreePBX or Asterisk expert, but I have used FreePBX for a situation similar to yours.

Put this code in extensions_custom.conf

[macro-dialout-trunk-predial-hook]
exten => s,1,Noop("Calling ${OUTNUM})
;Check if extension 104 is placing the call
exten => s,n,GotoIf($["${CALLERID(num)}" = "104"]?:skip)
exten => s,n,Answer()
exten => s,n,Set(COMMAND_BEGIN="asterisk -rx "channel originate PJSIP/105 extension ")
exten => s,n,Set(COMMAND_END="@outbound-allroutes"")
exten => s,n,System(${COMMAND_BEGIN}${OUTNUM}${COMMAND_END})
exten => s,n,Hangup()
exten => s,n(skip),Noop("After call-back routine")

When you place an external call from ext 104, it will immediately hang up and ring ext 105. When you pick up 105, it will ring the number you originally called.

You have to set the Outbound CID of extension 104 to “104” in FreePBX for this logic to work (In my case the extension CID is over-ridden in outbound route or trunk.) Perhaps there is a more elegant way to do this; I would be glad to know.

1 Like

There is a dialplan implementation of Originate