Loginless SIP configuration

Is there a way to configure Asterisk to determine a context based solely on a provider’s IP (using SIP), or maybe to just accept a login too, but just ignore the secret?

Dustin Oprea

If your usin sip, you should be able to do both. This is by no means complete, but should illustrate the point.





The host option will match on incoming calls the ip address your specify, or if you set secret to nothing, you can login with the a password.



Thanks a lot… That’s a great help.

In that first example, will Asterisk completely ignore any user/password that is given?

On a separate note, can you determine a context by DID?:


Ignore is a relative term, all settings are defaulted to something. So you’ll have to check to see what the default setting is to know if it will cause problems or not.

I don’t believe that you need to specify the DID in sip.conf. With my VoIP provider, I have one trunk for inbound calls that dumps into one context. In that context I just have an extension configured for each of my DID lines.

If you have a ton and want to break it down into smaller sections you can use the dial plan “include” features.


Great… Regarding IP-based contexts, that’s exactly what I needed to know.

In terms of multi-tenant systems, I want to determine a context based on one or more DIDs-- Isn’t this the only way to ensure that each company has their own context?

Can you confirm that there is no difference between an empty secret, and leaving out the secret completely?


According the chan_sip.c, for incoming sip requests if secret is empty it is ok.

If you are looking to segment your extensions.conf file, perhaps for added security, look at using the include statements. The sample extensions.conf file that comes with Asterisk has some very good examples of this.

I can’t tell you much more because I’ve not had the need to put together a setup like that.