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
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
hi,
There was a similar discussion some time back follow this link
Regards,
Sriky
hi sriky27,
i think that thread was talking about emulator..I want to send SMS to a particular port on device..
Rohanwaugh..
hi,
thanks for the reply and for the link also.I will try that out..
Rohanwaugh
Hi all,
I wrote following code to send sms to perticular port by using references provided by various other threads and links :
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 .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);
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
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
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.
Thanks and Regards,TUint aPort;
aPort = 16001;
smsaddr.SetPort(aPort);
Kranti
Last edited by Kranti; 2008-10-23 at 05:31.
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
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
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
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
hi,
I guess you could remove that code dude. It will take you two minutes if you want clean code I have attached here
Regards,
Sriky