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

SIP over TCP + DNS #301

Open
two56 opened this issue Jul 5, 2023 · 0 comments
Open

SIP over TCP + DNS #301

two56 opened this issue Jul 5, 2023 · 0 comments

Comments

@two56
Copy link

two56 commented Jul 5, 2023

Reproduce issue:

  • As a UAC, place calls to a TCP endpoint using a hostname ([email protected];transport=tcp)

Behaviour:

Some calls are hung up due to the ACK not being recognised by the UAS (T1x64 timer firing), I believe this is down to the Via header having the wrong transport (UDP instead of TCP).

Once DNS has been resolved and cached, subsequent calls are successful until the cache times out.

As far as I can tell, the orq returned by sofia-sip, when creating a request and DNS has to be resolved, doesn't contain transport. When 200 OK is returned from the UAS and the dialog is created, transport is missing so isn't passed in when responding with the ACK.

I've put a small patch in to sip-dialog-controller.cpp to set the transport on the dialog if it's missing, which seems to fix the issue. Although I'm fairly sure it isn't the right thing to do.

diff --git a/src/sip-dialog-controller.cpp b/src/sip-dialog-controller.cpp
index 2642dcc8ca..ed544774dc 100644
--- a/src/sip-dialog-controller.cpp
+++ b/src/sip-dialog-controller.cpp
@@ -805,6 +805,9 @@ namespace drachtio {
                 addDialog( dlg ) ;
             }
             tport_t* tp = nta_outgoing_transport(orq);
+            if (!dlg->getTport()) {
+              dlg->setTport(tp);
+            }
             if (sip->sip_cseq->cs_method == sip_method_invite && sip->sip_status->st_status == 200 && tport_is_dgram(tp)) {
                 // for successful uac invites, we need to handle retransmits
                 m_timerDHandler.addInvite(orq);

Drachtio log attached (Call-ID: 7d99d2c6-9671-123c-4c99-067aa53d80b5)

drachtio.log

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