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

[SEMS] Missing to tag in outgoing PRACK (181) #181

Closed
denyspozniak opened this issue Apr 13, 2022 · 26 comments
Closed

[SEMS] Missing to tag in outgoing PRACK (181) #181

denyspozniak opened this issue Apr 13, 2022 · 26 comments

Comments

@denyspozniak
Copy link
Contributor

Hello!

I would like to ask for help in explaining why this commit does not take into account the response code 181?

if (((reply.code == 100) || (reply.code == 181) || (reply.code == 182))

96ea442#diff-662a586075af062e252bef12fdb1f16a7b2fd6b40eba3083d43aa19263b94e5cR370

I stumbled upon this problem again: [SEMS] Missing to tag in outgoing PRACK #100:

image

@dmitry-sinina
Copy link

dmitry-sinina commented Apr 25, 2022

All these PRACK/to-tag problems caused by f931ab7 that broke state machine. It is not clear why exemption for some responses was added there.

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022

So we need to revert f931ab7. OK?

@dmitry-sinina
Copy link

@juha-h looks like you tried to fix something by this commit(at least from comment "Do not go to Early state if To tag can still change. // Otherwise reply check will fail") so may be this something should be fixed in other way. Could you remember why this commit was added?

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@denyspozniak
Copy link
Contributor Author

@juha-h

Was there to tag in the example call shown above?

image

@dmitry-sinina
Copy link

Regarding 181, it is sent by the server, not by the UAS and thus to tag
can change. Was there to tag in the example call shown above?

There is no difference between UAS and server from SIP protocol point of view. Actually UAS and UAC are terms related to initiator of SIP transaction and responder so server is same UAS + UAC as end-user SIP phone - because both able to initiate transactions and respond on them

Is it according to the standards, to send PRACK before final response
has arrived?

This is why PRACK exists, to acknowledge receiving of provisioning replies.

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@dmitry-sinina
Copy link

dmitry-sinina commented Apr 25, 2022

could you explain this "possible change of to-tag in the final response" case? Do you mean case with call forking when multiple early-dialogs are possible?

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@dmitry-sinina
Copy link

In this case SEMS have to handle multiple early-dialogs for call leg in same time(at least to be able support 100rel), I can't say exactly right now, but I think there is no such feature, so it should be fixed by implementing multiple early-dialogs support.

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022 via email

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022

Try with this patch:

*** /usr/src/orig/sems/core/AmSipDialog.cpp	2021-11-14 13:22:22.183742473 +0200
--- AmSipDialog.cpp	2022-04-25 14:33:40.470191108 +0300
***************
*** 371,377 ****
      case Proceeding:
        if(reply.code < 200){
  	// Do not go to Early state if reply did not come from an UAS
! 	if (((reply.code == 100) || (reply.code == 181) || (reply.code == 182))
  	    || reply.to_tag.empty())
  	  setStatus(Proceeding);
  	else {
--- 371,378 ----
      case Proceeding:
        if(reply.code < 200){
  	// Do not go to Early state if reply did not come from an UAS
! 	if (((reply.code == 100 || reply.code == 181 || reply.code == 182)
! 	     && reply.rseq == 0)
  	    || reply.to_tag.empty())
  	  setStatus(Proceeding);
  	else {

@dmitry-sinina
Copy link

dmitry-sinina commented Apr 25, 2022

There are lot other problems were introduced by f931ab7 - for example UPDATE request construction, routeset changes will not be applied. Right way - rollback it and investigate why second instance of AmSipDialog is not created when response with other to-tag received.

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022

Rolled back commit f931ab7 due to several issues (including this one). Test and close if prack now has to tag.

@AlexAT
Copy link
Contributor

AlexAT commented Apr 25, 2022

@dmitry-sinina Thanks for noticing it in #183
Reverting this one actually may help, I'll try building with this commit reverted and tell.
Thanks!

@dmitry-sinina
Copy link

I think problem from #176 also related to f931ab7

@juha-h
Copy link
Contributor

juha-h commented Apr 25, 2022

I think problem from #176 also related to f931ab7

Please test if that is the case.

@denyspozniak
Copy link
Contributor Author

Made some basic tests with the latest build from the master, and the problem with the absence of the to tag in the outgoing PRACK is gone. I need some more time to test the rest of the functionality.

@juha-h
Copy link
Contributor

juha-h commented Apr 26, 2022 via email

@AlexAT
Copy link
Contributor

AlexAT commented Apr 27, 2022

I can as well confirm this reversal fixes PRACK for 181 responses.
Continuing runtime testing as well to make sure it doesn't break anything visible :)

@juha-h
Copy link
Contributor

juha-h commented Apr 27, 2022

Good. Should we create a new branch 1.6.0? Latest commit to 1.5.0 was done in 2014.

@juha-h
Copy link
Contributor

juha-h commented Apr 27, 2022

There was lots of stale branches, which I deleted. Now only master is remaining. Since rpm has version 1.7.0 and debian has 1.7.0-dev, I'll create new branch 1,7.0. Bug fixes should go to that and new features to master.

@juha-h
Copy link
Contributor

juha-h commented Apr 28, 2022

Re-open if new problems occur.

@juha-h juha-h closed this as completed Apr 28, 2022
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

4 participants