]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Default endpoints to the "offline" status. 59/3759/1
authorMark Michelson <mmichelson@digium.com>
Mon, 22 Aug 2016 22:08:19 +0000 (17:08 -0500)
committerJoshua Colp <jcolp@digium.com>
Mon, 29 Aug 2016 16:23:21 +0000 (11:23 -0500)
commit4c2fed881464fa61390d5299ad713967515c01ce
tree5d3cb37c1ad41564e95c7862c64364f45e55aa6c
parent9dfd4916a8330df6f70d614f01ef68458b27c589
res_pjsip: Default endpoints to the "offline" status.

A recent change attempted to optimize startup by not updating contact
status. Instead, code responsible for qualifying contacts updates the
status as it becomes known. The code even accounts for contacts/AORs
that are not set to be qualified.

The problem, though, is when there are no contacts associated with an
endpoint. A common case is when an endpoint is set to register its
contacts but has not done so yet. In this case, prior to registration,
the endpoint's device state will appear to be "not in use" and hints
associated with that device will appear to be "idle". In actuality, the
device state and hint should both appear as "unavailable". The reason
for the failure is that the optimization change made all persistent
endpoint states set to "unknown".

The fix here is to change the hard-coded "unknown" to be "offline"
instead. The default state will be offline until the qualifying code
determines that the contact is actually online. This way, if there are
no contacts at all, then the state stays as offline, and device state
and hints appear correctly.

ASTERISK-26269 #close
Reported by nappsoft

Change-Id: Ie99b84169393983453076f5e9c0d35ff313a456a
res/res_pjsip/pjsip_configuration.c