Newbie struggling with sip.conf

Hi everybody,

I’m getting my first Asterisk server up and running and am trying to understand exactly how sip.conf works.

I have a VoIP handset and a phone number with engin (Australian VoIP provider). I have a few questions:

1.) What does “register” achieve in sip.conf? Does it simply subscribe my Asterisk box to incoming calls from my SIP provider? Is it necessary?

2.) It seems that “best practice” is to set up 2 channels for my VoIP provider (incoming and outgoing, i.e. user and peer) and then 1 channel per handset (i.e. friend). Yet I’ve seen sample configs which only use one SIP channel, type=friend, to deliver the whole lot. Presumably in this latter situation, the handset connects to Asterisk with the same credentials Asterisk uses to place the call with the VoIP provider. Is this the only reason this 1-channel setup works for people? What is the best way to handle this?

3.) Assuming I create separate channels for all of these, am I just creating unnecessary dialplan headaches for myself?

Looking forward to your thoughts!

Thanks, and sorry if this has been addressed already. Google wasn’t being my friend :frowning:

Register attribute registers your Asterisk with your provider if that is what they require. The login credentials should come from the upstream provider.

I only have my upstream provider as type=peer and default context is “incoming”.
I then have a outgoing context in extensions.conf where the dial command uses the upstream peer for outbound calls.

All incoming lands in “incoming” and has either exten => s,1 etc. (Auto-attendand). If you have DID you can have redirects based on the number/s to the exten in another context (if you put the subscriber extensions in a “user” context.
I do like this for security reasons.


PAtrick Arkley

Okay, I think I’ve figured out what register does now.

My next question is about type.

Most of the examples I’ve seen use “type=friend” for provider channel definitions … I’m wondering why this is. My thinking (somewhat simplistically) is that “type=peer” looks after outgoing calls, and “register” looks after incoming calls. This works for me too.

Soooo… is it true that using “type=friend” makes Asterisk act like a SIP proxy? i.e. the “user” part allows phones to connect to Asterisk with the same credentials it then uses to connect to my SIP provider?

Register is only to register with your SIP provider.

Peer = outgoing only
User = incoming only
Friend = peer + user

/Patrick Arkley