[asterisk-dev] Opinions Needed: PJSIP Outboud Registration with multiple server_uris

George Joseph george.joseph at fairview5.com
Sat Sep 20 14:57:34 CDT 2014


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

> George Joseph wrote:
>
>> On Sat, Sep 20, 2014 at 1:10 PM, Joshua Colp <jcolp at digium.com
>> <mailto:jcolp at 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:myusername at sip1.itsp.com
server_uri = sip:sip1.itsp.com

[myrunk-reg-2]
type = registration
endpoint = mytrunk
client_uri = sip:myusername at sip2.itsp.com
server_uri = sip:sip2.itsp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140920/b186b766/attachment.html>


More information about the asterisk-dev mailing list