[sip-comm-dev] callHold - patch


hi all,

I would like to present to you my implementation of the Call Hold function
in SIP Communicator (based on the RFC3264, old RFC for the CallHold are not
I'm going to explain how I implemented it.

The main goal is to send into the same dialog a ReInvite request with a SDP
containing "a=sendonly" attribute and to receive a SDP answer with
"a=recvonly" attribute. During the exchange, I stop the streaming. For
instance, if A invites B to hold on a call, I stop the player and the
outgoing streams from A. I also stop the streams sent by B.
To retablish the call, i send a Reinvite that doesn't contain "a=sendonly"
attribute. The procedure is the opposite of putting on hold a call.

The methods which permit this function are PutOnHold(CallParticipant
participant) and PutOffHold(CallParticipant participant)

Explanation of the PutOnHold (Bob puts on Hold Alice)

- Create the SDP Description ( containing "a=sendonly" attribute)
- Send the ReInvite together with the SDP description to Alice
- Stop the player and outgoing streams

When Alice receives the request, she replies with the correct SDP
description (ProcessReInvite).

Bob receives the reply and sends an ack (ProcessReInviteOk).

The Call is now on hold.

Explanation of the PutOffHold

I think i don't need to explain how i did it. It's just the opposite
operation of the PutONhold. The most important thing that should be noticed
is the SDP description in the ReInvite request that does not contain the
"a=sendonly" attribute.

However, my implementation of this function isn't perfect. Indeed, the
method which processes the ReInvite request considers that a ReInvite is
always a CallHold request. As emil explained to me, the best thing to do is
to put listeners for a ReInvite Request.

I will do my best to make the change in the next few months. For the moment,
if you have any comment, feel free to answer the email :slight_smile:


Maxime & Thomas.

You can try the code with a button that I added on the CallPanel. The button
on the right permits to put On Hold the call. There's not control on this
button. so if you want to put on hold your contact Press one time this
button. To put off hold, press the same button once again.

callHold.patch (51.6 KB)