Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper Handling Of Branched/Forked Calls #11

Open
DBoag opened this issue May 22, 2023 · 0 comments
Open

Proper Handling Of Branched/Forked Calls #11

DBoag opened this issue May 22, 2023 · 0 comments

Comments

@DBoag
Copy link

DBoag commented May 22, 2023

Drachtio is unable to properly handle branched calls due to limitations in the Sophia SIP stack. I describe the issue below and have attached a Drachtio log with verbosity set to high.

Looking at figure 1 below, we are primarily concerned with the last 2 columns: RTCv2 kam01 (Kamailio) and RTCv2 dra01 (Drachtio).

figure1

The Kamailio box received one INVITE and forked it into the multiple INVITEs we see being sent to Drachtio starting at notation (1). Each of the INVITEs to Drachtio is essentially the same SIP payload, but with an added Via: header. Kamailio added these Via: headers with an incrementing final digit, with the first one starting at 1. In this example the top Via: header added is:
Via: SIP/2.0/UDP 10.155.248.52;branch=z9hG4bK0e3a.957c640f749512fb23422e1c88ba66b8.1

That first INVITE (1) is to an Android device which returns a "100 Trying" immediately as it's about to send a push notification to ring the device. The following INVITEs (2) all have their top Via: header set to the incrementing value, and the "100 Trying"s below that also contain the correct Via: headers to indicate which leg/dialogue/transaction (?) they are responding to.

Then when we get to notation (3), we can see Drachtio responding with a number of "410 Gone" packets. This is correct as those endpoints were no longer available, and those packets all contain the correct, corresponding Via: headers to identify the endpoints which were "Gone". So far so good - on with the call...

figure2

Looking at figure 2 above, We see Drachtio sending the "200 OK" when the endpoint answers. Immediately, we see Kamailio sending a CANCEL to end the call branch to the remaining ringing endpoint to stop it ringing as we expect. Note that this CANCEL only has one Via: header, but it is the correct one to identify the relevant branch - I'm not sure if that is relevant, but just mentioning it.

But now we see Drachtio respond with a "481 Transaction Does Not Exist" which we do not expect. Having looked at the source code, as best we can understand, Drachtio had "evaporated" all the branches of the call during the process of replying with the"200 OK", and this appears to be deep in the bowels of Sofia SIP.

Drachtio then sends a BYE which then tears down the whole call. Interestingly, this BYE does not contain any of the "incrementing" Via: headers, but that appears moot at this point as the call has effectively failed.

drachtio.log.zip

@DBoag DBoag changed the title Proper Handling in Branched/Forked Calls Proper Handling Of Branched/Forked Calls May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant