SIP registration in asterisks for SIP gateway

Hi

I am newbie to asterisk, but have managed to install and do some configuration on asterisks. I just have one confusion that is with the register function which happens in sip.conf file. I am using asterisk as a gateway to interconnect with different carriers in the world.

I believe i do not fully understand how register works with asterisk. Well the format given in sip.conf file is
register => [peer?][transport://]user[@domain][:secret[]]@host[:port][/extension][~expiry]

My SIP server has a static public IP and i am performing no NAT for this setup. The other carriers that i am interconnecting with have provided me with a Public IP only and they do not authenticate at username and password level. I was actually wondering how will i need to structure my register function so that i can end up registering just my SIP server IP with theirs.

Just for an example if my SIP server IP is 210.48.x.x, and my carrier’s IP address is 207.239.x.x, how would i write my register function, to register my IP with the other?

Also, without registering would i still be able to send/recieve calls with my interconnecting carriers?

Are you sure they need you to register? Registering is really for cases where the IP address is variable, although service providers may choose to require it for everyone, because it is easier to administer one mechanism. They would be unwise to do so if they do not use authentication, and it would be pointless if they use the IP address for authentication.

peer@host

or

peer@host/extension

or use callbackextension, instead.

I don’t understand the ? after the peer.

The provider may even accept @host.

Hi David55

Thanks for your response. Much appreciated, well my question that you couldn’t understand was, is it possible for me to send calls to carriers, even without the registration, i.e just creating the peers in SIP.conf and then sending the calls to the peers, without having the need to register the peers using the register function.

Thanks

The carrier will either require you to have a static IP address, or they should require your to register WITH a user and password. If they require an unauthenticated register, change your carrier, as that suggest it will be easy to impersonate you, and/or they don’t know what they are doing.

hi davide 55

thanks for your reply, but i actually i have the same case with “sprasad” and i entered the registration function as follow

[ my asterisk static ip @ their IP ]

and it did not works because once the register message sent to my provider it replies with "405 method not allowed ".

i am wondering if i can skip this registration or to if i can modify the sip.conf file in order to add the allow filed in the sip registration message sent from asterisk ?

thanks

Simply don’t include the register line at all, but please ask yourself, what are they doing to stop someone else using your account.

The allow line you would need to change is the one that they send!

Hi

register => SIP_USERNAME:SIP_PASSWORD@THEIR_IP_ADDRESS
for exaple

register => cheese:omlette@127.0.0.1

For example if your IAX/SIP provider tells you to connect to 192.168.0.1 with user and pass, you can do something like…

[user]
type=friend (insecure)
disallow=all
allow=g729
?host=dynamic/192.168.0.1
?qualify=yes

The register line must be in the general section of sip.conf/iax.conf

After this you can Dial(SIP/user/${EXTEN},timeout) using that trunk

I’m assuming that the method that is not allowed is REGISTER, i.e. this service provider uses some other way of working out where to send calls.