×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    How to send SMS to a particular port??

    Hi all,

    In my application i want to send SMS to a particular port let us say port number 16000.I have already written code for sending SMS.I just want to send this to particular port.Help me..



    Rohanwaugh

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    hi,

    There was a similar discussion some time back follow this link
    Regards,
    Sriky

  3. #3
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    hi sriky27,

    i think that thread was talking about emulator..I want to send SMS to a particular port on device..

    Rohanwaugh..

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    Quote Originally Posted by rohanwaugh View Post
    hi sriky27,

    i think that thread was talking about emulator..I want to send SMS to a particular port on device..

    Rohanwaugh..

    My post in that link works on Device too. Try it out
    Regards,
    Sriky

  5. #5
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    hi,

    thanks for the reply and for the link also.I will try that out..

    Rohanwaugh

  6. #6
    Regular Contributor
    Join Date
    Sep 2008
    Location
    India
    Posts
    126

    Re: How to send SMS to a particular port??

    Hi all,
    I wrote following code to send sms to perticular port by using references provided by various other threads and links :

    RSocketServ sockServ;
    RSocket socket;
    TSmsAddr smsaddr;
    RFs fileSession;
    TGsmSms aGsmSms;
    TSmsUserDataSettings smsSettings;
    TRequestStatus status;
    TPckgBuf<TUint> sendBuffer;
    CSmsPDU *smsPDU;

    User::LeaveIfError(sockServ.Connect());
    CleanupClosePushL(sockServ);
    User::LeaveIfError(socket.Open(sockServ, KSMSAddrFamily, KSockDatagram, KSMSDatagramProtocol));
    CleanupClosePushL(socket);

    TUint aPort;
    aPort = 16001;
    smsaddr.SetPort(aPort);


    User::LeaveIfError(socket.Bind(smsaddr));


    User::LeaveIfError(fileSession.Connect());
    CleanupClosePushL(fileSession);

    CSmsBufferBase *buffer = CSmsBuffer::NewL();
    CleanupStack::PushL(buffer);

    buffer->InsertL(0,iBody);
    smsSettings.SetAlphabet (TSmsDataCodingScheme::ESmsAlphabet8Bit);
    smsSettings.SetTextCompressed(EFalse);



    CSmsMessage *cSmsMessage = CSmsMessage::NewL(fileSession, CSmsPDU::ESmsSubmit, buffer);

    CleanupStack::Pop(buffer);
    CleanupStack::PushL(cSmsMessage);
    cSmsMessage->SetUserDataSettingsL(smsSettings);
    cSmsMessage->SetToFromAddressL(tmpIndName);
    cSmsMessage->SmsPDU().SetServiceCenterAddressL(_L("+919890051914"));

    RSmsSocketWriteStream writestream(socket);
    writestream << *cSmsMessage;
    writestream.CommitL();


    socket.Ioctl(KIoctlSendSmsMessage, status, &sendBuffer, KSolSmsProv);
    User::WaitForRequest(status);

    CleanupStack::PopAndDestroy(cSmsMessage);
    CleanupStack::PopAndDestroy(&fileSession);
    CleanupStack::PopAndDestroy(&socket);
    CleanupStack::PopAndDestroy(&sockServ);

    1.With the help of this code I am able to send but at the receiver end message goes to Inbox and not at given port .
    2. As well when we try to open that msg >> error appears like
    "Unable To open message format not supported"

    Can anybody tell me why the message is not going to perticular port?

    Or is there any other option to set set port ?

    Thanks and Regards,
    Kranti

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    Hi,

    I suppose you have to listen for the sms on the other end. In J2ME if there is an application listening for a particular port no other application can absorb the sms. In Symbian SMS message go to the Inbox and you could get it if you are listening for it on the other end.
    Regards,
    Sriky

  8. #8
    Regular Contributor
    Join Date
    Sep 2008
    Location
    India
    Posts
    126

    Re: How to send SMS to a particular port??

    Hi sriky27,

    At other end there is a J2ME application which is listening for this particular port. But still the message is going to inbox and not at that perticular port(16001).
    Do you think that there is any problem with the way with which I am setting the port no.

    TUint aPort;
    aPort = 16001;
    smsaddr.SetPort(aPort);
    Thanks and Regards,
    Kranti
    Last edited by Kranti; 2008-10-23 at 05:31.

  9. #9
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    Hi sriky,

    I am using same code as given by kranti.Is there any problem in the code given below.cos the sms is not coming on port.It is directly coning to inbox,which i don't want.
    Is there any problem with particular port number??i am not able to understand y sms is not coming to port.

    Help me.

    rohanwaugh

  10. #10
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    Hi rohanwaugh,

    I had a similar requirement on one end the sms you should be generated from Symbian c++ application and on the other end there is j2me application listening for I was able to do that I have given the code in this link. Try it out it will for sure.
    Regards,
    Sriky

  11. #11
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    hi,

    i have already seen that code..but this code is incomplete.What is before and after that code??i didn't understand..If the code would be complete at least i would have been able to understand the code.If u have complete code then pls send ..


    rohanwaugh

  12. #12
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    Ok here goes the code
    Attached Files Attached Files
    Regards,
    Sriky

  13. #13
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    hi,

    Thanks a lot.Will see the code.

    Rohanwaugh

  14. #14
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    413

    Re: How to send SMS to a particular port??

    hi sriky,

    i build a new application using ur .h and .cpp file.But in .cpp file, smstrace.h file is included..and i don have that file.So large number of errors are coming.

    so help me now..


    rohanwaugh

  15. #15
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: How to send SMS to a particular port??

    hi,

    I guess you could remove that code dude. It will take you two minutes if you want clean code I have attached here
    Attached Files Attached Files
    Regards,
    Sriky

Similar Threads

  1. Send binary SMS to port like in J2ME
    By Robert111 in forum Symbian
    Replies: 22
    Last Post: 2008-11-01, 20:15
  2. Need a PHP/HTML script which integrates with SDK and send sms
    By ramanladhani in forum Tools and SDK Feedback (Closed)
    Replies: 2
    Last Post: 2007-01-14, 10:56
  3. How to send sms from SMSC to particular port
    By alperay in forum General Messaging
    Replies: 1
    Last Post: 2004-07-01, 07:47
  4. how to send sms with port from J2EE Server
    By swoermck in forum Mobile Java General
    Replies: 4
    Last Post: 2004-05-08, 10:50
  5. Replies: 1
    Last Post: 2002-07-23, 14: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
  •  
×