Transfer to an external number using a feature code

I am trying to set up a feature code for my users that will transfer the channel they are currently connected to, to a specific external number. The users should not be able to reach the external number by dialing it (or the shortcode) directly - it should only be accessible via transfer.

I currently have the following set up (using Custom Dynamic Feature Codes):

extensions_custom.conf:

[globals](+)
DYNAMIC_FEATURES = externaltransfer#apprecord

features_applicationmap_custom.conf:

externaltransfer => *300,peer,Dial(Local/<redacted>@from-internal)

When dialing *300 during an active call, the Dial executes (and I can hear ringing on the called side’s end), but thereafter the call disconnects and my original call is still active.

I have also tried the following:

features_applicationmap_custom.conf:

externaltransfer => *300,peer,Gosub(ext-transfer,1,1)

with this in extensions_custom.conf:

[ext-transfer]
exten => 1,1,Answer()
exten => 1,n,Dial(Local/<redacted>@from-internal)
exten => 1,n,Hangup()

This doesn’t work either.

Where am I going wrong?

You need to show an actual call and what happens when you are trying to use this feature.

asterisk -rvvvvvvvvv

Make the call, paste the results.

Why do you need to do any of this?

If the device(s) that would use this have a spare BLF key or softkey, just program that to transfer to the external number.

If not, set up a short code that rings the external number (virtual extension forwarded, misc application pointed to misc destination, outbound route with short prefix and external number as prepend, or speed dial). Then, press the Transfer button or softkey followed by the short code.

If neither of the above are suitable, please describe your constraints.

Thanks for this. I failed to mention another constraint: The users should not be able to reach the external number by dialing it (or the shortcode) directly - it should only be accessible via transfer. Will the second method you described work for this?

Hi,

Here is the output:

https://pastebin.com/cgYb6KxG

Is anyone able to assist me with this?

Hi,

I managed to find a solution with help from david551 on the Asterisk forums:

ChannelRedirect works perfectly.

For reference, this was the final setup I used:

extensions_custom.conf:

[globals](+)
DYNAMIC_FEATURES = externaltransfer#apprecord

[ext-transfer]
exten => 1,1,Answer()
exten => 1,n,Dial(Local/<redacted>@from-internal)
exten => 1,n,Hangup()

features_applicationmap_custom.conf:

externaltransfer => *300,peer,ChannelRedirect(${CHANNEL},ext-transfer,1,1)
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.