About intercepting SMS with destination port number in Qtopia 2.1 (phone edition)

Hi,

I am working on an application that handles SMS with destination port number in Qtopia 2.1 (phone edition). The idea is to let qtmail to handle all normal SMS, and let my application to handle all SMS with destination port number. Based on info at these two links (see below) I came up with a solution:

formatting link
formatting link

I've been testing my application for quite some time. So far all SMS with destination port number are delivered to qtmail. None of the SMS are passed to my application. I've spent some time to search on various Qtopia forums, still couldn't find any useful hints. Hope some of you could kindly give me some enlightenments on this issue. Thanks in advance!

What I've done so far can be summaried as below:

Suppose I want my application to intercept SMS with destination port number 3456. (Ideal case is that the application can intercept SMS with any given destination port number).

  1. Register the smsapp service

1.1 Create file "/opt/Qtopia/service/smsapp/3456/smstest":

[Extensions] [Standard] Version = 100

1.2 Create file "/opt/Qtopia/service/smsapp.service":

[Extensions] [Standard] Version = 100 /opt/Qtopia/services # cat smsapp.service [Translation] File=QtopiaServices Context=SMS [Service] Actions = smsApplicationDatagram(SMSMessage) Name[]=smsapp/3456 [smsApplicationDatagram(SMSMessage)]

  1. Build executable that handles SMS in "opt/Qtopia/bin/smstest"

Functions/Class related to SMS handling are listed below:

int main( int argc, char** argv ) { QPEApplication app(argc, argv); QMainWindow *mainWindow = new SMSTest(&app, 0, 0, 0); app.showMainWidget(mainWindow); return app.exec(); }

SMSTest::SMSTest( QPEApplication * qapplication, QWidget* parent, const char* name, WFlags fl )

: QMainWindow( parent, name, fl ) { this->qapplication = qapplication;

Init();

}

void SMSTest::Init() { this->showMaximized();

connect( qapplication, SIGNAL( appMessage( const QCString&, const QByteArray& ) ), this, SLOT( receiveSMS( const QCString&, const QByteArray& ) ) ); }

void SMSTest::receiveSMS( const QCString& msg, const QByteArray& data ) { trace("receiveSMS() - 01\n");

QDataStream stream( data, IO_ReadOnly ); if ( msg == "smsApplicationDatagram(SMSMessage)") { trace("receiveSMS() -02\n"); SMSMessage smsMsg; stream >> smsMsg; } }

Reply to
ralph
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.