linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] oRTP pb during SIP refresh


From: Simon Morlat
Subject: Re: [Linphone-developers] oRTP pb during SIP refresh
Date: Wed, 27 Jan 2010 16:26:20 +0100

Le lundi 25 janvier 2010 à 15:06 +0100, Frédérik Rouleau a écrit :
> Hi Simon,
> 
> Sorry for the delay but I had difficulties to access the new git repo
> due to firewall restrictions.
Sorry... You're right, now ortp and mediastreamer2 do not have anymore
git/http access...

> I have seen your patch and it seems ok as it allows to temporary
> enable fast rtp flow switch.
Great. Thank you for your feedback.

Simon

> 
> Regards,
> 
> 
> 2010/1/21 Frédérik Rouleau <address@hidden>
>         Hi Simon,
>         
>         I had probably not explain clearfuly my patch. You set the
>         flag session->ssrc_change_pending to TRUE by a function to
>         define when you receive the SIP refresh. Then when the RTP
>         source change, the flag is reset to FALSE thus reenabling all
>         the SSRC control oRTP is doing.
>         
>                     }else if (session->ssrc_change_pending){
>                         session->ssrc_change_pending=FALSE;
>         
>                         rtp_session_set_flag(session,
>         RTP_SESSION_RECV_SYNC);
>         
>         
>         So if you do not set ssrc_change_pending flag, it does not
>         change anything. If you set it, it just enable ONE fast SSRC
>         change.
>         
>         I hope my explanation is better this time.
>         
>         Regards,
>         
>         
>         2010/1/21 Simon Morlat <address@hidden>
>         
>         
>                 Hi Frederik,
>                 
>                 I understand the problem, and I agree it's a bug for
>                 many people.
>                 Now the problem with your patch is that it simply
>                 disables the RTP
>                 session locking feature. You could rather remove the
>                 entire 20-30 lines
>                 of code.
>                 I cannot accept a patch that removes a feature that
>                 was required by
>                 other people in the past.
>                 A better approach (to me) would to render the
>                 SSRC_CHANGED_THRESHOLD
>                 configurable, through an api call, so that we can meet
>                 everybody's
>                 requirements.
>                 In linphone you have
>                 
> rtp_session_signal_connect(rtpr,"ssrc_changed",(RtpCallback)rtp_session_resync,(long)NULL);
>                 so that when the ssrc change is notified, the SYNC
>                 flag is set again.
>                 So if you set the SSRC changed threshold lets say to
>                 0, it will work
>                 perfectly.
>                 
>                 I just commited to git a small patch to implement
>                 this:
>                 
>                 Author: Simon Morlat <address@hidden>
>                  2010-01-21 11:49:14
>                 Committer: Simon Morlat <address@hidden>
>                  2010-01-21 11:49:14
>                 Parent: 5679b02d5a4cf4de680a4bf37ab620935041d2d1 (add
>                 missing
>                 declarations in linphonecore.h)
>                 Branches: master, remotes/origin/master,
>                 remotes/private/master
>                 Follows:
>                 Precedes:
>                 
>                    set ssrc_changed_thres to 0
>                 
>                 
>                 Simon
>                 
>                 
>                 
>                 Le jeudi 21 janvier 2010 à 10:22 +0100, Frédérik
>                 Rouleau a écrit :
>                 
>                 > Hi Simon,
>                 >
>                 > I cannot see why my patch is a problem. You are
>                 still locked to a
>                 > stream, it just enable to switch faster on a new
>                 stream when you ask
>                 > oRTP to.
>                 > Linphone has the same problem, at each refresh, you
>                 have a 1 second
>                 > silence (50 * 20ms). The gateway is a Cirpack, the
>                 same equipement
>                 > used by Free operator in France. Might be difficult
>                 to have any
>                 > upgrade on that side !!!
>                 > You also have this problem during ringing, when you
>                 answer the call,
>                 > the RTP stream is reset by the Cirpack, then you
>                 also have a 1 s
>                 > silence !
>                 > I am looking for a way to solve this issues. If you
>                 have better
>                 > suggestion, I am open to any proposal.
>                 >
>                 > Regards,
>                 >
>                 > Frédérik
>                 >
>                 >
>                 > 2010/1/19 Simon Morlat <address@hidden>
>                 >         Hi Frédérik,
>                 >
>                 >         I understand this change solves your
>                 problem, but it is not
>                 >         really
>                 >         compatible with what this SSRC checking was
>                 done for.
>                 >         Initially the goal was to lock on the
>                 initial stream (and
>                 >         discard any
>                 >         others), and when one stream appears to be
>                 active (50 packet
>                 >         received
>                 >         without any other SSRC in between), we lock
>                 to this new
>                 >         stream.
>                 >         I think the gateway should not reinit the
>                 seq and timestamp
>                 >         numbers.
>                 >
>                 >         RFC4028 was implemented in linphone quite
>                 recently. If you
>                 >         have both
>                 >         last svn/git of linphone and last svn of
>                 eXosip2, and have
>                 >         use_session_timers=1 in the [sip] section of
>                 the .linphonerc
>                 >         config
>                 >         file, they are enabled.
>                 >
>                 >         Try it, this may workaround the gateway
>                 behaviour.
>                 >
>                 >         Simon
>                 >
>                 >         Le mardi 12 janvier 2010 à 16:03 +0100,
>                 Frédérik Rouleau a
>                 >         écrit :
>                 >
>                 >         > Hello all,
>                 >         >
>                 >         > I am using oRTP and a SIP gateway which
>                 support SIP REFRESH
>                 >         (RFC
>                 >         > 4028). So at a fixed interval (600 s) I
>                 receive a SIP UPDATE
>                 >         but the
>                 >         > gateway also reinit the SSRC et seq number
>                 of the RTP flow.
>                 >         > The problem is that oRTP waits 1 second
>                 before it sends
>                 >         SSRC_CHANGED
>                 >         > message and during that ime I am loosing
>                 RTP paquets.
>                 >         Looking into the
>                 >         > code shows that there is a constant
>                 SSRC_CHANGED_THRESHOLD
>                 >         set at 50
>                 >         > setting this delay.
>                 >         >
>                 >         > Reducing the threshold might have some
>                 side effects but can
>                 >         we add a
>                 >         > kind of SSRC_change_pending state which
>                 set the flag
>                 >         > RTP_SESSION_RECV_SYNC on the first SSRC
>                 change paquet. for
>                 >         example the
>                 >         > rtp_parse code will look like:
>                 >         >
>                 >         >             if
>                 >
>                 (session->inc_same_ssrc_count>SSRC_CHANGED_THRESHOLD){
>                 >         >
>                 >         >                 /* store the sender rtp
>                 address to do
>                 >         symmetric RTP */
>                 >         >                 if (!
>                 session->use_connect){
>                 >         >                     if
>                 (session->rtp.socket>0 &&
>                 >         > session->symmetric_rtp){
>                 >         >                         /* store the
>                 sender rtp address to
>                 >         do
>                 >         > symmetric RTP */
>                 >         >
>                 >         memcpy(&session->rtp.rem_addr,addr,addrlen);
>                 >         >
>                 session->rtp.rem_addrlen=addrlen;
>                 >         >                     }
>                 >         >                 }
>                 >         >                 session->rtp.rcv_last_ts =
>                 rtp->timestamp;
>                 >         >
>                 session->rcv.ssrc=rtp->ssrc;
>                 >         >
>                 >
>                 rtp_signal_table_emit(&session->on_ssrc_changed);
>                 >         >             }else if
>                 (session->ssrc_change_pending){
>                 >         >
>                 session->ssrc_change_pending=FALSE;
>                 >         >
>                 rtp_session_set_flag(session,
>                 >         RTP_SESSION_RECV_SYNC);
>                 >         >             }else{
>                 >         >                 /*discard the packet*/
>                 >         >                 ortp_debug("Receiving
>                 packet with unknown
>                 >         ssrc.");
>                 >         >                 stats->bad++;
>                 >         >                 ortp_global_stats.bad++;
>                 >         >                 freemsg(mp);
>                 >         >                 return;
>                 >         >             }
>                 >         >
>                 >         > What do you think about it ? If you agree
>                 I can make changes
>                 >         and
>                 >         > propose a patch.
>                 >         >
>                 >         > Regards,
>                 >         >
>                 >         >
>                 >
>                 >         >
>                 _______________________________________________
>                 >         > Linphone-developers mailing list
>                 >         > address@hidden
>                 >         >
>                 http://lists.nongnu.org/mailman/listinfo/linphone-developers
>                 >
>                 >
>                 >
>                 
>                 
>                 
>         
> 






reply via email to

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