1. Transfer - this application allows you to transfer calls.
NOTE: This application is valid for Asterisk version 1.0.9 and above.
Syntax:
Transfer([TECH/]destination)
List of the possible options
TECH - This is an optional argument. It could be SIP, IAX2, LOCAL and etc. If it is used, only incoming calls with the same channel technology(SIP, IAX2, LOCAL and etc), could be transferred. destination - this is the extension to which you would like to transfer the call.
Purpose and usage
The purpose and the usage of this application is to transfer calls.
There is a special channel variable, called TRANSFERSTATUS, in which the result of the application will be stored.
There are three possible variants:
SUCCESS - this will be returned if the transfer is successful. FAILURE - this will be returned if the transfer is not successful. UNSUPPORTED - this will be returned if the transfer is not supported by channel driver.
To see how the application works, we recommend you to use our IAX softphone Idefisk. You can download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.
Asterisk PBX configurations
NOTE: This is only an example of one of the uses of this application. Of course you can use it and for other things.
iax.conf and sip.conf Configurations
We need one registered user in the iax.conf file and also another one in the sip.conf file. This is because we are going to use the IAX2 and the SIP channels. If you want to use other protocol such as MGCP, you have to do the configurations below respectively in mgcp.conf.
1) iax.conf
2)sip.conf
So, we have registered the user user1 in the iax.conf file and the user operator in the sip.conf file.
Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.
In the sip.conf file you can see the following option: disallow=all. This means that the line will not support any codecs. However, below this option we have allow=ulaw, allow=alaw and allow=gsm. This means that the line will support these three codecs - ulaw, alaw and gsm. It is important to write the options exactly in this order. First you write the disallow=all option and then the allow options. Otherwise, if you write the disallow option after the allow options, no codecs will be supported by the line.
We have one extension with the number 113. It contains the Dial application. Due to it, you can call to the user user1 through the IAX2 channel. As arguments, in the brackets of the application, we have set also the letters t and T. They will allow the caller and the called party to transfer calls.
Then we have the extension with the Transfer application. the number of this extension is 114. The first argument which we have set is SIP. This means that only the incoming calls from a SIP channel, would be allowed to be transferred. The incoming calls from other channels would not be transferred. The second argument is the destination. In our case this is the number 115. 115 is the number of the extension which contains the Dial application, responsible for the connection to the user sip_user through the SIP channel.
So, when during a call somebody press the transfer button and enter the number 114, the transfer application will be executed and the call will be transfer to the number 115. This will cause the ringing of the phone of the user sip_user. When this user answers the call, at the other side will be the user which is transferred.
NOTE:The above is valid for the IAX2 channel. With the SIP channel is not necessary to use the transfer button. You can directly dial the number 114 and the Transfer application will be executed.
Finally, in order to be sure that the Asterisk PBX will hang up the line, after the conversation is over, it is a good idea to make an extension for hanging up the line.
2. Screenshots of what you can see on the CLI of the Asterisk PBX
1) Using the IAX2 channel
2) Using the SIP channel
3. Additional information
For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.
This application is tested with our IAX softphone Idefisk. You can download it from here. For more information about this softphone please read our tutorial.
If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX
AAssusHATKaws (serbFerswrendy at clifors dot xyz) 18 June 2020 21:53:53 <a href="https://cialisle.com/">cialis no prescription</a>
Arvind (arvindsandilya24 at gmail dot com) 03 January 2009 07:01:20 It will recognize DTMF.
fab (fabiano at erretre dot com) 11 April 2007 09:27:10 The Transfer app doesn't work for me. As I understand during a call Asterisk should recognize DTMF tones (114 in the example above) and jump to the extension but it does nothing. On the other hand if I press the Dial button after the 114 Asterisk will transfer me (that is the called) to the new destination instead of the caller. Can someone help me?
P.S.: the uploaded files in this tutorial are related to call parking, not to call transfer.