As a UAC, place calls to a TCP endpoint using a hostname (bob@a.b.c;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);
Reproduce issue:
bob@a.b.c;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 theVia
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. When200 OK
is returned from the UAS and the dialog is created, transport is missing so isn't passed in when responding with theACK
.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.Drachtio log attached (Call-ID: 7d99d2c6-9671-123c-4c99-067aa53d80b5)
drachtio.log