drachtio / drachtio-server

A SIP call processing server that can be controlled via nodejs applications
https://drachtio.org
MIT License
233 stars 90 forks source link

Bug tcp invalid contact string #322

Open tinpotnick opened 8 months ago

tinpotnick commented 8 months ago

When using TCP and REGISTER (or SUBSCRIBE) there is a problem with the contact string.

When a REGISTER occurs in sip-dialog-controller.cpp :1028 a session is registered - and UDP is excluded but TCP isn't. When a new INVITE is then sent out (sometime after the REGISTER).

sip-dialog-controller.cpp:443 enters the if statement. I have left the UDP check - however, it is superfluous as NULL is always passed in. But, because of the above test m_pController->findTportForSubscription will return for UDP but if there it TCP and a REGISTER has happened then it will return the session and set the contact string to the local IP.

This fix uses the proto to correct the contact string - but I am not 100% certain this is the correct way to fix this.

resolves #319