1. GoTo - this application allows you to jump to another extension, another context or another priority.
NOTE: This application is valid for Asterisk version 1.0.9 and above.
GoTo([[context|]extension|]priority) ; the context and extension are optional settings.
Purpose and usage
With this application you can go to a different priority in the current context. You can go to a different extension and a different priority in the current context and you can go to a completely different context, extension and priority. These are the three possible variations.
GoTo(5) ; example for priority
GoTo(112,5) ; example for extension and priority
GoTo(test1,112,5) ; example for context extension and priority
To see how the application works we recommend 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 what for you can use this application. Of course you can use it and for other things.
We need two registered users in iax.conf file. This is because we are going to use the IAX2 protocol. If you want to use other protocol such as SIP or MGCP, you have to do the configurations below respectively in sip.conf or mgcp.conf.
So, we have registered the users anatoliy and user1
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.
We have tried to show you all three variations of this application in one single example.
Firstly we have two extensions for the number 110 in the [test] context. It is important our first context to be [test] because our users will work only with this one. We set this when we have registered the users in iax.conf.
The first extension in the context is using the Authenticate application. If you enter the password(the agrument in the brackets. In our case 1111) correct then the next extension will execute the GoTo application. It will send you to another context(in our example [test1]), to extension s with priority 1.
Now we are in the [test1] context, extension s, priority 1. This extension contains the Answer application which will make the Asterisk PBX to answer the call. Then you will hear a welcome message. The message may be something like this: Thank you for using our services. Please press one for connecting operator..... press # to hear this message again.
Letís say that the caller wants to connect to the operator, but there is a problem with this service at the moment. So we set a GoTo application which will jump immediately to the extension with priority 4. This extension will use the SendText application to send a message to the user that this service is not available at the moment.
Here we have used the second variation of the GoTo application. We have set as argument the desired priority. You can see on the picture of the CLI below that the extensions with priority 2 and 3 are not executed.
Finally, when the user presses the pound key "#" he/she will hear the initial message again. We can achieve this with another variation of the GoTo application. We have made an extension with this application which will has for argument the extension s and the priority 1. So when somebody press "#" the call will be directed to the beginning of the menu and he/she will hear the message again.
2. Screenshots of what you can see on your Idefisk and on the CLI of the Asterisk PBX
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