1.1 --- a/asterisk/wakeup.agi Thu Mar 24 14:54:25 2011 +0100 1.2 +++ b/asterisk/wakeup.agi Thu Mar 24 17:26:38 2011 +0100 1.3 @@ -63,12 +63,10 @@ 1.4 } 1.5 } 1.6 1.7 - 1.8 -############ send_file ############# 1.9 -# Use this to send a wave file on # 1.10 -# the channel # 1.11 -# # 1.12 -#################################### 1.13 +############ send_file #### 1.14 +# Use this to send a wave # 1.15 +# file on the channel # 1.16 +########################### 1.17 sub send_file { 1.18 my ($myfile) = @_; 1.19 chomp($myfile); 1.20 @@ -83,9 +81,7 @@ 1.21 } 1.22 1.23 ############ hangup ############### 1.24 -# Use this to hand up a channel # 1.25 -# the channel # 1.26 -# # 1.27 +# Use this to hang up a channel # 1.28 #################################### 1.29 sub hangup { 1.30 if ($DEBUG == 1 ) { 1.31 @@ -114,11 +110,9 @@ 1.32 return $1; 1.33 } 1.34 1.35 -############ say_digits ############ 1.36 -# Use this to say a digits # 1.37 -# over the channel # 1.38 -# # 1.39 -#################################### 1.40 +############ say_digits ################### 1.41 +# Use this to say digits over the channel # 1.42 +########################################### 1.43 sub say_digits { 1.44 my ($mynumber) = @_; 1.45 chomp($mynumber); 1.46 @@ -130,11 +124,10 @@ 1.47 &checkresult($result); 1.48 } 1.49 1.50 -############ get_choice ############ 1.51 -# Use this to receive a DTMF # 1.52 -# choice from the channel # 1.53 -# # 1.54 -#################################### 1.55 +######## get_choice ############ 1.56 +# Use this to receive a DTMF # 1.57 +# choice from the channel # 1.58 +################################ 1.59 sub get_choice { 1.60 if ($DEBUG == 1 ) { 1.61 print DEBUGOUT "Getting choice \n"; 1.62 @@ -146,10 +139,9 @@ 1.63 return $1; 1.64 } 1.65 1.66 -############ answer ############### 1.67 -# Anser the channel # 1.68 -# # 1.69 -#################################### 1.70 +###### answer ###### 1.71 +# Anser the channel # 1.72 +##################### 1.73 sub answer { 1.74 if ($DEBUG == 1 ) { 1.75 print DEBUGOUT "Answering the channel \n"; 1.76 @@ -239,11 +231,10 @@ 1.77 my $myext = $aig[1]; 1.78 return $myext; 1.79 } 1.80 -########### init_agi ############### 1.81 -# Use this to initialize the AGI # 1.82 -# variable # 1.83 -# # 1.84 -#################################### 1.85 + 1.86 +############### init_agi ################## 1.87 +# Use this to initialize the AGI variable # 1.88 +########################################### 1.89 sub init_agi { 1.90 while(<STDIN>) { 1.91 chomp; 1.92 @@ -254,10 +245,10 @@ 1.93 } 1.94 } 1.95 1.96 -############ ascii2num ############# 1.97 -# Removes 48 to get a number out # 1.98 -# of the asciss return # 1.99 -#################################### 1.100 +######### ascii2num ########## 1.101 +# Removes 48 to get a number # 1.102 +# out of the asciss return # 1.103 +############################## 1.104 sub ascii2num { 1.105 my ($asc) = @_; 1.106 my $ret; 1.107 @@ -265,10 +256,8 @@ 1.108 return $ret; 1.109 } 1.110 1.111 - 1.112 -########### Welcome ############### 1.113 +############# Welcome ############## 1.114 # This is the welcome menu # 1.115 -# # 1.116 #################################### 1.117 sub welcome { 1.118 my $ret = 0; 1.119 @@ -308,7 +297,6 @@ 1.120 # want to manage already scheduled # 1.121 # wakeup calls # 1.122 #################################### 1.123 - 1.124 sub manage_calls { 1.125 my $checker = "false"; 1.126 my @calls; 1.127 @@ -371,13 +359,12 @@ 1.128 } 1.129 $del = &send_file("goodbye"); 1.130 } 1.131 - 1.132 } 1.133 1.134 -######## schedule_new ############## 1.135 -# This is the menu to schedule a # 1.136 -# a new wakeup call # 1.137 -#################################### 1.138 +######## schedule_new ########## 1.139 +# This is the menu to schedule # 1.140 +# a new wakeup call # 1.141 +################################ 1.142 sub schedule_new { 1.143 my $checker = "false"; 1.144 my $ret_var; 1.145 @@ -493,8 +480,7 @@ 1.146 1.147 ######## get_time_string ########### 1.148 # This will return the time string # 1.149 -# when inputing a string like # 1.150 -# hhmi # 1.151 +# when inputing a string like hhmi # 1.152 #################################### 1.153 sub get_time_string { 1.154 my ($intime) = @_; 1.155 @@ -538,13 +524,11 @@ 1.156 return $ret_val; 1.157 } 1.158 1.159 -############ new_time ############## 1.160 -# This will return the time string # 1.161 -# with a time set 10 minute into # 1.162 -# the future # 1.163 -# The string is # 1.164 -# MMDDhhmi # 1.165 -#################################### 1.166 +############ new_time ################ 1.167 +# This will return the time string # 1.168 +# with a time set 10 minute into # 1.169 +# the future. The string is MMDDhhmi # 1.170 +###################################### 1.171 sub new_time { 1.172 my ($input) = @_; 1.173 my @timedata; 1.174 @@ -584,10 +568,10 @@ 1.175 return $ret_val; 1.176 } 1.177 1.178 -########### snooze ################ 1.179 -# This is the menu to snooze the # 1.180 -# wakeup call # 1.181 -#################################### 1.182 +########### snooze ########## 1.183 +# This is the menu to snooze # 1.184 +# the wakeup call # 1.185 +############################## 1.186 sub snooze { 1.187 my ($oldfile) = @_; 1.188 my $newfile; 1.189 @@ -694,11 +678,9 @@ 1.190 return 0; 1.191 } 1.192 1.193 -########### main program ########### 1.194 -# Here goes the main program # 1.195 -# # 1.196 -#################################### 1.197 - 1.198 +######## main program ######## 1.199 +# Here goes the main program # 1.200 +############################## 1.201 my $numargs = $#ARGV + 1; 1.202 if ($DEBUG == 1) { 1.203 open (DEBUGOUT, '>', $debugfile) or die "Cannot open $debugfile for write :$!";