[asterisk-tech] Authentication for ougoing calls

Gary Forsman gary.forsman at gmail.com
Tue Mar 16 09:44:31 SAST 2010


Hello All

This is how i do this

exten => _011XXXXXXX,1,Set(NUMBER=${EXTEN})
exten => _011XXXXXXX,n,Set(MYCONTEXT=joburg)
exten => _011XXXXXXX,n,NoOp( ${NUMBER} , ${MYCONTEXT})
exten => _011XXXXXXX,n,Goto(pinquery,query,1)
;Will only continue when PIN is authenticated
exten => _011XXXXXXX,n(ok),Dial(SIP/SmartNode/${EXTEN},,r)
exten => _011XXXXXXX,n,System(echo "Call failed to ${EXTEN}" >>
/var/log/asterisk/cdr-csv/Master.csv)
exten => _011XXXXXXX,n,PlayBack(all-circuits-busy-now)
exten => _011XXXXXXX,n,HangUp()


[pinquery]

exten => query,1,BackGround(enter-password)
exten => _XXXXXX,1,Set(USER=${EXTEN:-6:2})
exten => _XXXXXX,n,Set(PIN=${DB(PINCODE/${USER})})
exten => _XXXXXX,n,ResetCDR()
exten => _XXXXXX,n,Set(CDR(accountcode)=55${USER})              ;Entity ID
exten => _XXXXXX,n,Set(CDR(userfield)=${DB(AGENT/${USER})})  ;Users Name For
Pin
exten => _XXXXXX,n,GotoIf($[ ${PIN} = ${EXTEN:2}
]?${MYCONTEXT},${NUMBER},ok)
exten => _XXXXXX,n,Goto(query,1)


Then in the database for example i have the following entries
/AGENT/10                                         : PATHMA
you get this by doing
databse put AGENT 10 "PERSONS NAME"

Also have this in the databse for the authentication
/PINCODE/10                                       : 5624

Then if you look at the dialplan, you'll se that it wil need auth to call
and write the persons name in the CDR

Hope this helps

Regards

Gary




On Mon, Mar 15, 2010 at 6:54 PM, Clinton Lee Taylor <leet at leenx.org> wrote:

> Greetings ...
>
>  I use FreePBX on Asterisk and enable pins codes, this works pretty well.
>
> Happy Hunting.
> Mailed
> LeeT
>
>
> On 15 March 2010 11:44, Jan Groenewald <jan at aims.ac.za> wrote:
>
>> Hi
>>
>> We have an asterisk 1.4 system with asterisk-gui-2.0 on top.
>>
>> There are 4 dial plans (international, staff, visitors, etc.).
>> There are 30 analogue and 30 sip phones (with DID from Telkom).
>>
>> One extension now needs to be secured as it is abused, to require
>> an authentication code on all outgoing (non-local, non-emergency)
>> calls, but still be allowed to receive.
>>
>> I found this, but am not sure where to start or in which files,
>>
>> http://www.voip-info.org/tiki-index.php?page=Asterisk+cmd+Authenticate
>> http://www.voip-info.org/wiki/view/Asterisk+user+authentication
>> http://www.asteriskguru.com/tutorials/authenticate.html
>>
>> I tried, naively, as I am not used to an overall view of how
>> asterisk fits together, making a new dialplan (via the GUI),
>> and in extensions.conf adding (with a text editor) the last
>> line as below:
>>
>>   [DLPN_Kitchen]
>>   include = CallingRule_Emergency
>>   include = CallingRule_National
>>   include = CallingRule_cellphones
>>   include = default
>>   include = voicemenus
>>   exten -> 9327,1,Authenticate(1234)
>>
>> where 1234 would be the PIN.  I restarted asterisk, and there
>> was no error parsing, but I suspect this is Completely Wrong.
>>
>> Can someone help out here?
>>
>> regards,
>> Jan
>> _______________________________________________
>> asterisk tech mailing list
>> tech at asterisk.org.za
>> http://www.asterisk.org.za/mailman/listinfo/tech
>>
>
>
> _______________________________________________
> asterisk tech mailing list
> tech at asterisk.org.za
> http://www.asterisk.org.za/mailman/listinfo/tech
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://asterisk.org.za/pipermail/tech/attachments/20100316/f52e5d65/attachment-0001.htm 


More information about the tech mailing list