if a phone number starts with one of 50+ prefixes, i want to send the sip call to gateway X. if it is in any other prefix, i want to send it to gate Y. i am not excited about a looooong list of extens, but will do it if i have to. i suspect there is a database hack, but i lose all database contents if i reinstall the port (this may be a feature of the freebsd port), and i have not figured out a script that will let me load it. surely there is a well-known and reasonable way out of this corner. but i can not seem to find the right wiki incantation. thanks for clue. randy
Randy Bush wrote:> if a phone number starts with one of 50+ prefixes, > i want to send the sip call to gateway X. if it > is in any other prefix, i want to send it to gate > Y. >Take a look at http://www.voip-info.org/wiki-Asterisk+app_dbodbc I run a home server so I have never had the need to do stuff like that but it looks like the thing you want. I'm sure there are other alternatives "out there" that will do the same only differently... /Soren
>> if a phone number starts with one of 50+ prefixes, >> i want to send the sip call to gateway X. if it >> is in any other prefix, i want to send it to gate >> Y. > Take a look at http://www.voip-info.org/wiki-Asterisk+app_dbodbctoo big a hammer. i finally did the agi hack. for the archive [dial-hawi] exten => s,1,NoOp("dial-hawi") exten => _.,1,SetVar(PREFIX="") exten => _.,2,AGI(agi-prefix|${EXTEN:4:3}) exten => _.,3,NoOp("agi-prefix returns ${PREFIX}") exten => _.,4,Dial(SIP/${PREFIX}${EXTEN:4}@spa3k2-out,60,Ttr) exten => h,1,Hangup() exten => i,1,GoTo(s,1) exten => t,1,GoTo(s,1) with the script being a brutal #!/usr/local/bin/bash if ! grep $1 /usr/local/etc/hawi-prefixes > /dev/null; then echo SET VARIABLE PREFIX "1808" fi randy