×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Sending and receiving RTP packet

    Hi,

    I am developing VOIP client and implementing last part of this on N95 device which is sending and receiving voice data over RTP using RTPSession framework.I'm enable to open and register session which is not tested yet because i need to send or receive packet on port for that.On both end i'm using my own implemted client on N95 devices.

    Please anyone like to share a peace of code and give me some clues how to implement that as there is no example shipped by Nokia for RTPSession.

    Here are some lines that i've coded and expected Send and Receive stream should be opened but it is not.

    TInetAddr localAddr = INET_ADDR( 10,1,7,124 );
    localAddr.SetPort( 30000 );

    TInetAddr remoteAddr = INET_ADDR( 10,1,7,114 );
    remoteAddr.SetPort( 30000 );

    //opening and registering a RTPSession ....

    iSession.OpenL( iSocketServer,localAddr,remoteAddr,iMaxRXSize,iConnection );

    iSession.PrivRegisterEventCallbackL(
    (TUint)(ERtpAnyEvent|ERtpNotOneShot /*|ERtpSessionFail|ERtpSessionEventEnd*/),
    &CRTPEngine::HandleRTPEvent,
    (TAny*)this);

    Trying to create a RRtpSendSource that doesn't work !!! Please correct me if i'm missing any step......

    iSendPacket = iSendSource.NewSendPacketL( 164 /*size of G711 codec payload */ );
    iSendPacket.SetPayloadType( 98 );

    //writing a payload that i got from Audio proxy server buffer and trying to send that buffer to other termianl over RTP.

    TDesC8& payload = iSendPacket.WritePayload();
    payload = aPayload;
    iSendPacket.Send();

    ///Callback function definition...
    void CRTPEngine::HandleRTPEvent( TAny* contextData, const TRtpEvent& aEvent )
    {

    CRTPEngine* rtpEngine = (CRTPEngine*) contextData;

    _LIT8( KDebugIN, "CRTPEngine::HandleRTPEvent IN" );
    rtpEngine->iObserver->WriteRTPLog( KDebugIN(), 0 );

    _LIT8( KDebugOUT, "CRTPEngine::HandleRTPEvent OUT" );
    rtpEngine->iObserver->WriteRTPLog( KDebugOUT(), 0 );


    }

    I'm wondering how to create send and receive Rtp sources on RTPSession!!!


    Thanks in advance,

    Haroon Azmat

  2. #2
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    Hi,

    RRtpSendSource iSendSource;
    RRtpSendPacket iSendPacket;

    this line crashes my application,is anybody knows hoe to create a send stream ,please share with me couple of line of code.

    iSendPacket = iSendSource.NewSendPacketLC( aPayloadSize );


    Thnaks in advance,

    Haroon Azmat

  3. #3
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    Hi,

    i've created output stream by calling RRtpSession function NewSendSourceL() which is not documented in SDK.If u look at rtp.h file u ll find out this function so it works fine.Now my problem is i'm sending packet to other terminal but not able to get events like ERtpSendSucceeded | ERtpSendFail.

    Any body has counter that kind of problem please let me know or second please make me sure that my method of opening and creating RRTPSession is write or wrong.

    Thanks in advance,

    Haroon Azmat

  4. #4
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    Hi,

    Anyone who has used RRtpSession framework please keep this thread rolling so other developers can take benifits out of it.

    Thanks inadvance,

    Haroon Azmat

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    4

    Re: Sending and receiving RTP packet

    Hello

    To send and receive RTP packet, please do the step 4,5 and 8.

    1. Open RTP

    iRtpApi = CRtpAPI::NewL( ..)
    iRtpApi->OpenL( ..);
    iRtpApi->StrartConnection( ..);

    2. CreateSession
    iRtpApi->CreateSessionL( .. );

    if RTCP is enabled

    iRtpApi->RegisterRtcpObserver( );

    if non-rtp packet will be received with the same port then
    iRtpApi->SetNonRTPDataObserver ( ...)

    3. Set Remote address
    iRtpApi->SetRemoteAddress( ..);

    4. CreateStream
    iRtpApi->CreateReceiveStreamL(..);
    iRtpApi->CreateTransmitStreamExtL(..);

    Use this function if ssrc is not specified
    iRtpApi->CreateTransmitStreamL(..)

    5.Start Session
    To start session, there must be one stream created already.
    If no receive stream created then the incoming packets will not be received
    iRtpApi->StartSession( aSessionId );

    6. Start Stream
    iRtpApi->StartSession( aSessionId );

    7. Remove Stream
    CloseStreamL(..);

    8. Send RTCP packet
    Set session bandwidth or rtcp fraction
    iRtpApi->SetRtcpParameters(..);
    iRtpApi->SendRtcpByePacket( .. );
    iRtpApi->SendRtcpAppPacket( .. );
    iRtpApi->SendRtcpSrPacket( .. );
    iRtpApi->SendRtcpRrPacket( .. );

    9 Suspend RTCP
    iRtpApi->SuspendRtcpSending( .. )

    10 Resum RTCP
    With autoSending parameter as ETrue.
    iRtpApi->SuspendRtcpSending(..)

    11. GetRTCP status
    iRtpApi->IsRtcpSendingSuspended( .. );

    12. Send NonRtpData
    some data can be send to same remote address with RTP
    iRtp->SendDataL( ..);

    13 Send Rtp Packet
    iRtpApi->SendRtpPacket( ..);

    14.Close session
    CloseSession(..);

    15. Close RTP
    delete iRtpApi;

    Br,

    Chuan

  6. #6
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    I'm bit confused as u mentioned me to use

    8. Send RTCP packet
    Set session bandwidth or rtcp fraction
    iRtpApi->SetRtcpParameters(..);
    iRtpApi->SendRtcpByePacket( .. );
    iRtpApi->SendRtcpAppPacket( .. );
    iRtpApi->SendRtcpSrPacket( .. );
    iRtpApi->SendRtcpRrPacket( .. );

    for sending RTP packet.But i'm not sending RTCP and i dont need to control RTP packet.SO Y i need these function.

    Second i'm using SendRtpPacket function but i'm getting -1 system wide err .Is anybody encounter same problem before.I've RTPApi session started at both ends on E65 phone and i'm sending G711 codec payload so why i'm getting this problem.

    Thanks in advance,
    haroon Azmat

  7. #7
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    Hi,

    Here is my code for sending RTP packet.RTP Session has been started successfully and as u mentioned i've created both output and input streams and register Rtp observer as well.

    TInt err = iRtpAPI->SendRtpPacket( iOutputStreamId, header, aPayloadData,status );

    I'm getting System wide error "ErrNotFound" please let me know what else i'm still missing.I'm intented to send RTP packet to other phone.

    Here is the code how i'm setting TRtpSendheader and other SendRtpPacket parameters.I hope this will help you in giving me clue.

    TTime currentTime;
    currentTime.UniversalTime();

    TTime beginningOfTime(
    MAKE_TINT64( KBeginningOfTimeHigh32bits,KBeginningOfTimeLow32bits ) );

    TTimeIntervalSeconds seconds;
    TInt nRet = currentTime.SecondsFrom( beginningOfTime,seconds );
    time_t time32 = seconds.Int();


    TRtpSendHeader header;
    TRequestStatus status;
    header.iTimestamp = time32;
    header.iPayloadType = payloadType;

    Last thing, i'm getting payload from APSServer which is part of my project and send this paylod to other devices for establishing a voice path between two phones.

    Thanks in advance,

    Haroon Azmat

  8. #8
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    50

    Re: Sending and receiving RTP packet

    I found the reason of this problem so now atleast i'm able to send RTP packet but somehow my receive callback is not call at remote end.

    I've a doubt regarding that. Should i need to start rtpapi session at both ends to receive and send RTP packets?


    Thanks in advance,

    Haroon Azmat

  9. #9
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    Thumbs up Re: Sending and receiving RTP packet

    HI, I just do same work like you ,where are you from?

    I want discuss some question with you !

    this is my msn:zzhehai@msn.com

    if you come from china ,welcome to join in QQ Group: 57184075

  10. #10
    Registered User
    Join Date
    May 2006
    Location
    Brazil
    Posts
    7

    Re: Sending and receiving RTP packet

    Quote Originally Posted by hazmat View Post
    I found the reason of this problem so now atleast i'm able to send RTP packet but somehow my receive callback is not call at remote end.
    Hi Azmat, what was the reason for your problem and how did you solve it? I'm having similar problems and maybe your solution can work for others too.

  11. #11
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    80

    Re: Sending and receiving RTP packet

    Hi if your Sending First time please Use this one
    User::NTickCount();
    after that you can call ..

Similar Threads

  1. simultaneous sending and receiving on socket
    By santosh shetty in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-02-07, 15:34
  2. TCP server packet receiving problem
    By raj_rr7 in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2007-07-12, 12:24
  3. Port number for sending and receiving SMS
    By pmramprasath in forum Mobile Java General
    Replies: 5
    Last Post: 2007-01-23, 08:48
  4. Sending and Receiving at the same time
    By berny_ in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2006-11-30, 11:26
  5. Sending Using L2cap sockets and Receiving Com Ports
    By satya3050 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-09-25, 05:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×