• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.31. GoToIfTime (dialplan application)

1. GoToIfTime - this application allows you to jump to another extension, context or priority if the current time matches the specified one.

NOTE: This application is valid for Asterisk version 1.0.9 and above.

 


Syntax:

GoToIfTime(<times>|<weekdays>|<mdays>|<months>?[[context|]extension|]priority) ; the conditions can be specified with "*"(for always) or with a period of time

 


Purpose and usage

With this application you can set a specific time when you want something to happen. For example during the mornings you can direct your calls to one operator or number and during the evenings to another one, or you can do this for specific days during the week.

You can branch off your calls even by months.

This application is very similar to the GoToIf application. When the specified time is matched by the current time then the call will be directed to a specific context or extension or priority.

The contexts and the extensions are optional settings. So you can omit one or both of them but you cannot omit the priority setting.

We will show you a simple example below.

 


Prerequisites

To use this application you need a working Asterisk PBX with registered users in iax.conf, sip.conf or mgcp.conf(It depends on which protocol you would like to use) and made extensions.

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.



On the picture above you can see our extensions.conf file.

First of all, be careful with the names of the weekdays and the months. You have to write them with their short names. For example: "September" have to be written "sep" or "Monday" - "mon", "Tuesday" - "tue" and etc.

Now when somebody dials 222, the call will be answered, thanks to the Answer application.

Then, the next extension will be executed. This is the extension with priority 2. It contains the GoToIfTime application. In our example we have set as argument in the brackets of the application the following: 11:00-14:00|thu|1|sep?test1|s,1.

This means that if the time is between 11:00 and 14:00 and the day is Thursday and the month day is 1 and the month is September, that the call will be redirected to the context [test1], extension s with priority 1.

Extension s is a special type, predefined extension. More information about it you can find in extensions.conf.

The caller will hear a welcome message and then if he/she press one the call will be connected to the user user1 through IAX2 channel.

But what will happen if the call is made through different time, day or month? The call won’t be directed to another context. In our case to [test1], but the execution will continue with the extension with priority n+1, where n is the number of the current extension. In our example the execution will continue with the extension with priority 3. The caller will hear a busy tone and then the line will be hung up. To learn more how to set a busy tone, please read our tutorial about the Busy application.

It is not necessary always to set all four parameters about the time, day of the week, day of the month and the month. You can omit one, two, three or even the all four parameters. When you skip a parameter the system will interpret it as "always" condition. For example if you skip the argument for time the system will execute the GoToIfTime application independently of what is the time of the day. Instead of a empty field for an argument you can put also the asterisk character "*". This character will be interpreted also as "always" condition.

There is something very important to do when you skip an argument. When you omit a parameter you just leave its space blank but the "|"character remains

Examples:

exten => 222,2,GoToIfTime(11:00-14:00||1|sep?test1|s,1) ; here the argument for week day is omit but the "|" character remains

222,2,GoToIfTime(|||?test1|s,1) ; here the all four arguments are omitted but the "|" characters remain.

222,2,GoToIfTime(*|*|*|*?test1|s,1) ; an example of the usage of the "*" character - the "|" characters remain.

222,2,GoToIfTime(*|thu|1|*?test1|s,1) ; another example of the usage of the "*" character - the "|" characters remain.


 


2. Screenshots of what you can see on the CLI of the Asterisk PBX

With true condition



With false condition



 


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

 

 
User Comments
Julienne (julienne_gould at rushpost dot com)
29 April 2022 02:07:52
&#3651;&#3609;&#3605;&#3629;&#3609;&#3609;&#3637;&#3657; &#3648;&#3594;&#3639;&#3656;&#3629;&#3623;&#3656;&#3634;&#3607;&#3640;&#3585;&#3588;&#3609;&#3609;&#3633;&#3657;&#3609;&#3592;&#3632;&#3605;&#3657;&#3629;&#3591;&#3648;&#3592;&#3629;&#3611;&#3633;&#3597;&#3627;&#3634;&#3623;&#3656;&#3634;&#3591;&#3591;&#3634;&#3609;&#3627;&#3619;&#3639;&#3629;&#3617;&#3637;&#3611;&#3633;&#3597;&#3627;&#3634;&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3648;&#3585;&#3637;&#3656;&#3618;&#3623;&#3585;&#3633;&#3610;&#3585;&#3634;&#3619;&#3648;&#3591;&#3636;&#3609;&#3629;&#3618;&#3656;&#3634;&#3591;&#3649;&#3609;&#3656;&#3649;&#3607;&#3657; &#3648;&#3614;&#3619;&#3634;&#3632;&#3648;&#3627;&#3605;&#3640;&#3623;&#3656;&#3634;&#3652;&#3617;&#3656;&#3623;&#3656;&#3634;&#3592;&#3632;&#3648;&#3611;&#3655;&#3609;&#3648;&#3624;&#3619;&#3625;&#3600;&#3585;&#3636;&#3592;&#3607;&#3637;&#3656;&#3621;&#3656;&#3617;&#3592;&#3617; &#3652;&#3617;&#3656;&#3629;&#3634;&#3592;&#3592;&#3632;&#3611;&#3599;&#3636;&#3610;&#3633;&#3605;&#3636;&#3591;&#3634;&#3609;&#3627;&#3634;&#3648;&#3591;&#3636;&#3609; &#3623;&#3633;&#3609;&#3609;&#3637;&#3657;&#3607;&#3634;&#3591;&#3626;&#3621;&#3655;&#3629;&#3605;&#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3617;&#3637;&#3623;&#3636;&#3608;&#3637;&#3585;&#3634;&#3619;&#3627;&#3634;&#3619;&#3634;&#3618;&#3652;&#3604;&#3657;&#3591;&#3656;&#3634;&#3618;&#3654;&#3585;&#3633;&#3610;&#3585;&#3634;&#3619;&#3648;&#3621;&#3656;&#3609;&#3626;&#3621;&#3655;&#3629;&#3605;&#3629;&#3629;&#3609;&#3652;&#3621;&#3609;&#3660;&#3607;&#3637;&#3656;&#3648;&#3611;&#3655;&#3609;&#3648;&#3585;&#3617;&#3629;&#3629;&#3609;&#3652;&#3621;&#3609;&#3660;&#3627;&#3634;&#3648;&#3591;&#3636;&#3609;&#3652;&#3604;&#3657;&#3592;&#3619;&#3636;&#3591; &#3626;&#3634;&#3617;&#3634;&#3619;&#3606;&#3627;&#3634;&#3619;&#3634;&#3618;&#3652;&#3604;&#3657;&#3629;&#3629;&#3609;&#3652;&#3621;&#3609;&#3660;&#3652;&#3604;&#3657;&#3607;&#3640;&#3585;&#3607;&#3637;&#3656;&#3605;&#3621;&#3629;&#3604;&#3607;&#3633;&#3657;&#3591;&#3623;&#3633;&#3609; 24 &#3594;&#3633;&#3656;&#3623;&#3650;&#3617;&#3591; &#3595;&#3638;&#3656;&#3591; g2gbk8 &#3648;&#3611;&#3655;&#3609;&#3626;&#3621;&#3655;&#3629;&#3605;&#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660;&#3617;&#3637;&#3617;&#3633;&#3656;&#3609;&#3588;&#3591;&#3606;&#3641;&#3585;&#3605;&#3634;&#3617;&#3585;&#3598;&#3627;&#3617;&#3634;&#3618;&#3588;&#3634;&#3626;&#3636;&#3650;&#3609;&#3626;&#3634;&#3585;&#3621; &#3618;&#3639;&#3609;&#3618;&#3633;&#3609;&#3592;&#3634;&#3585;&#3612;&#3641;&#3657;&#3648;&#3621;&#3656;&#3609;&#3592;&#3619;&#3636;&#3591;&#3607;&#3633;&#3656;&#3623;&#3611;&#3619;&#3632;&#3648;&#3607;&#3624; &#3607;&#3640;&#3585;&#3607;&#3656;&#3634;&#3609;&#3626;&#3634;&#3617;&#3634;&#3619;&#3606;&#3627;&#3634;&#3619;&#3634;&#3618;&#3652;&#3604;&#3657;&#3585;&#3621;&#3657;&#3623;&#3618;&#3654; &#3650;&#3604;&#3618;&#3607;&#3634;&#3591; g2gbk8 &#3609;&#3633;&#3657;&#3609;&#3617;&#3637;&#3588;&#3656;&#3634;&#3618;&#3648;&#3585;&#3617;&#3626;&#3621;&#3655;&#3629;&#3605;&#3650;&#3592;&#3658;&#3585;&#3648;&#3585;&#3629;&#3619;&#3660;&#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660;,pg slot &#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660;,slotxo &#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660; 2022,&#3595;&#3640;&#3611;&#3648;&#3611;&#3629;&#3619;&#3660;&#3626;&#3621;&#3655;&#3629;&#3605; &#3648;&#3614;&#3637;&#3618;&#3591;&#3649;&#3588;&#3656;&#3626;&#3617;&#3633;&#3588;&#3619;&#3626;&#3617;&#3634;&#3594;&#3636;&#3585;&#3626;&#3621;&#3655;&#3629;&#3605;&#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3585;&#3633;&#3610;&#3607;&#3634;&#3591; g2gbk8 &#3607;&#3637;&#3656;&#3648;&#3611;&#3655;&#3609;&#3648;&#3623;&#3655;&#3610;&#3626;&#3621;&#3655;&#3629;&#3605;&#3652;&#3617;&#3656;&#3612;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660; &#3595;&#3638;&#3656;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3612;&#3641;&#3657;&#3649;&#3607;&#3609;&#3627;&#3619;&#3639;&#3629;&#3605;&#3633;&#3623;&#3585;&#3621;&#3634;&#3591;&#3651;&#3604;&#3654;&#3585;&#3655;&#3605;&#3634;&#3617;&#3648;&#3621;&#3656;&#3609;slotonline&#3652;&#3604;&#3657;&#3650;&#3604;&#3618;&#3605;&#3619;&#3591;&#3585;&#3633;&#3610;&#3588;&#3656;&#3634;&#3618;&#3648;&#3585;&#3617; &#3617;&#3637;&#3648;&#3585;&#3617;&#3648;&#3585;&#3617;&#3626;&#3621;&#3655;&#3629;&#3605;&#3651;&#3627;&#3657;&#3648;&#3621;&#3639;&#3629;&#3585;&#3648;&#3621;&#3656;&#3609;&#3617;&#3634;&#3585;&#3618;&#3636;&#3656;&#3591;&#3585;&#3623;&#3656;&#3634; 100 &#3648;&#3585;&#3617;&#3626;&#3660; &#3619;&#3623;&#3617;&#3607;&#3633;&#3657;&#3591;&#3618;&#3633;&#3591;&#3617;&#3637;&#3610;&#3619;&#3636;&#3585;&#3634;&#3619;&#3605;&#3656;&#3634;&#3591;&#3654;&#3592;&#3635;&#3609;&#3623;&#3609;&#3617;&#3634;&#3585;&#3607;&#3637;&#3656;&#3592;&#3632;&#3648;&#3614;&#3636;&#3656;&#3617;&#3588;&#3623;&#3634;&#3617;&#3626;&#3610;&#3634;&#3618;&#3626;&#3610;&#3634;&#3618;&#3651;&#3627;&#3657;&#3585;&#3633;&#3610;&#3626;&#3617;&#3634;&#3594;&#3636;&#3585;&#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660; &#3652;&#3617;&#3656;&#3623;&#3656;&#3634;&#3592;&#3632;&#3648;&#3611;&#3655;&#3609;&#3585;&#3634;&#3619;&#3648;&#3605;&#3636;&#3617;-&#3606;&#3629;&#3609; &#3652;&#3617;&#3656;&#3617;&#3637;&#3586;&#3633;&#3657;&#3609;&#3605;&#3656;&#3635;&#3649;&#3621;&#3657;&#3623;&#3585;&#3655;&#3617;&#3637;&#3588;&#3623;&#3634;&#3617;&#3619;&#3623;&#3604;&#3648;&#3619;&#3655;&#3623;&#3611;&#3619;&#3632;&#3648;&#3617;&#3636;&#3609;&#3612;&#3621;&#3604;&#3657;&#3623;&#3618;&#3619;&#3632;&#3610;&#3610;ai &#3617;&#3637;&#3588;&#3623;&#3634;&#3617;&#3649;&#3617;&#3656;&#3609;&#3618;&#3635;&#3626;&#3641;&#3591; &#3652;&#3617;&#3656;&#3592;&#3635;&#3648;&#3611;&#3655;&#3609;&#3605;&#3657;&#3629;&#3591;&#3626;&#3656;&#3591;&#3626;&#3621;&#3636;&#3611;&#3585;&#3634;&#3619;&#3650;&#3629;&#3609;&#3651;&#3627;&#3657;&#3585;&#3633;&#3610;&#3607;&#3634;&#3591;&#3648;&#3592;&#3657;&#3634;&#3627;&#3609;&#3657;&#3634;&#3607;&#3637;&#3656;&#3651;&#3627;&#3657;&#3648;&#3626;&#3637;&#3618;&#3648;&#3623;&#3621;&#3656;&#3635;&#3648;&#3623;&#3621;&#3634; &#3627;&#3619;&#3639;&#3629;&#3592;&#3632;&#3648;&#3611;&#3655;&#3609;&#3650;&#3611;&#3619;&#3650;&#3617;&#3594;&#3633;&#3656;&#3609;&#3649;&#3592;&#3585;&#3648;&#3588;&#3619;&#3604;&#3636;&#3605;&#3615;&#3619;&#3637;100% &#3627;&#3619;&#3639;&#3629;&#3592;&#3632;&#3648;&#3611;&#3655;&#3609;&#3650;&#3611;&#3619;&#3613;&#3634;&#3585; 50 &#3619;&#3633;&#3610; 200 &#3607;&#3640;&#3585;&#3588;&#3609;&#3626;&#3634;&#3617;&#3634;&#3619;&#3606;&#3627;&#3634;&#3648;&#3591;&#3636;&#3609;&#3629;&#3629;&#3609;&#3652;&#3621;&#3609;&#3660;&#3652;&#3604;&#3657;&#3649;&#3621;&#3657;&#3623;&#3607;&#3637;&#3656;slot &#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591; slotxo &#3648;&#3623;&#3655;&#3610;&#3605;&#3619;&#3591;&#3652;&#3617;&#3656;&#3612;&#3656;&#3634;&#3609;&#3648;&#3629;&#3648;&#3618;&#3656;&#3609;&#3605;&#3660; 2022
Manoj Kumar (mukkamalamanoj at gmail dot com)
04 January 2006 07:57:14
your's asterisk tutorial is simply super thanks for providing this valuable information on asterisk
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://donde-ver-ant-man-y-la-avispa-qu...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-scream-6-tyt.statuspag...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-guardianes-de-la-noche...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://donde-ver-demon-slayer-villa-de-...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
  • https://www.reddit.com/r/BenavidezvPlant...
    tutorial: Digium Wildcard TE405 / Wildcard TE410P
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™