ruby-agi 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2006-02-08
2
+ -- method AsteriskVariable#init_caller_variable updated to have correct callerid
3
+ -- method ReturnStatus#timeout? updated
4
+
1
5
  2006-01-16 (revision 23)
2
6
  -- ruby-agi-1.1.0 released
3
7
  -- method calleridnumber added and is generated from callerid
data/DOWNLOAD CHANGED
@@ -1,3 +1,3 @@
1
1
  To download ruby-agi or ruby-agi dependent application, please visit
2
- http://www.ruby-agi.org
2
+ http://ruby-agi.rubyforge.org
3
3
 
data/INSTALL CHANGED
@@ -1,5 +1,10 @@
1
1
  I strongly suggest to install ruby-agi using gem,
2
- gem install ruby-agi
2
+ % gem install ruby-agi
3
+ To update your existing ruby-agi using gem, try
4
+ % gem update ruby-agi
5
+
6
+ If you don't have gem intalled on your computer, download it from here
7
+ http://www.rubygems.org
3
8
 
4
9
  Alternatively, do
5
10
  1. ruby extconf.rb
data/README CHANGED
@@ -1,17 +1,14 @@
1
1
  This library comes with absolutely no warranty.
2
2
 
3
- I wanted to write couple of AGI scripts in ruby for myself.
4
- But I didn't see any AGI library written in ruby available.
5
- So, I decided to develop one and share with everybody.
3
+ ruby-agi is a library to write AGI scripts in ruby language for Asterisk. ruby-agi does not depend of Asterisk Manager.
4
+ There have a very simple AGI script in example/call_log.rb
5
+ I couldn't write any tutorial for ruby-agi and I am not good at it, if anybody want to give me a hand on writing documentation and tutorial, would be greatly appreciated.
6
6
 
7
- Hopefully, you already understood I am not good at documentation.
8
- I truely appolize for that.
9
- If anybody want to give a hand to write documentation for this project would be greatly appreciated.
7
+ Here are a sites that may help to know more about ruby-agi
8
+ http://ruby-agi.rubyforge.org (ruby-agi homepage)
10
9
 
11
- Project homepage: http://www.ruby-agi.org
12
-
13
- Please feel free to email me with your feature request, bug report or any suggession.
10
+ Feel free to send me email, if you don't find any answer related to ruby-agi.
14
11
 
15
12
  Thank you,
16
13
  Mohammad Khan,
17
- email: info at beeplove dot com
14
+ email: info <AT> beeplove <DOT> com
data/Release-Notes CHANGED
@@ -1,20 +1,15 @@
1
- 1.1.0 (2006-01-17)
2
- addition of method 'jump_to'
3
- jump_to would take three arguments ex. jump_to(context, extension, priority)
4
- enhanced callerid, calleridname and calleridnumber. calleridnumber is an addtional method to this release.
5
- Regardless of Asterisk version above three caller variables would return uniform value.
6
- Such as, callerid would return "John Smith" <1234567890> or empty string, if unidentified
7
- calleridnumber would return number part of callerid (as string) ex. 1234567890 or empty string, if unidentified
8
- calleridname would return name part of callerid ex. John Smith or emtpy string, if unidentified
9
-
10
- 1.0.2 (2006-01-09)
11
- Because of a yaml bug in ruby-1.8.3, rubyforge server doesn't support any package that were built on ruby-1.8.3
12
- This version is basically re-build of version 1.0.1 on ruby-1.8.4 instead of ruby-1.8.3
1
+ Release notes of ruby-agi-1.1.1
2
+ February 09, 2006
13
3
 
14
- 1.0.1 (2006-01-08)
15
- This release have minor a minor change.
16
- There have an example file in examples/call_log.rb
17
- You can use call_log.rb to keep your incoming call history in syslog.
4
+ This is a bug fix release of ruby-agi. Below two bugs have fixed in this release.
5
+ -- ReturnStatus#timeout? was not functional, which has fixed.
6
+ -- AsteriskVariable#init_caller_variable updated to fix callerid bug which was returning 'nil' for number only callerid. method init_caller_variable is a private method that manage callerid, calleridname and calleridnumber
18
7
 
19
- 1.0.0 (2006-01-08)
20
- This is the first stable version of ruby-agi
8
+
9
+ Feedback, suggestion, feature request, bug report is always appreciated.
10
+
11
+
12
+ Thanks,
13
+ Mohammad Khan
14
+ info <AT> beeplove <DOT> com
15
+ February 09, 2006
@@ -194,15 +194,22 @@ class AsteriskVariable < AGI
194
194
  return read_env('agi_callingtns')
195
195
  end
196
196
 
197
+ # asterisk-1.0.9 : agi_callerid (default value is 'unknown')
198
+ # asterisk-1.0.10 : agi_callerid (default value is 'unknown')
199
+ # asterisk-1.0.10 : agi_callerid, agi_calleridname (default value for both is 'unknown')
197
200
  protected
198
201
  def init_caller_variable
199
- if read_env('callerid') == "unknown"
202
+ @callerid = read_env('agi_callerid').to_s.strip
203
+ if @callerid == "unknown"
200
204
  @callerid = ""
201
205
  @calleridname = ""
202
206
  @calleridnumber = ""
207
+ elsif Regexp.new(/^\d+\d$/).match(@callerid)
208
+ @calleridname = ""
209
+ @calleridnumber = @callerid
203
210
  else
204
- if read_env('calleridname').nil? # for asterisk that don't have agi variable 'agi_calleridname'
205
- @callerid = read_env('callerid')
211
+ @calleridname = read_env('agi_calleridname')
212
+ if @calleridname.nil? # for asterisk that don't have agi variable 'agi_calleridname'
206
213
  name = Regexp.new(/\".+\"/).match(@callerid)
207
214
  number = Regexp.new(/\<\d+\>/).match(@callerid)
208
215
 
@@ -211,7 +218,7 @@ class AsteriskVariable < AGI
211
218
  else
212
219
  name = name.to_s
213
220
  name.gsub!(/\"/, '')
214
- @calleridname = name.strip
221
+ @calleridname = name.to_s.strip
215
222
  end
216
223
 
217
224
  if number.nil?
@@ -220,14 +227,12 @@ class AsteriskVariable < AGI
220
227
  number = number.to_s
221
228
  number.sub!(/\</, '')
222
229
  number.sub!(/\>/, '')
223
- @calleridnumber = number
230
+ @calleridnumber = number.to_s.strip
224
231
  end
225
232
  else # for asterisk that have agi variable 'agi_calleridname'
226
- @calleridnumber = read_env('callerid')
227
- @calleridname = read_env('calleridname')
233
+ @calleridnumber = @callerid
228
234
  @callerid = "\"#{@calleridname}\" <#{@calleridnumber}>"
229
235
  end
230
236
  end
231
237
  end
232
-
233
238
  end
@@ -651,7 +651,7 @@ class Command < AGI
651
651
 
652
652
 
653
653
  #
654
- # stream file: Sends audio file on channel
654
+ # stream file: Sends audio file on channel
655
655
  # Send the given file, allowing playback to be interrupted by the given digits, if any.
656
656
  # Use double quotes for the digits if you wish none to be permitted.
657
657
  # If sample offset is provided then the audio will seek to sample offset before play starts.
@@ -82,5 +82,11 @@ class ReturnStatus
82
82
 
83
83
  public
84
84
  def timeout?
85
+ rgx = Regexp.new(/\(timeout\)/)
86
+ if rgx.match(@message)
87
+ return true
88
+ else
89
+ return false
90
+ end
85
91
  end
86
92
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ruby-agi
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.0
7
- date: 2006-01-17 00:00:00 -05:00
6
+ version: 1.1.1
7
+ date: 2006-02-09 00:00:00 -05:00
8
8
  summary: Ruby Language API for Asterisk
9
9
  require_paths:
10
10
  - lib