[asterisk-users] entering a password to have access to a sip account?!

Grygoriy Dobrovolskyy megahohol at gmail.com
Sun Aug 24 17:30:23 CDT 2008


I have one solution in mind, maybe it is an overkill but:

You can create a db entry for each sip account, DB(family/key) lets name
family=destination sip number and key=${Callerid(num)} and assing a value 0
or 1, so string will be like this DB(301/300)=1 fot that 300 sip account,
and for all other sip accounts DB(300/NNN)=0 where NNN are all others sip
accounts numbers. You can use set for this, example

exten => 75,1,Set(DB(300/301)=1)
or
exten => 75,1,Set(DB(300/${Callerid(num)}=1)
exten => 76,1,Set(DB(300/${Callerid(num)}=0)
And just go and call from each phone 75 or 76 , i assume that you callerid
is the same as callerid(num) var. The methos is somehow primitive and will
not work if you have 500 extensions, but for 5 sip accounts  is a way to go.

Or create external bash script to speed up.

After this you will have as much db entryes as sip accounts in you astdb,
all we need to is is to verify the value before call

exten => 300,1,GotoIf($[${DB(300/${Callerid(num)})}=1]?2:3)
exten => 300,2,Playback(stop_calling_me)
exten => 300,3,Dial(Sip/300)

And again i assume that your sip peers have the same
Callerid(num)=extensions

Maybe i got some syntax errors, but you get the idea.

Have fun

previous message have failed for some reasons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080825/ba3bcb87/attachment.htm 


More information about the asterisk-users mailing list