[OpenSIPS-Users] Call pickup
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Jun 12 09:55:09 CEST 2012
I guess any reply will do it...you may force an "487 Request Terminated"
, like the call from C (to do the pickup) was canceled :)
Regards
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 06/12/2012 05:57 AM, duane.larson at gmail.com wrote:
> Just tested the AVP method and that is a lot cleaner since CallerC's
> INVITE with the Replaces header gets canceled way before the
> failure_route sets the new branch to CallerC. This method also doesn't
> give me the issue that I was seeing in the last method where CallerA
> hung up and CallerC still thought CallerA was on the phone.
> Here is what I did
>
> RouteX
> if(search("^Replaces:.*;")){
> $var(Replacesb2b) = $(hdr(replaces){s.select,0,;});
> exec_msg("/usr/local/sbin/opensipsctl fifo t_uac_cancel
> $var(Replacesb2b) 2 > /tmp/test.txt");
>
> t_reply("404", "All Good"); <----------- Can you think of anything
> better to do here?
> exit;
> };
>
>
>
> Failure_Route
> if(avp_db_load("$ru/username","$avp(callpickupDest)"))
> {
> if ( $avp(callpickupDest) != null)
> {
> $rU = $avp(callpickupDest);
>
> alias_db_lookup("dbaliases" , "d");
> lookup("location");
>
> t_relay();
> exit;
> }
> }
>
>
> I'm trying to figure out if there is a better way of using the IF
> statement in RouteX instead of looking to see if there is a Replaces
> header. With Snom phones I can't put a prefix in front of the number
> or else it wouldn't be able to SUBSCRIBE for dialog updates and see if
> someone is calling the person. I'm sure there is some way. Might just
> need to add a prefix and when the SUBSCRIBE comes in strip it off.
>
> Thanks for the help Bogdan!
>
>
>
>
> On , duane.larson at gmail.com wrote:
> > Well using "get_dialog_info" works but on the Snom phone it won't
> ring since initially you are already on a call. Then the Call is
> canceled and you see that a second line is receiving a call. So with
> you select that second line you are connected to CallerA. Its a dirty
> hack but works. The only issue I see is when CallerA hangs up CallerC
> still thinks he is on the call and the call doesn't terminate. Will
> have to see whats going wrong there.
> >
> >
> >
> >
> >
> > I will still try the AVP way and see if that is a cleaner hack.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On , duane.larson at gmail.com wrote:
> >
> >
> > > Yeah it makes a little sense. I guess I would need to do a MySQL
> DB query and add the URI into an AVP.
> >
> >
> > >
> >
> >
> > > I found this post on Nabble and thought I might be able to use it
> >
> >
> > >
> http://opensips-open-sip-server.1449251.n2.nabble.com/NEW-exchanging-info-between-dialogs-td4975220.html#a5035451
> >
> >
> > >
> >
> >
> > > I will test to see if this works. Here is what I am thinking
> >
> >
> > >
> >
> >
> > > C sends a Call Pickup INVITE to PREFIX+A.
> >
> >
> > >
> >
> >
> > > OpenSIPS does the following when it gets this INVITE
> >
> >
> > > if(search("^Replaces:.*;")){
> >
> >
> > > # Grab the CallID in the Replaces Header so we can cancel the call
> to User B
> >
> >
> > > $var(Replacesb2b) = $(hdr(replaces){s.select,0,;});
> >
> >
> > > exec_msg("/usr/local/sbin/opensipsctl fifo t_uac_cancel
> $var(Replacesb2b) 2");
> >
> >
> > >
> >
> >
> > > # - Set the dialog variables so the B2B dialog can see who we need
> to fail the call over to
> >
> >
> > > store_dlg_value("CallPickupGrabber","$tU"); # - Set the dialog
> variables so the B2B dialog can see what CallID to Cancel
> >
> >
> > > store_dlg_value("CallPickupCallID","$ci");
> >
> >
> > > # - Set the value of the new URI the call needs to go to when it
> fails over
> >
> >
> > > store_dlg_value("CallPickupNewCallee","$fu"); };
> >
> >
> > >
> >
> >
> > >
> >
> >
> > > So a Cancel gets sent to B
> >
> >
> > >
> >
> >
> > > Now the first dialog, the B2B dialog, goes to failure route and we
> need to do the following within the failure_route
> >
> >
> > >
> >
> >
> > >
> if(get_dialog_info("CallPickupCallID","$var(x)","CallPickupGrabber","$fU")
> ) { $dlg_val("CancelCall") = $var(x)
> >
> >
> > > }
> >
> >
> > >
> >
> >
> > >
> if(get_dialog_info("CallPickupNewCallee","$var(y)","CallPickupGrabber","$fU")
> ) { $dlg_val("NewBranch") = $var(y)
> >
> >
> > > }
> >
> >
> > >
> >
> >
> > > # Cancel the call from Caller C who wanted to do a call pickup
> >
> >
> > > exec_msg("/usr/local/sbin/opensipsctl fifo t_uac_cancel
> $dlg_val("CancelCall") 1");
> >
> >
> > >
> >
> >
> > > # Set the new Branch call
> >
> >
> > > $ru = "sip:" + $dlg_val("NewBranch");
> >
> >
> > >
> >
> >
> > > t_relay();
> >
> >
> > > exit;
> >
> >
> > >
> >
> >
> > > So I would think that Caller C will press a softkey when he wants
> to do a CallPickup and by pressing the key the call should be canceled
> and then Caller C's phone will ring and he can then talk to Caller A
> >
> >
> > >
> >
> >
> > >
> >
> >
> > > Not sure if my logic is correct or if the get_dialog_info will
> solve my problems. Any thoughts on if you think this might work or not
> (I'll have to test later)?
> >
> >
> > >
> >
> >
> > >
> >
> >
> > >
> >
> >
> > >
> >
> >
> > > On , Bogdan-Andrei Iancu bogdan at opensips.org> wrote:
> >
> >
> > > > Well, this is indeed a missing piece - some kind of way to pass
> information between transactions - either directly append a new branch
> for another transaction (based on AVP matching ?), either a more
> generic way to add an AVP to another transaction.
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > Does it make sense ?
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > Regards,
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > Bogdan-Andrei Iancu
> >
> >
> > > >
> >
> >
> > > > OpenSIPS Founder and Developer
> >
> >
> > > >
> >
> >
> > > > http://www.opensips-solutions.com
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > On 06/11/2012 08:08 PM, duane.larson at gmail.com wrote:
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > I was thinking about this last night and with the Snom Phones I
> am able to do the following.
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > I know how to cancel the first call to the PhoneB and I am
> thinking that I can cancel the call that PhoneC does when it wants to
> do a Call Pickup. The thing I am not sure about is how on the first
> call to add a branch to PhoneCs URI. How can I pass PhoneC's URI info
> to the first call so that I can add the new branch?
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > > On , Bogdan-Andrei Iancu bogdan at opensips.org> wrote:
> >
> >
> > > >
> >
> >
> > > > > Hi Duane,
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > How I see this "call pickup" functionality:
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > 1) A calls to B, call is in ringing state
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > 2) C wants to pickup ringing call to B (this means C want to
> get to his phone the the call ringing from B).
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > 3) C dials PREFIX+B, indicating he wants to grab the call for B)
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > 4) the INVITE for (for the call from C) should add a new
> branch to C ( for the call to B) and to cancel the branch to B
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > 5) as a result, the call from C will be terminated and the
> call from A will be serially forked to C.
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > This is how I see this scenario.
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Now there are same small missing pieces to make this happen -
> the most important is first to decide if the manipulation over the
> first call (adding a new branch and terminating the ongoing branch)
> should be done from script or via MI.
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Regards,
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Bogdan-Andrei Iancu
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > OpenSIPS Founder and Developer
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > http://www.opensips-solutions.com
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > On 06/10/2012 03:44 AM, osiris123d wrote:
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Bogdan,
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > I'm trying to figure out how to get Call Pickup working since
> the PSTN
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > provider can't handle the Replaces: header. Here is my post here
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> http://opensips-open-sip-server.1449251.n2.nabble.com/B2B-with-Call-Pickup-td7580224.html
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > I see in this post you talk about using MI commands and the TM
> and Dialog
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > modules and the failure route to make this work. I think with
> the TM module
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > I can send a CANCEL to the original Callee but how would you
> make the call
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > then fail over to the Failure Route so I can send it to the
> next callee?
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > --
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/Call-pickup-tp7127393p7580251.html
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Sent from the OpenSIPS - Users mailing list archive at
> Nabble.com.
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > _______________________________________________
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Users mailing list
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > Users at lists.opensips.org
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > > >
> >
> >
> > > >
> >
> >
> > > >
> >
> >
> > > >
More information about the Users
mailing list