We are working on a patch for the REFER support and have a question on whether 
a lock is needed or not.

In chan_pjsip.c function xfer_client_on_evsub_state, code is processing the 
REFER-NOTIFY subscription.

It gets an ast_sip_session reference, then it acquires a ast_channel reference.
Should we make the code bump the lock count for the session's channel while we 
use it?  Unlocking when done using it?

Is it safe to assume the channel will not be deleted while this routine is 
running?
Obviously, the safest approach is to increment/decrement the reference count 
while using, but is that the necessary/preferred approach?


chan = ao2_bump(session->channel);
<<use chan>>
ao2_cleanup(chan);


Dan
-- 
_____________________________________________________________________
-- 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