]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_outbound_registration.c: Fix handle_client_state_destruction() refs 89/689/3
authorRichard Mudgett <rmudgett@digium.com>
Tue, 16 Jun 2015 20:06:22 +0000 (15:06 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 25 Jun 2015 19:37:08 +0000 (14:37 -0500)
commit602c4b74b500fb6fbe3ae3f6e13d2502edbdd56c
tree3d8401a42dfc20018d3f907f1e8c0738a9118450
parent8c6a95a9ac605c53d1a5863528ff940221684ea3
res_pjsip_outbound_registration.c: Fix handle_client_state_destruction() refs

* handle_client_state_destruction() must always be passed a ref to
client_state because it will always unref client_state.
handle_registration_response() was not passing a client_state ref.

* Made the final un-REGISTER message get sent normally using the pjproject
register control structure in handle_client_state_destruction().  The
previous code attempted to short circuit the response handling for the
module to unload.  That doesn't work for a couple reasons.  One,
pjsip_regc_send() may call the registered callback before it returns and
unbalance the client_state ref count.  Two, the registered callback
handles any authentication for the un-REGISTER message.

* Made the distinction between internal registration state and external
registration status with sip_outbound_registration_status_str().  This is
necessary to avoid altering documented AMI messages with internal
changes.

* Removed references to client_state->client outside of the serializer
thread.  When handle_client_state_destruction() destroys the pjproject
register control structure that memory is freed and cannot be referenced
anymore.  These accesses were to provide information for debug and
off-nominal warning messages.

* In sip_outbound_registration_timer_cb() you should not access entry->id
after unrefing client_state because the passed in entry is normally
pointing to the timer entry in the client_state object.

ASTERISK-24907
Reported by: Kevin Harwell

Change-Id: Ia7b446d8644b6b4550ef5bea49527671de65183f
res/res_pjsip_outbound_registration.c