chan_pjsip: Incorporate channel reference count into transfer_refer().
authorDan Cropp <dan@amtelco.com>
Mon, 7 Dec 2020 22:59:51 +0000 (16:59 -0600)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Wed, 6 Jan 2021 16:45:41 +0000 (10:45 -0600)
commitffa87ecade121ee6db73e948d37190c898ad5813
tree723e809cdeea2b402d146155c42e9e36cc9146ab
parent4274a4a7dd64ef47f26713849404a0f87094cb0f
chan_pjsip: Incorporate channel reference count into transfer_refer().

Add channel reference count for PJSIP REFER. The call could be terminated
prior to the result of the transfer. In that scenario, when the SUBSCRIBE/NOTIFY
occurred several minutes later, it would attempt to access a session which was
no longer valid.  Terminate event subscription if pjsip_xfer_initiate() or
pjsip_xfer_send_request() fails in transfer_refer().

ASTERISK-29201 #close
Reported-by: Dan Cropp

Change-Id: I3fd92fd14b4e3844d3d7b0f60fe417a4df5f2435
channels/chan_pjsip.c