Sip.conf host = subnet

Is it possible to have a subnet for the host = ?

so

host = 172.16.1.0/24

my sip provider has given me 3 subnets of 30 hosts each and I don’t want to put 90 entries in my sip.conf when I could put 3

No. How would Asterisk know which addresses to send to and which were routers?

Generally, if you have this situation, you have to use allowguest=yes and apply good access control filters.

But when you have lots of inbound trunks how do you know which one it has come in from?

You only have to worry about the trunks to ITSPs with large numbers of source addresses,

Ideally you arrange your numbering so that it doesn’t matter. Otherwise, you will have to use the CHANNEL function to read the peer IP address.

I guess in this case I’m better off putting in the 60 peers and not worrying how long the sip.conf is.

I assume this has little impact to performance.

I may do something different in the furure

People often run with an order of magnitude more local devices, so the search time cannot be to high.

And Templates(wiki.asterisk.org/wiki/display/ … +Templates) will definitely help you putting all those peers in sip.conf

–Satish Barot

Yes that’s a neater solution.

I made all the entries, tested, found DTMF wasn’t working and had to find and replace all the settings. Easier if I just do it in one place.

I’ll convert it over later today I think.
Thanks

[quote=“londonnet”]Yes that’s a neater solution.

I made all the entries, tested, found DTMF wasn’t working and had to find and replace all the settings. Easier if I just do it in one place.

I’ll convert it over later today I think.
Thanks[/quote]
Hi,

I have a similar issue where I register to an ITSP’s single IP, but he can send me inbound calls to my number from 4 * /24 subnets.

I didn’t understnd how to implement the templates mechanism to define a peer that would allow inbound calls from all these subnets.

Can you copy your config?

Thanks,

David

Haven’t been bothered to do it yet. If you get there first perhaps you can share and save me a job

Try something like this
register => my_sip_user:my_secret@XXX.XXX.XXX.XX
common
type=peer
disallow=all
allow=ulaw
allow=alaw
qualify=yes
port=5060
context=from_provider

my_sip_user
secret=my_secret
host=XXX.XXX.XXX.XX
(trunk1)(common)
host=XX.XX.XX.XX
(trunk2)(common)
host=XX.XX.XX.XX


(trunkn)(common)
host=XX.XX.XX.XX

Keep common parameters in [common] and individual parameters in respective context

–Satish Barot

Thanks for the example.

Updated my sip.conf and it looks much neater.