Skip to content

SIPUserAgent does not send BYE under specific conditions. #1572

@thicsilva

Description

@thicsilva

After the SIPUserAgent makes an outgoing call and sends a CANCEL, if it answers an incoming call and hangs up, the BYE signal will not be sent. Example:

{
    SIPTransport aliceTransport = new SIPTransport();
    aliceTransport.AddSIPChannel(new SIPUDPChannel(IPAddress.Loopback, 0));
    var alice = new SIPUserAgent(aliceTransport, null, true);
    SIPServerUserAgent uas = null;
    alice.OnIncomingCall += (ua, req) => uas = ua.AcceptCall(req);
    SIPTransport bobTransport = new SIPTransport();
    bobTransport.AddSIPChannel(new SIPUDPChannel(IPAddress.Loopback, 0));
    SIPServerUserAgent uasBob = null;
    var bob = new SIPUserAgent(bobTransport, null, true);
    bob.OnIncomingCall += (ua, req) => uasBob = ua.AcceptCall(req);    
    _ = bob.Call(alice.ContactURI.ToString(), null, null, CreateMediaSession());
    await Task.Delay(500);
    bob.Cancel();
    await Task.Delay(500);
    _ = alice.Call(bob.ContactURI.ToString(), null, null, CreateMediaSession());
    await Task.Delay(500);
    _ = bob.Answer(uasBob, CreateMediaSession());
    await Task.Delay(500);
    bob.Hangup();
}

According to the example, after the Hangup, Bob and Alice should have their dialogues nullified, and they should no longer have an active call, right?
Probably what happens is that after the Cancel, the SIPClientUserAgent (m_uac) created in InitiateCallAsync, as well as the SIPCallDescriptor (m_callDescriptor), will not be cleared (a very simplistic view of the likely problem).
So when performing a Hangup, it will always attempt to Hangup the SIPClientUserAgent, whose Dialog is null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions