linphone-developers
[Top][All Lists]
Advanced

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

[Linphone-developers] Receiving RTP packets when none are being sent to


From: Shane Purtill
Subject: [Linphone-developers] Receiving RTP packets when none are being sent to me????
Date: Mon, 8 Jul 2002 16:01:55 +0100

Hi,

 

I am writing (or at least trying to J) write a voice mail server that will be interact with Linphone. To this end I am using some of the code from Linphone as a basis to start from. I can successfully setup a SIP connection/dialog between Linphone and my Server and get the info necessary to set up an RTP session between them. Initially I am just taking the received data and piping it straight back out again to the caller. This should lead to the caller hearing themselves with a half second lag or so. The following code SHOULD setup an RTP session and do what I have described above:

 

            ortp_init();                                                                                                          /*init the rtp library*/

            ortp_scheduler_init();                                                                                          /*not using the scheduler but init it anyway*/

 

            rtpsession = rtp_session_new(RTP_SESSION_SENDRECV);                                /*set up an RTP session that can both send and receive*/

            rtp_session_set_scheduling_mode(rtpsession, 0);                                                /* not scheduled */

            rtp_session_set_local_addr(rtpsession, locip4, locport);                                        /*Set local IP address and port*/

            rtp_session_set_remote_addr(rtpsession, remip4, remport);                                   /*Remote IP address and port*/

            rtp_session_set_payload_type(rtpsession, payload);                                             /*set the payload type*/

            rtp_session_set_jitter_compensation(rtpsession, jittcomp);                                    /*set jitter compensation e.g. 40*/

           

            tsinc = codinfo->fr_size/2;

           

            while(iocond != 0)/*loop receiving and sending*/

            {          

                        err = rtp_session_recv_with_ts(rtpsession,rtpdata,codinfo->dt_size,ts,&havemore);/*used to receive data over RTP*/

                       

                        err = rtp_session_send_with_ts(rtpsession,rtpdata,codinfo->dt_size,ts);/*used to send data over RTP*/

           

                        ts+=tsinc;

            }

           

 

AM I missing something blatantly obvious???? I have even tried using the blocking mode to see if it made any difference but it did not.

 

I do have audio working on my two machines as I can use Linphone to communicate between both machines and the audio is fine. The Server does not need audio anyway as it only works with audio from the network never the sound card. The Server does not yet use codecs, but for the purpose described above it should not need to unless there is some hidden logic they perform beyond encoding/decoding the audio.

 

I get “err” returned as 160 ALL the time. Even when the connection to the other end is severed, this continues to loop and tell me it has received 160 bytes. Why is this happening?? Surely it should drop to 0 at that stage.

 

Any help is REALLY REALLY appreciated,

 

Cheers,

 

Shane


reply via email to

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