micolous.id.au

the result of a blogging accident

Sunday, June 11, 2006

SA Police Speed Camera Monitor for Asterisk

Filed under: Asterisk, Coding, VoIP — micolous @ 11:38

I’ve written a PHP-AGI script that uses Asterisk 1.2, PHP 4.3 and Festival to download and speak the locations of speed cameras published on the SA Police website. For high-traffic PBX systems, it may be desirable to cache the locations on the local machine to reduce PBX load.

Because the script generates wave files on demand, on some systems multiple threads running it may conflict with one another.

Included are extra prompts needed for the script. They are for demonstration purposes only – if you want to put it in your own system, you’ll need to rerecord the prompts.

Download v0.1 of the script.

UPDATE (2006-12-05): This script probably doesn’t work anymore, as SAPOL nicely screwed up their website. :(

Monday, May 1, 2006

conf.py v0.3

Filed under: Asterisk, Coding, VoIP — micolous @ 11:42

There’s a small update to conf.py. This version fixes some formatting bugs with the channel and flags fields that ment that they would occasionally overlap in varying directions, depending on the length of the channel name. This version fixes the bug by doing tests to actualy see where the channel name ends, and going by that. So you can now download v0.3 of the script.

Thursday, February 16, 2006

Asterisk Time System

Filed under: Asterisk, VoIP — micolous @ 22:17

This is a simple dialplan menu that allows the user to enter an Australian postal code and display the current time for the location. It supports the major time zones.

[custom-time-menu]
; nsw
exten => _2[0-5]XX,1,SayUnixTime(,Australia/NSW)
exten => _2[0-5]XX,2,Goto(custom-new-main-menu,s,1)
; act
exten => _2[6-9]XX,1,SayUnixTime(,Australia/ACT)
exten => _2[6-9]XX,2,Goto(custom-new-main-menu,s,1)
; vic
exten => _3XXX,1,SayUnixTime(,Australia/Victoria)
exten => _3XXX,2,Goto(custom-new-main-menu,s,1)
; qld
exten => _4XXX,1,SayUnixTime(,Australia/Queensland)
exten => _4XXX,2,Goto(custom-new-main-menu,s,1)
; sa
exten => _5XXX,1,SayUnixTime(,Australia/South)
exten => _5XXX,2,Goto(custom-new-main-menu,s,1)
; wa
exten => _6XXX,1,SayUnixTime(,Australia/West)
exten => _6XXX,2,Goto(custom-new-main-menu,s,1)
; tas
exten => _7XXX,1,SayUnixTime(,Australia/Tasmania)
exten => _7XXX,2,Goto(custom-new-main-menu,s,1)
; nt
exten => _08XX,1,SayUnixTime(,Australia/North)
exten => _08XX,2,Goto(custom-new-main-menu,s,1)
; exit
exten => 9,1,Goto(custom-new-main-menu,s,1)

exten => s,1,ResponseTimeout(5)
exten => s,2,DigitTimeout(7)
exten => s,3,Wait(2)
exten => s,4,Background(custom/postcode-prompt)

exten => i,1,Wait(1)
exten => i,2,Playback(custom/unknown-location)
exten => i,3,Goto(s,1)

exten => t,1,Goto(custom-new-main-menu,s,1)

Thursday, February 2, 2006

conf.py 0.2

Filed under: Asterisk, Coding, VoIP — micolous @ 20:38

I’ve now updated “conf.py” to version 0.2. This release fixes a bug where if you had multiple Asterisk conferences, and conference A had users and conference B did not, that B would errornously report as having 1 user in it. That’s now been fixed now that the script takes into account responses from the Asterisk server a bit better.

Tuesday, January 24, 2006

Happy 2006, conf.py v0.1, autodialler-au v0.1

Filed under: Asterisk, Coding, VoIP — micolous @ 06:48

Happy 2006! I’ve been slacking off with this whole blogging thing, and there’s a whole lot of changed things. This whole use of static content in the blog has ment that I’m posting less.

I’ve written a small python script that shows who is in an Asterisk MeetMe conference. You can download it from here, and there is a demo showing the users on a conference I host.

In other coding, I’ve also written an autodialler for Asterisk, which is based on NotTheory’s autodialer.pl. My version uses the ACMA allocated numbers list, and is written in Python. The effect is that it simplifies wardialling using Asterisk in Australia. It additionally generates a template file you can fill out to make notes, and records the phone calls made for future reference. You can download it here. You’ll need apsw installed for python sqlite3 support, and a copy of ACMA’s allocated number database to use the software (converted to SQLite3 format using the included script, which is the same is what is used in phonesearch).

Powered by WordPress