[asterisk-dev] [Code Review] 4339: PJSIP: Prevent hung channel on a blind transfer

Mark Michelson reviewboard at asterisk.org
Wed Jan 14 17:27:10 CST 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4339/
-----------------------------------------------------------

Review request for Asterisk Developers.


Bugs: ASTERISK-24624
    https://issues.asterisk.org/jira/browse/ASTERISK-24624


Repository: Asterisk


Description
-------

During the process of a blind transfer, Asterisk sends NOTIFY requests to the transferring party to update them about the status of the outgoing call to the transfer target. If Asterisk sends a NOTIFY that indicates that the blind transfer has failed, some phones will respond by trying to send a reinvite to get themselves back into the call.

When this reinvite hits chan_pjsip, the session supplement in charge of channel allocation sees that the session on which the reinvite arrived has no channel, and therefore it creates a channel. The problem is that all other code that would do anything with this channel (like sending it into the dialplan) is specifically coded not to do anything on reinvites. So the created channel ends up going nowhere and hanging around forever.

With this patch, if the channel creation session supplement receives a reinvite and there is no channel on the session, this is treated as an error. The session is immediately terminated and the session supplement returns an error condition, indicating that no further session supplements should be called.

Additionally, res_pjsip_session's reinvite request handling module has been modified to short-circuit early if there is no channel. Otherwise, a reinvite with no SDP might cause a crash.


Diffs
-----

  /branches/13/res/res_pjsip_session.c 430625 
  /branches/13/channels/chan_pjsip.c 430625 

Diff: https://reviewboard.asterisk.org/r/4339/diff/


Testing
-------

Manual testing by me, Josh Colp, and Zane Conkle all show that this patch fixes the hung channel issue.


Thanks,

Mark Michelson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150114/8d5558d9/attachment-0001.html>


More information about the asterisk-dev mailing list