[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] ortp: changing remote party ip/port during one

From: Aymeric Moizard
Subject: Re: [Linphone-developers] ortp: changing remote party ip/port during one rtp session
Date: Wed, 20 May 2009 18:33:24 +0200 (CEST)

On Wed, 20 May 2009, Petr Kuba wrote:

Hello Aymeric,

What do you mean by "specific control"? And where do you use the code below?

I just meant you can overwrite the socket destination.

We need to handle the following scenario in a SIP call:

1) We send INVITE to a PBX.
2) PBX sends RINGING with session description, PBX is our RTP remote address
3) PBX sends OK with session description, called SIP phone is our RTP remote address

It means that first in (2) we start receiving RTP from PBX and then in (3) we need to change it and start receiving/sending from the SIP phone we called.

In (3) we call rtp_session_set_remote_addr() but then we do not receive any RTP packets from rtp_session_recvm_with_ts().

I would guess you are in "connected mode" and don't have "symmetric RTP"
enabled. In such case, - I didn't tested myself - it might be possible
than rebinding a new destination would fail:

You should debug what happens at the end of "rtp_session_set_remote_addr"
(the "try_connect" calls)

amsip -
osip2 -
eXosip2 -

Of course we use the same port as in (2) but I guess that it is responsibility of ortp to close the socket and open it again. For completeness, we are running on windows.

Thanks for help,

Aymeric Moizard wrote:
If you are looking for doing some symmetric RTP, there is an API to
allow symmetric RTP to be automatically handled.

In case, you want specific control, the code below is working for me:
memcpy(&session->rtp.rem_addr, &evt_data->ep->addr, evt_data->ep->addrlen);
but you have to make sure the socket is not bound to the old destination.

amsip -
osip2 -
eXosip2 -

  Petr Kuba, Project Manager
  OptimSys, s.r.o
  Tel: +420 541 143 065
  Fax: +420 541 143 066

reply via email to

[Prev in Thread] Current Thread [Next in Thread]