×

Discussion Board

Results 1 to 6 of 6

Thread: Sip Invite

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    18

    Sip Invite

    Hi all!

    I try to create an INVITE dialog with SIP plugin for Series60 v2.1. Here's how I do it:

    a. Phone A sends an INVITE request with sdp content.
    b. Phone B sends an OK response with altered sdp content (accepted media selected)
    c. Phone A sends an ACK. But at this point Phone B gets a SIP -33 error (ErrorOccured(-33) gets called) , and no dialog is created. What could be a problem? How can I figure out what SIP -33 means? (I don't think it is a system wide error code because in Symbian it would mean KErrTimedOut, but I am pretty sure it has nothing to do with timeout)

    I also tried it without SDP content, no success.
    Here's my code:

    ///////////////////SENDING INVITE
    CSIPAddress* toAddress = CSIPAddress::DecodeL(aBuddyAddr8);
    CSIPToHeader* toHeader = CSIPToHeader::NewL(toAddress);
    // and construct CSIPInviteDialogAssoc by using
    // from- and toHeaders:
    CSIPInviteDialogAssoc* inviteDialogAssoc =
    CSIPInviteDialogAssoc::NewL(*iConnection, toHeader, *iProfile);
    iSIPClientTransaction = inviteDialogAssoc->SendInviteL(/*msgElements*/);


    ///////////////////RECEIVING INVITE, RESPONSE WITH OK
    void CSIPEngine::IncomingRequest (CSIPServerTransaction* aTransaction)
    {
    if (aTransaction->Type() == CSIPTransactionBase::EINVITE)
    {
    CSIPResponseElements* response;
    response= CSIPResponseElements::NewL(200, _L8("OK"));
    aTransaction->SendResponseL(response);
    }



    /////////////////////RECEIVE THE RESPONSE, SEND ACK
    void CSIPEngine::IncomingResponse (CSIPClientTransaction& aTransaction, CSIPDialogAssocBase& aDialogAssoc)
    {
    if (resp->StatusCode() == 200)
    {
    // Send ACK message:
    iSIPInviteDialogAssoc->SendAckL(aTransaction);
    InviteCompleted(aTransaction);
    }
    }


    Thank you very much
    Kristof

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    Error number like -33 seems to be one of the "system wide" errors and not specific to SIP stuff...
    So I guess it can be related to sockets, where -33 is KErrTimeOut.

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    11
    When writing my application I have the very same problem with the ACK proccessing... instead of launching the IncomingRequest (CSIPServerTransaction* aTransaction, CSIPDialog& /*aSIPDialog*/) callback function, I always see the ErrorOccured (TInt aError, CSIPTransactionBase& aTransaction) function getting called, saying I have a -33 (KErrTimeOut) error ( I don´t think it has anything to do with this either).

    If you find (or already found ) the solution to this problem please let me know.. I´m going crazy trying to work this out!!

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    18
    There IS a solution :)


    if (aTransaction->Type() == CSIPTransactionBase::EINVITE)
    {
    //Answer immediately with 180 Ringing

    //NEXT LINE IS VERY IMPORTANT!!! IT IS THE SOLUTION TO -33 ERROR
    iSIPInviteDialogAssoc=CSIPInviteDialogAssoc::NewL(*aTransaction);

    CSIPResponseElements* responseRinging;
    responseRinging= CSIPResponseElements::NewL(180, _L8("Ringing"));
    aTransaction->SendResponseL(responseRinging);


    //Now handle the request correctly
    TBuf8<100> *senderAddr=new TBuf8<100>;
    const CSIPRequestElements *reqElem = aTransaction->RequestElements();
    const CSIPMessageElements& cSIPMessageElements=reqElem->MessageElements();


    //Get SDP from content
    //DANGER: crashes if no content exists
    TBuf8<100000> *content=new TBuf8<100000>;
    *content=cSIPMessageElements.Content();

    //Process SDP information here
    //...


    CSIPResponseElements* response;
    if (isAcceptableMedia) response= CSIPResponseElements::NewL(200, _L8("OK"));
    else response= CSIPResponseElements::NewL(405, _L8("Not Acceptable"));

    CSIPContentTypeHeader* contentType = CSIPContentTypeHeader::NewL(_L8("application"),_L8("sdp"));
    CSIPMessageElements &msgElements = response->MessageElements();//CSIPMessageElements::NewL();
    msgElements.SetContentL(sdpBuffer,contentType);

    aTransaction->SendResponseL(response);
    }

    delete aTransaction;
    }


    Hope it helps. My code is working now, so if you can't get yours to work, feel free ask!

    I answered at once when I got informed of your post. However somehow this was weeks after you posted it (see the dates). So this informing system does not work very well, so if you want to contact me, do it through my email address. It is faster.

    Kristof
    Last edited by aczelkri; 2004-10-27 at 13:33.

  5. #5
    Registered User
    Join Date
    Oct 2004
    Posts
    11
    Bless You Kristof!!!

    The line:

    //NEXT LINE IS VERY IMPORTANT!!! IT IS THE SOLUTION TO -33 ERROR
    iSIPInviteDialogAssoc=CSIPInviteDialogAssoc::NewL(*aTransaction);

    was the thing I was missing and as soon as I included it in my code I finally got the "ACK Received!" message I was so desperately after.

    You wouldn´t happen to know why this has to be done like that , would you? I went over the sample code and documentation time and again I didn´t see anything of the kind... It´s weird that you have to "create" a new association if that ACK is supposed to belong to the same INVITE procedure.

    Thank you very much once again.. and be sure I´ll contact you if I come across any more problems with this SIP stack (didn´t add any SDP content yet..that´s my next step now that I know how to engage in a communication)

  6. #6
    Registered User
    Join Date
    Apr 2003
    Posts
    18
    This may be because on Side A you have a CSIPInviteDialogAssoc object - you yourself created it. But on side B you don't. You need to create it somehow.

    I can't recall where I found this solution. I browsed forum nokia for SIP guides and tutorials, and one of them had this line, so I tried and it did the trick.

    Kristof

Posting Permissions

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