SIP Configuration for Multiple Users

Hello,
I am newbie in Asterisk. If I have to add 100 users at sip.conf, then How Can I add those 100 users at a time.
I am configuring sip.conf as below

[USERNAIK]
type=friend
context=incoming
allow=ulaw,alaw
secret=xxxx
host=dynamic

[USERCHANDAN]
type=friend
context=incoming
allow=ulaw,alaw
secret=xxxx
host=dynamic

[SUMAN]
type=friend
context=incoming
allow=ulaw,alaw
secret=xxxx
host=dynamic

Pokhraj

I don’t understand the problem. You just add them.

Note that, unless any users share IP addresses, type=peer is safer.

You can use templates to avoid repeating all but the section name and the secret. These are explained in the sample configuration.

As you are new to Asterisk and seemingly just starting out I would suggest not using chan_sip as your channel driver. This is a legacy channel driver, and will be officially deprecated in Asterisk 17.

Instead please use the chan_pjsip channel driver and resources instead. More information on configuring your pjsip.conf can be found on the configuring res_pjsip wiki page (along with loads of other information about the driver).

And depending on the version you are using you can ease your configuration burden by using the pjsip configuration wizard.

1 Like

Could you please update the any link for that template or update one example on this please
It will be very helpful

The wiki has a page[1] on using templates including examples.

[1] https://wiki.asterisk.org/wiki/display/AST/Using+Templates