<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 22 September 2015 at 16:04, Thyda ENG <span dir="ltr"><<a href="mailto:engthyda@gmail.com" target="_blank">engthyda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">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,<div><br></div><div>







<p><span>[100]</span></p>
<p><span>type=endpoint</span></p>
<p><span>aors=100</span></p>
<p><span>auth=100-auth</span></p>
<p><span>allow=ulaw,alaw,gsm,g726</span></p>
<p><span>context=from-internal</span></p>
<p><span>callerid=device <100></span></p>
<p><span>dtmf_mode=rfc4733</span></p>
<p><span>use_avpf=no</span></p>
<p><span>ice_support=no</span></p>
<p><span>media_use_received_transport=no</span></p>
<p><span>trust_id_inbound=yes</span></p>
<p><span>send_pai=yes</span></p>
<p><span>rtp_symmetric=yes</span></p>
<p><span>rewrite_contact=yes</span></p><p><span>message_context=astsms</span></p>
<p><span></span><br></p>
<p><span>[200]</span></p>
<p><span>type=endpoint</span></p>
<p><span>aors=200</span></p>
<p><span>auth=200-auth</span></p>
<p><span>allow=ulaw,alaw,gsm,g726</span></p>
<p><span>context=from-internal</span></p>
<p><span>callerid=device <200></span></p>
<p><span>dtmf_mode=rfc4733</span></p>
<p><span>use_avpf=no</span></p>
<p><span>ice_support=no</span></p>
<p><span>media_use_received_transport=no</span></p>
<p><span>trust_id_inbound=yes</span></p>
<p><span>send_pai=yes</span></p>
<p><span>rtp_symmetric=yes</span></p>
<p><span>rewrite_contact=yes</span></p><p><span>message_context=astsms<br></span></p><p><span><br></span></p><p>how could I avoid duplicate thing like this ?</p></div></div>
<br>--<br>
<br></blockquote><div><br></div><div>From my brief look at pjsip.conf it uses the same template concept as the sip.conf.</div><div><br></div><div>Here's the relevant instructions from the sip.conf in asteris13</div><div><br></div><div> ;</div><div>; Because you might have a large number of similar sections, it is generally</div><div>; convenient to use templates for the common parameters, and add them</div><div>; the the various sections. Examples are below, and we can even leave</div><div>; the templates uncommented as they will not harm:</div><div><br></div><div>[basic-options](!)                ; a template</div><div>        dtmfmode=rfc2833</div><div>        context=from-office</div><div>        type=friend</div><div><br></div><div>[natted-phone](!,basic-options)   ; another template inheriting basic-options</div><div>        directmedia=no</div><div>        host=dynamic</div><div><br></div><div>[public-phone](!,basic-options)   ; another template inheriting basic-options</div><div>        directmedia=yes</div><div><br></div><div>[my-codecs](!)                    ; a template for my preferred codecs</div><div>        disallow=all</div><div>        allow=ilbc</div><div>        allow=g729</div><div>        allow=gsm</div><div>        allow=g723</div><div>        allow=ulaw</div><div>        ; Or, more simply:</div><div>        ;allow=!all,ilbc,g729,gsm,g723,ulaw</div><div><br></div><div>[ulaw-phone](!)                   ; and another one for ulaw-only</div><div>        disallow=all</div><div>        allow=ulaw</div><div>        ; Again, more simply:</div><div>        ;allow=!all,ulaw</div><div><br></div><div>; and finally instantiate a few phones</div><div>;</div><div>; [2133](natted-phone,my-codecs)</div><div>;        secret = peekaboo</div><div>; [2134](natted-phone,ulaw-phone)</div><div>;        secret = not_very_secret</div><div>; [2136](public-phone,ulaw-phone)</div><div>;        secret = not_very_secret_either</div><div>; ...</div><div>;</div><div><br></div><div>Regards</div><div><br></div><div>Ish</div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><pre>Ishfaq Malik 
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)161 660 2350
f: +44 (0)161 660 9825
e: <a href="mailto:ish@pack-net.co.uk" target="_blank">ish@pack-net.co.uk</a>
w: <a href="http://www.pack-net.co.uk" target="_blank">http://www.pack-net.co.uk</a>

Registered Address: PACKNET LIMITED, Duplex 2, Ducie House
37 Ducie Street 
Manchester, M1 2JW
COMPANY REG NO. 04920552
</pre></div></div></div></div>
</div></div>