Regestration Extension

OK I want to use a perl script to authenticate username/password combinations for SIP phones using an customer account managment database.

I’m thinking that I should use the extensions.conf to call the scripts that I need to write, but I’m not quite sure where to begin…

When the phone first connects to the Asterisk server I get the following error message :

May 31 03:52:28 NOTICE[27279]: chan_sip.c:10886 handle_request_register: Registration from ‘sip:iconz@210.48.65.10’ failed for ‘202.14.100.208’ - Username/auth name mismatch

So obviously there is nothing in my extensions.conf that handles the initial registration. My question really is this, what is the name of the event that gets generated when a SIP phone first connects to the SIP server, is it the Answer event? Do I need to include something like :

exten => 711,1,Answer()
exten => 711,2,AGI(regestrationScript.agi)

where regestrationScript.agi is the script that authenticates the username and password stored on the SIP phone.

Cheers!

I’ve started to look in this area too. I want to use mysql or pam ( with
mysql tied into that ).

If you google for radius asterisk auth you’ll find someone that has done
some work with radius and asterisk.

I think that the authorization stuff is going to work in the sip.conf
where the ‘secret’ is specified. I don’t think that the extensions is
the place for this. When a user ‘registers’ a SIP phone, they go through
the code that runs on the sip.conf file…

jack

you both might look at the sip.conf directives allowguest and autocreatepeer - i think either (or both) of those might work for what you are trying to do…

Ah it looks like sip.conf is the config file I should be looking at :

register => user[:secret[]]@host[:port][/extension]

If I can send the registration request to a perl script on localhost…

allowguest and autocreatepeer I’m not sure about, I don’t want everyone classed as guest users - they have to have their username/password authenticated.

Cheers people.

Hi,

Did you managed to authenticate users using register section at sip.conf and your agi script?

I also think it’s possible with my own php script using the pam_auth module.

Thanks,
David

Hi,

to catch the events that Asterisk generates on a register, use Asterisk Manger Interface (AMI), then you do stuff on correct or failed registrations.