On Sat, Sep 20, 2014 at 1:35 PM, Joshua Colp <jc...@digium.com> wrote:

> George Joseph wrote:
>
>> On Sat, Sep 20, 2014 at 1:10 PM, Joshua Colp <jc...@digium.com
>> <mailto:jc...@digium.com>> wrote:
>>
>>     George Joseph wrote:
>>
>>     <snip>
>>
>>
>>         Or separate objects from a config file perspective but
>>         implemented in
>>         pjsip_configuration with endpoint.
>>
>>
>>     Completely separate. Mixing the two defeats the purpose of having a
>>     clear boundary.
>>
>> Ok, how about this...   2 new object types called "composite" and
>> "pattern" (or whatever) implemented in a separate res_pjsip_* module
>>
>> [mytrunk]
>> type = composite
>> pattern = trunk
>> etc...
>>
>> [trunk]
>> type = pattern
>> register = yes
>> contacts = static
>> outbound_auth = yes
>> inbound_auth = no
>> identify = yes
>>
>>
> I don't understand the naming or what they mean at first glance ^_^
>
> I was thinking that we probably don't want to create hard coded objects
called "trunk", "user", etc.  Instead let the user define the patterns that
suit them.

So, define a pattern first...

[trunk-pattern]
type = pattern
contacts = static   ; would cause a contact line to appear in the aor
                    ; for each server
register = yes      ; would cause a registration object to be created for
each
                    ; server
outbound_auth = yes ; would cause an auth object to be created which the
                    ; endpoint would reference as outbound_auth
inbound_auth = no   ; would do the same thing for endpoint/auth
identify = yes      ; would cause an identify object to be created with a
                    ; match for each server
Actually, the pattern could specify how to construct other variables...
client_uri = sip:%OU@%S
contact = sip:%S
server_uri = sip:%S

Now for each trunk...

[mytrunk]
type = composite
pattern = trunk-pattern
server = sip1.itsp.com
server = sip2.itsp.com
outbound_username = myusername
outbound_password = mypassword

would be the equivalent of...

[mytrunk]
type = endpoint
aors = mytrunk
outbound_auth = mytrunk-auth

[mytrunk]
type = aor
contact = sip:sip1.itsp.com
contact = sip:sip2.itsp.com

[mytrunk-auth]
type = auth
username = myusername
password = mypassword

[mytrunk-id]
type = identify
endpoint = mytrunk
match = sip1.itsp.com
match = sip2.itsp.com

[myrunk-reg-1]
type = registration
endpoint = mytrunk
client_uri = sip:myusern...@sip1.itsp.com
server_uri = sip:sip1.itsp.com

[myrunk-reg-2]
type = registration
endpoint = mytrunk
client_uri = sip:myusern...@sip2.itsp.com
server_uri = sip:sip2.itsp.com
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to