Windows Mobile WAP Wakeup - c++

could anyone please give me directions, or better - a working sample, of using the "WAP Wakeup" feature in Windows Mobile?
I'm trying to follow directions from http://msdn.microsoft.com/en-us/library/aa919167.aspx . Unfortunately, they only give the beginning of the solution.
Step 1: register your application to listen to SMS messages coming from a specific port.
Step 2: send an SMS message to that port
Step 3: the application opens up and sends a message to the application listener class window
Step 4: receive that message and bubble up an event
I am clueless about steps 2-4.. are those even the right steps?

I have not done this myself but I have worked in a simlar area.
There are two ways to send the WAP SMS Message (basically a binary Wireless Datagram Protocol (WDP) formatted binary SMS message)
By Phone using the WAP api.
Using a SMS gateway.
A SMS Gateway allows you to send sms messages from the internet. If you search on the web for SMS gateways you should get lots of them. Pick one that supports sending Binary SMS Messages.
As part of the WDP header you have to specificy a port number, which is the port number they go on about.
Before you send the sms message, you need to check with your cellular provider that they support binary sms messages, not all cellular networks do.
The rest of it is pretty much following the Microsoft Example:
Create the registry setting.
A WDP SMS messages arrives at the WDP layer on port WDPport1.
The WDP layer checks if the application is registered with the WDP
layer on Port Number WDPport1. In this
case, no application is registered.
The application checks the registry to determine if any application is
registered for WDP messages on Port
WDPport1., The application finds that
Chess.exe application is registered.
If Chess.exe is loaded, the application launches Chess.exe.
The chess application opens "ListenerWnd" Listener Window Class.
"ListenerWnd" receives a message with DWORD value
Chess.exe recognizes this message as an indication that a WDP message is
awaiting on port WDPport1 and
registers WDPport1 as it's own with
the WDP layer.
Chess.exe receives and processes the awaiting WDP message.
Chess.exe closes.

i sent a binary sms by all rules, created a registry settings, application... all as written at the Microsoft forum about WAP Wakeup... but when mobile receives sms, its directly goes into Inbox....
may by anybody can tell on which aspects a need to make a point.. because.. 3 days on this problem.. this is not good :-(

Related

How to manage the received SMS's in a gsm modem connected to a pc?

i am working on a project that a computer should manage the data receiving as sms text in standard predefined coding from multiple senders. the senders are some embedded sytems that send error situations of a machine via sms messages.
i am an electronic engineer not software and i made the senders circuits those send the information (errors) to a central monitoring site.
therefore in the site should be a gsm modem connected to a pc which receives the messages and the pc should have a software to be able to read the messages from gsm modem and sort them and log them and give the operator some reports based on for example which kind of errors has been occurred more and etc.
my question is about developing this software to be able to read data from usb port and then manage them.
This will hardly define by the specification of your GSM modem.
Maybe this OP will help you :
How to communicate with GSM modem from c++ code
Many GSM modem use the AT command, see also GSM section on this page :
https://en.wikipedia.org/wiki/Hayes_command_set#GSM
and this :
output of AT command c++ code
and look at the at-command tag also

Scalable Chat server in Clojure. Problems with presence and message arrival b/w reconnections

I am trying to build a scalable chat server in Clojure. I am using http-kit, compojure and redis pub/sub to communicate between diffrent nodes (fan-out approach). The server will use websockets for connection b/w client-server with a fallback to long polling. A single user can have multiple connections to chat with one connection per tabs in the browser and message should be delivered to the all the connections.
So basically when the user connects I store the channel in a atom with a random uuid as
{:userid1 [{:socketuuid "random uuid#1 for uerid1" :socket "channel#1 for userid1"}
{:socketuuid "random uuid#2" :socket "channel#2"}]
:userid2 [{:socketuuid "random uuid#1 for userid2" :socket "channel#1 for userid2}]}
the message is POSTed to a common route for both websockets and long polling channels, the message structure looks like
{:from "userid1" :to "userid2" :message "message content"}
the server finds all the channels in the atom for the :from and :to user ids and send the message to the connected channels for the respective users, also it publishes the message over the redis server where the connected nodes look for channels stored in their own atom and deliver message to the respective users.
So the problem I am running into is, how to properly implement presence. Basically http-kit send you a status when a channel disconnects the status can be "server-close" or "client-close", while I can handle server disconnects (the client will reconnect automatically) but I am running into problem when the disconnect happens from client side, for eg. the user navigates to another page and will connect after a few seconds. How do I decide that the user has went offline when the client disconnects. Also I am concerned about message arrival b/w reconnects in long polling mode (my long polling timeout is 30 seconds).
Also please suggest a good presence mechanism for the above architecture. Thanks.
Please comment if you need more info. Thanks
Edit #1:
Can you recommend a good tutorial/ material on implementing presence in a chat server, I cant seem to find anything on it.
My current solution -> I am currently maintaining a global count and a last connected timestamp for the connected channels of a particular userid and when a user disconnects the count is decreased, and a timeout is implemented for 10 seconds which will check if the user has reconnected again (i.e. the last connected stamp is 10 seconds old and count is still zero), if not then the user is said to have gone offline, would you recommend this solution, If not why, or any improvements or better methods are appreciated.
Also please note I am using the timer/scheduled-task in http-kit, would these timeout significant performance effects?
There are two different cases here from client side.
Long Polling. I cannot see how this is a problem, if the client window closes, there wont be no polling anymore. One client less which asks for data.
Websockets. There is a close method available in the protocol. The client should send a notification if you implement it correctly. See here: Closing WebSocket correctly (HTML5, Javascript) for instance.
Does that answer your question?

Running application in background and catching incoming and outgoing messages

I am working on one app which I want to run in background and it should handle the event when any sms gets received and my application should receive that sms even if this application is closed. Till now my application is getting sms only when it is opened . I want it to catch all messages received even it is closed. Similarly I want this for sent messages .
Could anyone please tell me how should I do this?
Right now the only way to do that would be with a long running headless application. You will need a special signing key and it won't be available to users until 10.2.1 is released.
Also, BlackBerry is far more protective of user privacy than some other platforms. You will likely only get permission to run such an application headless if you have a very good reason to access all incomming and outgoing SMS.

An already running application to be informed about an incoming SMS - Windows Mobile 6.5

I have a C/C++ Windows Mobile 6.5 application that continuously runs on the phone. It needs to analyze the SMSes. How can I be notified in my application about an incoming SMS? I read in MSDN about the SmsSetMessageNotification() but this is starting an application once the SMS comes in, and in my case the application is already running, it just needs to be informed that a new SMS was received and then should have access to it in order to analize it and to decide if it's of any interest for the application or not.
So how can my already running application be informed about an incoming SMS which then needs to be analyzed?
I believe you need to use the IMailRuleClient to sign up for notifications of a text message being received.
There is a sample application as part of the sdk that demonstrates this functionality. You can download it from MSDN Code Samples
You can achieve your goal using the Radio Interface Layer (RIL) API. Download RIL.H to get started. Then use LoadLibrary and GetProcAddress to dynamically call the RIL functions from the DLL at runtime. You can setup a RIL notification callback to notify you when message activity happens. I found a code example here.

Biztalk web service ports and what happens when the port/application is stopped

I have a question around biztalk and what happens when certain conditions around web service ports are met.
basically we have two applications - a main application (lets call it 'MainApplication') (containing the orchestration) and a web service application (lets call it 'MainApplicationWS'), where we expose a web service (created from biztalks web service tool) to take messages from wherever.
we have a testing tool which replays messages to the MainApplicationWS to simulate messages coming through from various external systems.
I have noticed that if we partial stop the MainApplicationWS application, and send messages through to the web service listed as a recieve location, nothing happens (obviously!) (also, the web service is still running, even though its been delisted as a recieve location). however, if i start up the MainApplicationWS again and bounce the host instances the messages are picked up from somewhere and played through to the orchestration and through to our application.
Im just a bit puzzled as to where its storing these messages while the MainApplicationWS is partially stopped. is the web service somehow hanging on to these? or does it still post through to the biztalk message box?
any clarification would be greatly appreciated :)
cheers,
adam
In short, I can't repeat your behaviour in Biztalk 2009. The closest to 'queueing' messages is if the orchestration is stopped but remains enlisted, such that messages are suspended resumable.
In long - I'm not quite sure what you mean by 'delisted as a receive location'. In Biztalk 2009:
Receive Locations can be enabled or disabled
Orchestrations can be stopped, and unenlisted
A Partial Stop on your BTS application disables receive ports and stops orchestrations (but doesn't unenlist them)
A full stop stops and unenlists orchestrations
The below is observed behaviour on BizTalk 2009 for a simple orchestration with a WCF Request/Response port, which receives a message, Maps the Send back to the same Port
The port is Direct Bound (MessageBox).
If the Isolated Host App Pool is disabled in IIS
A synchronous error is returned to the client - Standard IIS Error (503 Service Unavailable etc)
BizTalk receives no messages at all
If the BizTalk receive Location is disabled
WSDL: Syncrhonous error returned to the client - The Messaging Engine failed to register the adapter for "WCF-BasicHttp" for the receive location "xyz.svc". Please verify that the receive location exists, and that the isolated adapter runs under an account that has access to the BizTalk databases
Service Call : The requested service, xyz.svc could not be activated. See the server's diagnostic trace logs for more information.
If the Orchestration is stopped, but not unenlisted
The received message is Suspended, resumable. The client times out (no response is issued).
If the orch is started and the message resumed, the message is then processed. The client will only get a successful reply if the orch start and the suspended message resume are done before the client's configured WS / WCF timeout.
If the Orchestration is unenlisted
The received message is Suspended, not resumable.
The client receives an error - The server was unable to process the request due to an internal error.
With the WCF CustomBinding it is also possible to listen directly on the relevant BizTalk ReceiveHost (i.e. no need for IIS at all to listen to BasicHTTP or WSHTTP, although we generally still use the Wizard generated svc in IIS solely for the hosting and publication of the WSDL. We then create a new WCF Custom receive location directly in BizTalk and point the client to this)
Hope this helps?