[Devel] Re: rtpproxy code - sendto call

Marco Holmer holmer at comdasys.com
Mon Mar 6 18:34:24 CET 2006


Hi Norman,

Oh, I was working on an older release. The correct line numbers of the two 
sendto calls for the latest CVS revision (1.33) are
1263 and 1425

Yes, the very first call to sendto (in line 350) inside the macro responds to 
the SER when communication between SER and rtpproxy runs via UDP instead of 
standard local unix socket.

I am wondering about the two other calls
...
             for (k = (dmode && len < LBR_THRS) ? 2 : 1; k > 0; k--) {
/*[1263]*/  sendto(sp->fds[sidx], sp->rtps[sidx]->buf, len, 0,
                   sp->addr[sidx], SA_LEN(sp->addr[sidx]));
             }
...
and
...
                for (i = (dmode && len < LBR_THRS) ? 2 : 1; i > 0; i--) {
/*[1425]*/   sendto(sp->fds[sidx], buf, len, 0, sp->addr[sidx],
                        SA_LEN(sp->addr[sidx]));
                }
...

I'm testing a modified version here with debug outputs and for a simple call 
(that is phone call) the code of the first "sendto" gets never executed.
So that is actually what I am wondering about.
The second call is the "worker", that really transports the RTP packets.
The first call must be good for something though but I cannot work that out 
just by reading the code.
It sends the "sp->rtps[sidx]->buf" buffer which gets filled (at least the 
payload part) by a "read" inside "rtp_server_get" in file rtp_server.c
It depends on the variable "rtp_nsessions" to be greater than zero to enter in 
the whole block and I don't understand when this happens.
So I would be happy if anyone could come up with any hint about that!

regards,
Marco


On Monday 06 March 2006 15:27, you wrote:
> Hi Marco,
>
> I'm not very familiar with the rtpproxy sources, but have been trying to
> learn more about them.
>
> While I found a couple of "sendto" calls, neither matched the line
> numbers in your post.  I just downloaded the most current CVS version.
>
> It appears that the first "sendto" is sending data through one of the
> dynamically assigned sockets.  This is probably the communications
> between, a user end-point and the proxy.
>
> The second "sendto" is the socket connection to OpenSER.
>
>
> ...
> sendto(sp->fds[sidx], sp->rtps[sidx]->buf, len, 0, sp->addr[sidx],
> SA_LEN(sp->addr[sidx]));
> ...
> while (sendto(controlfd, buf, len, 0, sstosa(&raddr),  rlen) == -1 &&
> errno == ENOBUFS);
> ...
>
>
>
> Hope this helps.  If anyone has more wisdom or comments (or
> corrections), please post them.
>
> Regards,
> Norm
>
> Marco Holmer wrote:
> > Hi all,
> >
> > I'm currently working on the rtpproxy trying to integrate SRTP.
> > Is someone on this list familiar with the sources of it?
> > I'm trying to find out about the two sendto calls on the lines 1244 and
> > 1405 of main.c.
> > Can anyone shed some light on what exactly the two calls do? Why are
> > there two (ok, it does not seem to be for RTP and RTCP resp.) and what do
> > they do? Pointing to some other ressource like documentation or  a forum
> > or anything is very welcome, too.
> >
> > thanks,
> > Marco
> >
> > _______________________________________________
> > Devel mailing list
> > Devel at openser.org
> > http://openser.org/cgi-bin/mailman/listinfo/devel



More information about the Devel mailing list