diff options
author | Richard Mudgett <rmudgett@digium.com> | 2017-09-20 18:36:15 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-10-09 12:52:30 -0500 |
commit | fb19799b622bf41897f91b06ec8be81f858eac92 (patch) | |
tree | e7f0dc87310bd1be4f4768133405658cd96d4ade /res/res_pjsip.c | |
parent | 13c1c72401b73465322540e73bf4022c3e5b927f (diff) |
res_pjsip_registrar.c: Update remove_existing AOR contact handling.
When "rewrite_contact" is enabled, the "max_contacts" count option can
block re-registrations because the source port from the endpoint can be
random. When the re-registration is blocked, the endpoint may give up
re-registering and require manual intervention.
* The "remove_existing" option now allows a registration to succeed by
displacing any existing contacts that now exceed the "max_contacts" count.
Any removed contacts are the next to expire. The behaviour change is
beneficial when "rewrite_contact" is enabled and "max_contacts" is greater
than one. The removed contact is likely the old contact created by
"rewrite_contact" that the device is refreshing.
ASTERISK-27192
Change-Id: I64c107a10b70db1697d17136051ae6bf22b5314b
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 6c1f77659..cbeb5ea3d 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1448,6 +1448,18 @@ It only limits contacts added through external interaction, such as registration. </para> + <note><para>The <replaceable>rewrite_contact</replaceable> option + registers the source address as the contact address to help with + NAT and reusing connection oriented transports such as TCP and + TLS. Unfortunately, refreshing a registration may register a + different contact address and exceed + <replaceable>max_contacts</replaceable>. The + <replaceable>remove_existing</replaceable> option can help by + removing the soonest to expire contact(s) over + <replaceable>max_contacts</replaceable> which is likely the + old <replaceable>rewrite_contact</replaceable> contact source + address being refreshed. + </para></note> <note><para>This should be set to <literal>1</literal> and <replaceable>remove_existing</replaceable> set to <literal>yes</literal> if you wish to stick with the older <literal>chan_sip</literal> behaviour. @@ -1457,15 +1469,29 @@ <configOption name="minimum_expiration" default="60"> <synopsis>Minimum keep alive time for an AoR</synopsis> <description><para> - Minimum time to keep a peer with an explict expiration. Time in seconds. + Minimum time to keep a peer with an explicit expiration. Time in seconds. </para></description> </configOption> <configOption name="remove_existing" default="no"> <synopsis>Determines whether new contacts replace existing ones.</synopsis> <description><para> - On receiving a new registration to the AoR should it remove - the existing contact that was registered against it? + On receiving a new registration to the AoR should it remove enough + existing contacts not added or updated by the registration to + satisfy <replaceable>max_contacts</replaceable>? Any removed + contacts will expire the soonest. </para> + <note><para>The <replaceable>rewrite_contact</replaceable> option + registers the source address as the contact address to help with + NAT and reusing connection oriented transports such as TCP and + TLS. Unfortunately, refreshing a registration may register a + different contact address and exceed + <replaceable>max_contacts</replaceable>. The + <replaceable>remove_existing</replaceable> option can help by + removing the soonest to expire contact(s) over + <replaceable>max_contacts</replaceable> which is likely the + old <replaceable>rewrite_contact</replaceable> contact source + address being refreshed. + </para></note> <note><para>This should be set to <literal>yes</literal> and <replaceable>max_contacts</replaceable> set to <literal>1</literal> if you wish to stick with the older <literal>chan_sip</literal> behaviour. |