[Asterisk-code-review] chan sip: Attempt ast do pickup in handle invite replaces (asterisk[16])

George Joseph asteriskteam at digium.com
Mon Nov 5 09:32:35 CST 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10451 )

Change subject: chan_sip:  Attempt ast_do_pickup in handle_invite_replaces
......................................................................

chan_sip:  Attempt ast_do_pickup in handle_invite_replaces

When a call pickup is performed using and invite with replaces header
the ast_do_pickup method is attempted and a PICKUP stasis message is sent.

ASTERISK-28081 #close
Reported-by: Luit van Drongelen

Change-Id: Ieb1442027a3ce6ae55faca47bc095e53972f947a
---
M channels/chan_sip.c
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c54789a..2693e5f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -25903,7 +25903,13 @@
 		}
 		ao2_ref(bridge, -1);
 	} else {
-		ast_channel_move(replaces_chan, c);
+		int pickedup;
+		ast_channel_lock(replaces_chan);
+		pickedup = ast_can_pickup(replaces_chan) && !ast_do_pickup(c, replaces_chan);
+		ast_channel_unlock(replaces_chan);
+		if (!pickedup) {
+			ast_channel_move(replaces_chan, c);
+		}
 		ast_hangup(c);
 	}
 	ast_channel_unref(c);

-- 
To view, visit https://gerrit.asterisk.org/10451
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb1442027a3ce6ae55faca47bc095e53972f947a
Gerrit-Change-Number: 10451
Gerrit-PatchSet: 2
Gerrit-Owner: Jasper Hafkenscheid <jasper.hafkenscheid at wearespindle.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181105/27e8da07/attachment.html>


More information about the asterisk-code-review mailing list