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

refer of 2 incoming call failed #817

Open
michelepra opened this issue May 11, 2023 · 2 comments
Open

refer of 2 incoming call failed #817

michelepra opened this issue May 11, 2023 · 2 comments

Comments

@michelepra
Copy link

michelepra commented May 11, 2023

When jssip build "Refer-to" header not considering rfc3515 (SIP) Refer Method

A REFER request MAY be placed outside the scope of a dialog created with an INVITE. REFER creates a dialog, and MAY be Record-Routed, hence MUST contain a single Contact header field value. REFERs occurring inside an existing dialog MUST follow the Route/Record- Route logic of that dialog.

RFC 3261 12.1.1. and RFC 3261 12.1.2. say how take "local tag" and "remote tag" for dialog and this is correctly implemented

The behaviour of this rfc mismatch is that refer of 2 incoming call failed (eg. in asterisk server)

Solution is to change "Refer-to" builder from

 if (options.replaces)
   {
     replaces = options.replaces._request.call_id;
     replaces += `;to-tag=${options.replaces._to_tag}`;
     replaces += `;from-tag=${options.replaces._from_tag}`;

     replaces = encodeURIComponent(replaces);
   }

to

  if (options.replaces)
   {
     if (options.replaces._dialog) 
     {
       replaces = options.replaces._dialog.id.call_id;
       replaces += `;to-tag=${options.replaces._dialog.id.remote_tag}`;
       replaces += `;from-tag=${options.replaces._dialog.id.local_tag}`;
     } else {
       replaces = options.replaces._request.call_id;
       replaces += `;to-tag=${options.replaces._to_tag}`;
       replaces += `;from-tag=${options.replaces._from_tag}`;
     }

     replaces = encodeURIComponent(replaces);
   }
@Karakoukie
Copy link

Hi
We got the same issue and this fix solved the problem.
Why this is not patched yet ? is there any problems with this fix ?

@jmillan
Copy link
Member

jmillan commented Jul 29, 2024

@michelepra or @Karakoukie , are you willing to submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants