RTP format was not set using the set_payload() function which
caused the clock rate to be 0. This in turn caused packets to appear
as duplicate or late by even minutes.
MinGW seems to employ some very aggressive optimizations that
sometimes create invalid packets because both Start and End
flags are set simultaneously.
This fixes the problem where an intra frame seems to be dropped
every now and then. Nothing was actually dropped but kvzRTP
received an invalid packet and thus discarded the whole frame
To be honest, I have no idea why this worked but it did anyway.
Let user create as many sessions as wanted with the same IP.
kvzRTP really does not care how many sessions with the same IP is
going on so forcing only one session per IP made no sense.
Now, however, the burden of releasing the session object is on the
caller when the application exits.
If the receiver is not listening to the port we're sending packets to,
we receive an ICMP Port Unreachable message to our socket which causes
recvfrom() to fail when it's called the next time. By ignoring these
messages we can continue the session
RTCP/HQ configuration is still missing from the examples because
I have yet to figure out how to integrate proper configuration or
RTCP to the new architecture
The initial idea was to integrate Crypto++ to kvzRTP to make usage
very easy but as it turns out, the compilation of that library is quite
complex so it's better to use the Makefiles they provide.
This means that kvzRTP shall have one extra dependency IF application
wishes to use SRTP/ZRTP: Crypto++. The compilation and linking should
be quite straight-forward and if application wants to use SRTP/ZRTP
it must make the decision when kvzRTP is compiled by providing
-D__RTP_CRYPTO__ flag for the compiler and by adding -lcryptopp to
link list of the application.
The chances that ZRTP is enabled are quite high and because those
messages are received to the same socket as media, the error messages
would likely flood the log so better turn them off.
Now for each call (or IP) there will be a separate session which
shall contain one or more multimedia streams. Each session has a
single ZRTP object and each multimedia session shall have a single
socket which both the sender and receiver use to enable hole punching
on all platforms.
Each multimedia stream shall also have a single SRTP instance which
derives keys from the common ZRTP session.
The previous architectural design was starting show its limitations,
one of the most limiting factor being that readers and writers had
their own connection objects which caused some problems with hole
punching.
This is the first commit of a whole new architecture where the top
object is RTP session which contains media streams which in turn contain
an RTP sender and a receiver. This design choice allows the kvzRTP to use
one socket for both the receiver and the sender and thus mitigates the
hole punching problem that appears on Windows.
It is highly likely that an invalid fragment will be received so
stopping the receiver after that and restarting the call after each
invalid fragment is very user-hostile