×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    7

    How to send a SIP MESSAGE request ?

    Hi All,

    How to send a SIP MESSAGE request ? I have registered 2 user-agents successfully and now i want to send a MESSAGE from one to another. Here is what am doing... I create a CSIPRequestElements objects with the AOR of the recipient, then i retrieve the CSIPMessageElements object from it. After this i set the method and content for the CSIPMessageElements object and then send it using the active connection. The problem is that at runtime its giving me a KErrArgument(-6, Bad Request) error in the SendRequestL(...) call. Can someone please tell me which argument is wrong or if i need to put in any more fields in the CSIPMessageElements object ?


    // code starts ...

    CSIPAddress* addr = CSIPAddress:ecodeL(_L8("sip:user2@mydomain.com"));
    CSIPToHeader* aor = CSIPToHeader::NewL(addr);

    CSIPRequestElements *elements = CSIPRequestElements::NewL(aor);
    elements->SetMethodL(_L8("MESSAGE"));

    CSIPMessageElements& msgElements = elements->MessageElements();

    HBufC8* g = HBufC8::NewL(10);
    g->Des().Append(_L8("Hi there!"));
    CSIPContentTypeHeader* cType=CSIPContentTypeHeader::NewL(_L8("text"), _L8("plain")); // is this right ?
    msgElements.SetContentL(g, cType);

    CSIPClientTransaction* sipClientTransaction = iConnection->SendRequestL(elements);

    // code ends.


    And.. on the receiving side which callback method will be invoked when the message is received ?

    Someone please help, this is really urgent for me..

    Thanx in advance,
    starFish

  2. #2
    Registered User
    Join Date
    Sep 2005
    Posts
    12

    Re: How to send a SIP MESSAGE request ?

    hello,

    the chipflip example has a section on it's sip engine project (transactionsstates i think) which i think can help u. a bad request is usually generated when your message doesnt have all the necessary requirements (i.e. headers,sdp,etc) or contains a header with a wrong value.

    u can also refer to the RFC specs of the SIP for further reading.

    happy programming!

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    7

    Re: How to send a SIP MESSAGE request ?

    Thanks SilentSmirk!

    I tried to go thru Chipflip, but its architecturing seems awfully complicated to me! Maybe becoz am a newbie! Anyway i got it rolling after adding "" to the list of accept types in the ecom plugin's resource file.

    starFish

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    187

    Re: How to send a SIP MESSAGE request ?

    I think it's your sip server who is sending the bad request response.

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    10

    Re: How to send a SIP MESSAGE request ?

    I have similar code, but i'm not succeeding ind sending the message request.
    I'm using the SIPExample as base code and I'm able to send Register and Invite, but when I try to send the Message request in the "ProfileRegistrationStatusChanged" after succesfully enabling the profile. The code that I'm using is:
    CSIPAddress* toAddress = CSIPAddress:ecodeL(_L8("sippponent@opponentdomain.com"));
    CleanupStack::PushL(toAddress);
    CSIPToHeader* toHeader = CSIPToHeader::NewL(toAddress);
    CleanupStack::Pop(toAddress);
    CleanupStack::PushL(toHeader);

    CSIPRequestElements *elements = CSIPRequestElements::NewL(toHeader);
    elements->SetMethodL(_L8("MESSAGE"));
    CSIPClientTransaction* sipClientTransaction = iConnection->SendRequestL(elements);
    Anybody has any idea of what might be wrong?

    Thanks

Similar Threads

  1. How to send SIP Publish message?
    By relliott98 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-04-19, 19:45
  2. SIP MESSAGE gets a 404 Not found answer
    By cryptor in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2006-02-27, 05:10
  3. WMA sms message with request for receipt
    By tubeman in forum Mobile Java General
    Replies: 0
    Last Post: 2003-10-17, 14:02
  4. Render FAX message and send it
    By jorge_c in forum Symbian
    Replies: 0
    Last Post: 2003-05-19, 11:32
  5. can the sample code send chinese short message?
    By shibamo in forum General Messaging
    Replies: 1
    Last Post: 2002-10-21, 08:39

Posting Permissions

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