[asterisk-users] How to set the global setting for each pjsip endpoint
Ishfaq Malik
ish at pack-net.co.uk
Tue Sep 22 10:12:26 CDT 2015
On 22 September 2015 at 16:04, Thyda ENG <engthyda at gmail.com> wrote:
> I have many endpoints and each endpoint has some parameter in common so i
> wonder is there any way to config one for all endpoints? Like in my example
> I have two endpoints and I repeat the same thing,
>
> [100]
>
> type=endpoint
>
> aors=100
>
> auth=100-auth
>
> allow=ulaw,alaw,gsm,g726
>
> context=from-internal
>
> callerid=device <100>
>
> dtmf_mode=rfc4733
>
> use_avpf=no
>
> ice_support=no
>
> media_use_received_transport=no
>
> trust_id_inbound=yes
>
> send_pai=yes
>
> rtp_symmetric=yes
>
> rewrite_contact=yes
>
> message_context=astsms
>
>
> [200]
>
> type=endpoint
>
> aors=200
>
> auth=200-auth
>
> allow=ulaw,alaw,gsm,g726
>
> context=from-internal
>
> callerid=device <200>
>
> dtmf_mode=rfc4733
>
> use_avpf=no
>
> ice_support=no
>
> media_use_received_transport=no
>
> trust_id_inbound=yes
>
> send_pai=yes
>
> rtp_symmetric=yes
>
> rewrite_contact=yes
>
> message_context=astsms
>
>
> how could I avoid duplicate thing like this ?
>
> --
>
>
>From my brief look at pjsip.conf it uses the same template concept as the
sip.conf.
Here's the relevant instructions from the sip.conf in asteris13
;
; Because you might have a large number of similar sections, it is generally
; convenient to use templates for the common parameters, and add them
; the the various sections. Examples are below, and we can even leave
; the templates uncommented as they will not harm:
[basic-options](!) ; a template
dtmfmode=rfc2833
context=from-office
type=friend
[natted-phone](!,basic-options) ; another template inheriting
basic-options
directmedia=no
host=dynamic
[public-phone](!,basic-options) ; another template inheriting
basic-options
directmedia=yes
[my-codecs](!) ; a template for my preferred codecs
disallow=all
allow=ilbc
allow=g729
allow=gsm
allow=g723
allow=ulaw
; Or, more simply:
;allow=!all,ilbc,g729,gsm,g723,ulaw
[ulaw-phone](!) ; and another one for ulaw-only
disallow=all
allow=ulaw
; Again, more simply:
;allow=!all,ulaw
; and finally instantiate a few phones
;
; [2133](natted-phone,my-codecs)
; secret = peekaboo
; [2134](natted-phone,ulaw-phone)
; secret = not_very_secret
; [2136](public-phone,ulaw-phone)
; secret = not_very_secret_either
; ...
;
Regards
Ish
--
Ishfaq Malik
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)161 660 2350
f: +44 (0)161 660 9825
e: ish at pack-net.co.uk
w: http://www.pack-net.co.uk
Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street
Manchester, M1 2JW
COMPANY REG NO. 04920552
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150922/96b4a384/attachment.html>
More information about the asterisk-users
mailing list