Asterisk SIP [general]

If i have this in my sip.conf:

[general] context = (own_context in extensions.conf where recive the call ) realm = bindport=5060 srvlookup=yes disallow=all allow=ulaw allow=gsm

do i really need:

[my_provider] type=peer fromuser=XXXX canreinvite=no secret=AAAAA insecure=invite,port host= IP disallow=all ;<---- This again?? allow=ulaw ;<---- This again?? allow=gsm ;<---- This again??

Do i really need to specify things an general again in a peer?

If not, are all [general] items also exposed to [sip_peer] items?

All general items will be used as defaults for the peer, as long as the item is valid for a peer.

Great, thanks! :smile:

I should say, although it has the same effect, is that what inherits from general to peer is the list of allowed codecs, rather than the individual allow and disallow lines.

peer->capability = global_capability;

While not directly related right now just as an FYI:

In the future things are moving away from such patterns and going towards usage of template inheritance instead. For example the new PJSIP channel driver doesn’t expose configuration like that in a general section.

In case you’ve never encountered templates they can be used like this:



Thanks for the tip jcolp, im actually using SIP RealTime, the sip.conf was just for demonstration