[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Linphone-developers] oRTP question on RTP peer change
From: |
BOITEUX, Frederic |
Subject: |
[Linphone-developers] oRTP question on RTP peer change |
Date: |
Thu, 10 Mar 2016 18:26:35 +0000 |
Dear oRTP developpers,
I've tried to analyze an error raised by oRTP (version 0.23) with the following
scenario :
- On the same machine, an outgoing VoIP call is made to one local peer, then
another [local] one, then a third [local] one
- The RTP session of the outgoing call is bound successively to the first
peer's RTP, then the second, then the third, exchanging data a few seconds with
each ones.
- With the third peer, about one second after the session is updated, I get an
oRTP error :
Error receiving RTP packet (code: 111)
code 111 meaning "Connection refused" (ECONNREFUSED)
The difference which can matters between the first and second peers is that
the first peer closes its RTP session after our local call has turned to
second peer, but the second peer closes its RTP session a little before our
local call is going to the third peer. In this latter case, I receive a RTCP
BYE from the second peer, and surely I should do something on the local RTP
session to stop reading RTP packets it until a new peer is found ? is it a
good analyze ? have you any suggestion on how to do it ?
Trying to understand how this works, I'm puzzled with
rtp_session_set_remote_addr_full() function regarding to peer change :
In its last part, this function test with can_connect(session) if the socket
can be connected, and if so, set the bit masks RTP_SOCKET_CONNECTED and
RTCP_SOCKET_CONNECTED, and if it *doesn't*, it checks if these flags are set
(but how could they be set ?) and reset the socket connection with a connect()
with AF_UNSPEC family :
if (can_connect(session)){
if (try_connect(session->rtp.socket,(struct
sockaddr*)&session->rtp.rem_addr,session->rtp.rem_addrlen, session))
session->flags|=RTP_SOCKET_CONNECTED;
if (session->rtcp.socket>=0){
if (try_connect(session->rtcp.socket,(struct
sockaddr*)&session->rtcp.rem_addr,session->rtcp.rem_addrlen, session))
session->flags|=RTCP_SOCKET_CONNECTED;
}
}else if (session->flags & RTP_SOCKET_CONNECTED){
/*must dissolve association done by connect().
See connect(2) manpage*/
struct sockaddr sa;
sa.sa_family=AF_UNSPEC;
if (connect(session->rtp.socket,&sa,sizeof(sa))<0){
ortp_sess_error(session, "Cannot dissolve connect() association
for rtp socket: %s", getSocketError());
}
if (connect(session->rtcp.socket,&sa,sizeof(sa))<0){
ortp_sess_error(session, "Cannot dissolve connect() association
for rtcp socket: %s", getSocketError());
}
session->flags&=~RTP_SOCKET_CONNECTED;
session->flags&=~RTCP_SOCKET_CONNECTED;
}
I would have do something like :
if (can_connect(session)) {
if (session->flags & RTP_SOCKET_CONNECTED) {
// dissolve association...
}
// do try_connect() ...
}
With regards,
Fred.
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Linphone-developers] oRTP question on RTP peer change,
BOITEUX, Frederic <=