RoLaNd RoLaNd
2008-Aug-24 15:26 UTC
[asterisk-users] entering a password to have access to a sip account?!
Hi all, i;m obviously a newbie, its been 2 days that im trying to figure out a way to deny a specific extension (300) from calling another specific extensions (03) except if the caller punch a specified password.. sorry if im not explaining myself well.. heres an example: i called my pstn line(with 300 as its sip account), an attendant answers and asks me to punch in an extension number right now if i dial "03" it rings at the other end! though i dont want that to happen! i want to set asterisk up in a way tht if i dial "03" from "300" to ask me for a password... or it wont let the line go through! can anyone guide me through this issue! im really going crazy to get this done! any help would truly and utterly be appreciated:) ps: find below my extensions.conf [sipura-line] exten => 301,1,Answer() ; Answer inbound calls exten => 301,2,Playback(silence/1) exten => 301,3,Background(simzy1) ; input an extension exten => 301,4,WaitExten(8) exten => 301,5,Dial(SIP/100,15) ; goes to operator exten => 301,4,Wait(8) include => spa exten => _XXX,6,VoiceMail(100 at default) exten => 301,n,Hangup() [spa] exten =>_301,1,GoTo(sipura-line,${EXTEN},1) exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it will ring 3 times exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if line is busy or unavailable exten => _1XX,3,HangUp() exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it will ring 3 times exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if line is busy or unavailable exten => _2XX,3,HangUp() exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it will ring 3 times exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if line is busy or unavailable exten => _3XX,3,HangUp() exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line ;exten =>_01,2,Set(TIMEOUT(absolute)=5) exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 exten => 303,1,VoicemailMain ; voicemail box to be redirected to _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080824/c28f0a7a/attachment.htm
Steve Totaro
2008-Aug-24 16:05 UTC
[asterisk-users] entering a password to have access to a sip account?!
You want to use Authenticate() between answer and dial. http://www.google.com/search?q=asterisk+authenticate&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a Thanks, Steve Totaro On Sun, Aug 24, 2008 at 11:26 AM, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> wrote:> > > Hi all, > > i;m obviously a newbie, its been 2 days that im trying to figure out a way > to deny a specific extension (300) from calling another specific extensions > (03) except if the caller punch a specified password.. sorry if im not > explaining myself well.. heres an example: > > i called my pstn line(with 300 as its sip account), an attendant answers and > asks me to punch in an extension number right now if i dial "03" it rings at > the other end! though i dont want that to happen! i want to set asterisk up > in a way tht if i dial "03" from "300" to ask me for a password... or it > wont let the line go through! > > > can anyone guide me through this issue! im really going crazy to get this > done! any help would truly and utterly be appreciated:) > > > > ps: find below my extensions.conf > > > [sipura-line] > exten => 301,1,Answer() ; Answer inbound calls > exten => 301,2,Playback(silence/1) > exten => 301,3,Background(simzy1) ; input an extension > exten => 301,4,WaitExten(8) > exten => 301,5,Dial(SIP/100,15) ; goes to operator > exten => 301,4,Wait(8) > include => spa > exten => _XXX,6,VoiceMail(100 at default) > exten => 301,n,Hangup() > > > > > [spa] > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if line > is busy or unavailable > exten => _1XX,3,HangUp() > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if > line is busy or unavailable > exten => _2XX,3,HangUp() > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it > will ring 3 times > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if > line is busy or unavailable > exten => _3XX,3,HangUp() > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte > exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference > exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 > exten => 303,1,VoicemailMain ; voicemail box to be redirected to > > > ________________________________ > Get news, entertainment and everything you care about at Live.com. Check it > out! > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Benjamin Jacob
2008-Aug-24 16:14 UTC
[asterisk-users] entering a password to have access to a sip account?!
Hello Roland, You can use the cmd Read for this. http://www.voip-info.org/wiki/view/Asterisk+cmd+Read Pretty straight forward. Whenever you need to accept DTMF input from the user collect the required digits using Read; check the collected digits; if yes jump to required extension; else reject user or whatever you want to do. I could've written out the dialplan, but well... you are a newbie you said, so you gotta learn ;-) . Hope this helps. - Ben. --- On Sun, 8/24/08, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> wrote:> From: RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> > Subject: [asterisk-users] entering a password to have access to a sip account?! > To: asterisk-users at lists.digium.com > Date: Sunday, August 24, 2008, 3:26 PM > Hi all, > > i;m obviously a newbie, its been 2 days that im trying to > figure out a way to deny a specific extension (300) from > calling another specific extensions (03) except if the > caller punch a specified password.. sorry if im not > explaining myself well.. heres an example: > > i called my pstn line(with 300 as its sip account), an > attendant answers and asks me to punch in an extension > number right now if i dial "03" it rings at the > other end! though i dont want that to happen! i want to set > asterisk up in a way tht if i dial "03" from > "300" to ask me for a password... or it wont let > the line go through! > > > can anyone guide me through this issue! im really going > crazy to get this done! any help would truly and utterly be > appreciated:) > > > > ps: find below my extensions.conf > > > [sipura-line] > exten => 301,1,Answer() ; Answer inbound calls > exten => 301,2,Playback(silence/1) > exten => 301,3,Background(simzy1) ; input an extension > exten => 301,4,WaitExten(8) > exten => 301,5,Dial(SIP/100,15) ; goes to operator > exten => 301,4,Wait(8) > include => spa > exten => _XXX,6,VoiceMail(100 at default) > exten => 301,n,Hangup() > > > > > [spa] > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals > to 5 seconds so it will ring 3 times > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 > voicemail box if line is busy or unavailable > exten => _1XX,3,HangUp() > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals > to 5 seconds so it will ring 3 times > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to > voicemail box if line is busy or unavailable > exten => _2XX,3,HangUp() > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals > to 5 seconds so it will ring 3 times > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 > voicemail box if line is busy or unavailable > exten => _3XX,3,HangUp() > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte > exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference > exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 > exten => 303,1,VoicemailMain ; voicemail box to be > redirected to > > > _________________________________________________________________ > News, entertainment and everything you care about at > Live.com. Get it now! > http://www.live.com/getstarted.aspx_______________________________________________ > -- Bandwidth and Colocation Provided by > http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
RoLaNd RoLaNd
2008-Aug-24 20:20 UTC
[asterisk-users] entering a password to have access to a sip account?!
Hello Steve, thanks for the advice :) though one prob! if i add the authenticate line itll require all callers to enter 1234 to access *ANY* sip account.. even though this would come in handy at some point but at the moment i just want to deny the extension 300 from being able to call "01" unless the caller entered a password.. find below wht i did so far.. [sipura-line] exten => 301,1,Answer() ; Answer inbound calls exten => 301,2,Playback(silence/1) exten => 301,3,Background(simzy1) ; input an extension exten => 301,4,authenticate(1234) exten => 301,5,WaitExten(8) exten => 301,6,Dial(SIP/100,15) ; goes to operator exten => 301,3,Wait(8) include => spa exten => _XXX,6,VoiceMail(100 at default) exten => 301,n,Hangup() [spa] exten =>_301,1,GoTo(sipura-line,${EXTEN},1) exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it will ring 3 times exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if line is busy or unavailable exten => _1XX,3,HangUp() exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it will ring 3 times exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if line is busy or unavailable exten => _2XX,3,HangUp() exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it will ring 3 times exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if line is busy or unavailable exten => _3XX,3,HangUp() exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line ;exten =>_01,2,Set(TIMEOUT(absolute)=5) exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer exten => 303,1,VoicemailMain ; voicemail box to be redirected to> Date: Sun, 24 Aug 2008 12:05:02 -0400 > From: stotaro at totarotechnologies.com > To: asterisk-users at lists.digium.com > Subject: Re: [asterisk-users] entering a password to have access to a sip account?! > > You want to use Authenticate() between answer and dial. > > http://www.google.com/search?q=asterisk+authenticate&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > Thanks, > Steve Totaro > > On Sun, Aug 24, 2008 at 11:26 AM, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> wrote: > > > > > > Hi all, > > > > i;m obviously a newbie, its been 2 days that im trying to figure out a way > > to deny a specific extension (300) from calling another specific extensions > > (03) except if the caller punch a specified password.. sorry if im not > > explaining myself well.. heres an example: > > > > i called my pstn line(with 300 as its sip account), an attendant answers and > > asks me to punch in an extension number right now if i dial "03" it rings at > > the other end! though i dont want that to happen! i want to set asterisk up > > in a way tht if i dial "03" from "300" to ask me for a password... or it > > wont let the line go through! > > > > > > can anyone guide me through this issue! im really going crazy to get this > > done! any help would truly and utterly be appreciated:) > > > > > > > > ps: find below my extensions.conf > > > > > > [sipura-line] > > exten => 301,1,Answer() ; Answer inbound calls > > exten => 301,2,Playback(silence/1) > > exten => 301,3,Background(simzy1) ; input an extension > > exten => 301,4,WaitExten(8) > > exten => 301,5,Dial(SIP/100,15) ; goes to operator > > exten => 301,4,Wait(8) > > include => spa > > exten => _XXX,6,VoiceMail(100 at default) > > exten => 301,n,Hangup() > > > > > > > > > > [spa] > > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > > will ring 3 times > > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if line > > is busy or unavailable > > exten => _1XX,3,HangUp() > > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > > will ring 3 times > > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if > > line is busy or unavailable > > exten => _2XX,3,HangUp() > > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it > > will ring 3 times > > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if > > line is busy or unavailable > > exten => _3XX,3,HangUp() > > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > > exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte > > exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference > > exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 > > exten => 303,1,VoicemailMain ; voicemail box to be redirected to > > > > > > ________________________________ > > Get news, entertainment and everything you care about at Live.com. Check it > > out! > > _______________________________________________ > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > > Register Now: http://www.astricon.net > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users_________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080824/34ab7a27/attachment.htm
Grygoriy Dobrovolskyy
2008-Aug-24 22:21 UTC
[asterisk-users] entering a password to have access to a sip account?!
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 2008/8/24 RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com>> Hello Steve, > > thanks for the advice :) > > though one prob! if i add the authenticate line itll require all callers to > enter 1234 to access *ANY* sip account.. > even though this would come in handy at some point but at the moment i > just want to deny the extension 300 from being able to call "01" unless the > caller entered a password.. > find below wht i did so far.. > > > > > > [sipura-line] > exten => 301,1,Answer() ; Answer inbound calls > exten => 301,2,Playback(silence/1) > exten => 301,3,Background(simzy1) ; input an extension > exten => 301,4,authenticate(1234) > exten => 301,5,WaitExten(8) > exten => 301,6,Dial(SIP/100,15) ; goes to operator > exten => 301,3,Wait(8) > include => spa > exten => _XXX,6,VoiceMail(100 at default) > exten => 301,n,Hangup() > > > > > [spa] > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if > line is busy or unavailable > exten => _1XX,3,HangUp() > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if > line is busy or unavailable > exten => _2XX,3,HangUp() > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it > will ring 3 times > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if > line is busy or unavailable > exten => _3XX,3,HangUp() > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > exten => 303,1,VoicemailMain ; voicemail box to be redirected to > > > > > Date: Sun, 24 Aug 2008 12:05:02 -0400 > > From: stotaro at totarotechnologies.com > > To: asterisk-users at lists.digium.com > > Subject: Re: [asterisk-users] entering a password to have access to a sip > account?! > > > > > You want to use Authenticate() between answer and dial. > > > > > http://www.google.com/search?q=asterisk+authenticate&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > > > Thanks, > > Steve Totaro > > > > On Sun, Aug 24, 2008 at 11:26 AM, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> > wrote: > > > > > > > > > Hi all, > > > > > > i;m obviously a newbie, its been 2 days that im trying to figure out a > way > > > to deny a specific extension (300) from calling another specific > extensions > > > (03) except if the caller punch a specified password.. sorry if im not > > > explaining myself well.. heres an example: > > > > > > i called my pstn line(with 300 as its sip account), an attendant > answers and > > > asks me to punch in an extension number right now if i dial "03" it > rings at > > > the other end! though i dont want that to happen! i want to set > asterisk up > > > in a way tht if i dial "03" from "300" to ask me for a password... or > it > > > wont let the line go through! > > > > > > > > > can anyone guide me through this issue! im really going crazy to get > this > > > done! any help would truly and utterly be appreciated:) > > > > > > > > > > > > ps: find below my extensions.conf > > > > > > > > > [sipura-line] > > > exten => 301,1,Answer() ; Answer inbound calls > > > exten => 301,2,Playback(silence/1) > > > exten => 301,3,Background(simzy1) ; input an extension > > > exten => 301,4,WaitExten(8) > > > exten => 301,5,Dial(SIP/100,15) ; goes to operator > > > exten => 301,4,Wait(8) > > > include => spa > > > exten => _XXX,6,VoiceMail(100 at default) > > > exten => 301,n,Hangup() > > > > > > > > > > > > > > > [spa] > > > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > > > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so > it > > > will ring 3 times > > > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box > if line > > > is busy or unavailable > > > exten => _1XX,3,HangUp() > > > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so > it > > > will ring 3 times > > > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box > if > > > line is busy or unavailable > > > exten => _2XX,3,HangUp() > > > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds > so it > > > will ring 3 times > > > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box > if > > > line is busy or unavailable > > > exten => _3XX,3,HangUp() > > > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > > > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > > > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > > > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > > > exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte > > > exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference > > > exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 > > > exten => 303,1,VoicemailMain ; voicemail box to be redirected to > > > > > > > > > ________________________________ > > > Get news, entertainment and everything you care about at Live.com. > Check it > > > out! > > > _______________________________________________ > > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > > > > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > > > Register Now: http://www.astricon.net > > > > > > asterisk-users mailing list > > > To UNSUBSCRIBE or update options visit: > > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > > > _______________________________________________ > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > > Register Now: http://www.astricon.net > > > > asterisk-users mailing list > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > ------------------------------ > Connect to the next generation of MSN Messenger Get it now! > <http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline> > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080825/e47e65d4/attachment.htm
Grygoriy Dobrovolskyy
2008-Aug-24 22:30 UTC
[asterisk-users] entering a password to have access to a sip account?!
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
Steve Totaro
2008-Aug-25 01:55 UTC
[asterisk-users] entering a password to have access to a sip account?!
Roland, The simple solution is to utilize the power of contexts (put exten 300 in a different context in sip.conf or db) and includes to separate yet include 300 (so 300 can be called and call other internal extensions). Add authenticate before the dial statement. The easiest way to do it, is just copy the [spa] context in your dialplan and then change the context from [spa] to [restricted_300] (or whatever) and then just add the authenticate statement as below and renumber the dial prio to 2 or (n for next). Make sure your context in sip.conf for that sip extension matches this newly created context. There are probably cleaner ways of doing it, but one thing at a time :) exten =>_01,1,Authenticate(1234) exten =>_01,2,Dial(SIP/$(EXTEN)@300) ; old ogero line Thanks, Steve Totaro On Sun, Aug 24, 2008 at 4:20 PM, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> wrote:> Hello Steve, > > thanks for the advice :) > > though one prob! if i add the authenticate line itll require all callers to > enter 1234 to access *ANY* sip account.. > even though this would come in handy at some point but at the moment i just > want to deny the extension 300 from being able to call "01" unless the > caller entered a password.. > find below wht i did so far.. > > > > > > [sipura-line] > exten => 301,1,Answer() ; Answer inbound calls > exten => 301,2,Playback(silence/1) > exten => 301,3,Background(simzy1) ; input an extension > exten => 301,4,authenticate(1234) > exten => 301,5,WaitExten(8) > exten => 301,6,Dial(SIP/100,15) ; goes to operator > exten => 301,3,Wait(8) > include => spa > exten => _XXX,6,VoiceMail(100 at default) > exten => 301,n,Hangup() > > > > > [spa] > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if line > is busy or unavailable > exten => _1XX,3,HangUp() > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so it > will ring 3 times > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box if > line is busy or unavailable > exten => _2XX,3,HangUp() > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so it > will ring 3 times > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if > line is busy or unavailable > exten => _3XX,3,HangUp() > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer > exten => 303,1,VoicemailMain ; voicemail box to be redirected to > > > >> Date: Sun, 24 Aug 2008 12:05:02 -0400 >> From: stotaro at totarotechnologies.com >> To: asterisk-users at lists.digium.com >> Subject: Re: [asterisk-users] entering a password to have access to a sip >> account?! >> >> You want to use Authenticate() between answer and dial. >> >> >> http://www.google.com/search?q=asterisk+authenticate&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >> >> Thanks, >> Steve Totaro >> >> On Sun, Aug 24, 2008 at 11:26 AM, RoLaNd RoLaNd <r_o_l_a_n_d at hotmail.com> >> wrote: >> > >> > >> > Hi all, >> > >> > i;m obviously a newbie, its been 2 days that im trying to figure out a >> > way >> > to deny a specific extension (300) from calling another specific >> > extensions >> > (03) except if the caller punch a specified password.. sorry if im not >> > explaining myself well.. heres an example: >> > >> > i called my pstn line(with 300 as its sip account), an attendant answers >> > and >> > asks me to punch in an extension number right now if i dial "03" it >> > rings at >> > the other end! though i dont want that to happen! i want to set asterisk >> > up >> > in a way tht if i dial "03" from "300" to ask me for a password... or it >> > wont let the line go through! >> > >> > >> > can anyone guide me through this issue! im really going crazy to get >> > this >> > done! any help would truly and utterly be appreciated:) >> > >> > >> > >> > ps: find below my extensions.conf >> > >> > >> > [sipura-line] >> > exten => 301,1,Answer() ; Answer inbound calls >> > exten => 301,2,Playback(silence/1) >> > exten => 301,3,Background(simzy1) ; input an extension >> > exten => 301,4,WaitExten(8) >> > exten => 301,5,Dial(SIP/100,15) ; goes to operator >> > exten => 301,4,Wait(8) >> > include => spa >> > exten => _XXX,6,VoiceMail(100 at default) >> > exten => 301,n,Hangup() >> > >> > >> > >> > >> > [spa] >> > exten =>_301,1,GoTo(sipura-line,${EXTEN},1) >> > exten => _1XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so >> > it >> > will ring 3 times >> > exten => _1XX,2,VoiceMail(${EXTEN}@default) ; direct 2 voicemail box if >> > line >> > is busy or unavailable >> > exten => _1XX,3,HangUp() >> > exten => _2XX,1,Dial(SIP/${EXTEN},20) ;each ring equals to 5 seconds so >> > it >> > will ring 3 times >> > exten => _2XX,2,VoiceMail(${EXTEN}@default) ; directs to voicemail box >> > if >> > line is busy or unavailable >> > exten => _2XX,3,HangUp() >> > exten => _3XX,1,Dial(SIP/${EXTEN},20) ; each ring equals to 5 seconds so >> > it >> > will ring 3 times >> > exten => _3XX,2,VoiceMail(${EXTEN}@default) ; directs 2 voicemail box if >> > line is busy or unavailable >> > exten => _3XX,3,HangUp() >> > exten =>_01,1,Dial(SIP/$(EXTEN)@300) ; old ogero line >> > ;exten =>_01,2,Set(TIMEOUT(absolute)=5) >> > exten =>_02,1,Dial(SIP/$(EXTEN)@304) ; new ogero line >> > exten =>_03,1,Dial(SIP/$(EXTEN)@305) ; samer >> > exten =>_04,1,Dial(SIP/$(EXTEN)@306) ; gilberte >> > exten =>_05,1,Dial(SIP/$(EXTEN)@307) ; conference >> > exten =>_06,1,Dial(SIP/$(EXTEN)@308) ; line 4 >> > exten => 303,1,VoicemailMain ; voicemail box to be redirected to >> > >> > >> > ________________________________ >> > Get news, entertainment and everything you care about at Live.com. Check >> > it >> > out! >> > _______________________________________________ >> > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> > >> > AstriCon 2008 - September 22 - 25 Phoenix, Arizona >> > Register Now: http://www.astricon.net >> > >> > asterisk-users mailing list >> > To UNSUBSCRIBE or update options visit: >> > http://lists.digium.com/mailman/listinfo/asterisk-users >> > >> >> _______________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> AstriCon 2008 - September 22 - 25 Phoenix, Arizona >> Register Now: http://www.astricon.net >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > ________________________________ > Connect to the next generation of MSN Messenger Get it now! > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > AstriCon 2008 - September 22 - 25 Phoenix, Arizona > Register Now: http://www.astricon.net > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >