Sip over udp or tcp?

i am most concerned about call quality and i don’t know if udp or tcp is better. i am most interested in having consistently reliable call quality. would tcp help?

Unless you are using SIP on a mobile phone VoIP traffic is best left as UDP for both server load and call quality reasons. If you want the the long story simply google “tcp vs udp SIP”

If you want to talk to Micro$oft you will need TCP. If you use T38 it will work better on TCP. As dcitelcom says, connectionless UDP sessions to your cellphone will kill your battery quick. TCP is more robust on a poor network for maintaining the calls, I suggest you enable both but prefer UDP. . .

I think what is more important is SIP is a signalling protocol so how it is transpoeted has no bearing on voice quality.

The bearer (voice or video and who knows in the future) traffic uses RTP. RTP is a UDP protocol. Retransmitting voice via TCP would be a mess. The value of a voice packet is less than zero if it is delayed by retransmission. The out of order packet arrival would create tremendous jitter. UDP is designed for media.

SIP is a Protocol to Initiate a Session, it is designed for both now and the future, as Scott says and you are restricting yourself to voice or other lossable data streams , then UDP is your best choice, sessions carrying data such as FAXes or documents or other where lost or out of order data makes a mess of things are better served by a ‘non-connectionless’ protocol.

The overhead of TCP over UDP for SIP itself is negligible, but if you restrict yourself to UDP then some connections ( to M$ for example) will unnecessarily just fail.

Particularly with VOIP to cell phones, SIP over UDP sets an unnecessary requirement for the SIP connection (registration) to be constantly ‘paged’ by the often ‘flaky’ cell phone end, hence the unnecessary battery usage, the payload will of course generally be negotiated by the SIP session to use RTP for voice.

Probably this is all specious as Asterisk only does a subset of SIP, but in the future, who knows :wink:

UDP ismostly suited for simple processs that requires simple request-response communication because it is unreliable and connectionless protocol.UDP