I am in the process of developing an SMS server using
Attain.
I am using a dll that has functions and events for sending
and receiving SMS messages from mobile phones.
I can send messages out alright, but when it comes to receiving
messages in I am having some difficulty.
I have created a Single Instance codeunit and declared
an Automation variable for the DLL and set its property to WithEvents = YES.
This exposes the DLL's ReceiveMessage Event in the C/AL code and
in here I place some code to insert a record into a table.
I have tried running this codeunit from a form and just from the object designer.
I then send SMS messages to the phone connected to my PC, but the
event never seems to get triggered, and no records are inserted into
my table, even though I know that the phone is connected.
I know that events are used in other Attain codeunits, but dont
see how they are different from what I am doing. I am just using a standalone database at the moment and connecting directly into it, ie not
using NAS etc.
Are only certain DLLs and their events supported by Attain ??
Do I need some sort of timer ??, even though I feel this should not
be needed, as the event should fire any time a new message is received.
Please help !!!!
0
Comments
If it was hard to write, it should be hard to understand."
codReceiveSMS.Run;
The run trigger of this codeunit then creates the SMS automation variable with events, and connects to the phone.
In the ReceiveMessage event in this codeunit I have some very simple
code that builds a Message Receive Record and inserts it into a table.
Is it true that Attain only supports events in DLLs when used through
the NAS ?
Definitely not true!
I have created a DLL for receiving messages from a phone system. That DLL passes the message to a Navision Single Instance codeunit, using events. This SI codeunit is started in Codeunit 1, for every user. So no need for NAS.
Try putting a MESSAGE or CONFIRM statement in your Event-trigger in Navision, to see if the messages are coming in.
I made a database crack program with which you can crack any password in any database with the use of a dll.
So it is absolutely possible.
* don't ask me for the crack program, I'm not sharing it
Don't want any problems
If it was hard to write, it should be hard to understand."
I have put codeunit.run(66000) in LogInStart in codeunit 1.
This codeunit is single instance and connects to the phone
(I know it is connected because I can send out).
I can see the events available to me in the C/AL code
, but even when I put in just a MESSAGE('SMS Received');
in this event nothing happens.
When I run the VB sample app that came with this DLL the
event triggers fine in this, just not in Attain.
I am running 3.60 connecting directly into the DB.
Luc, can you give me more detail of how you got your TAPI DLL
to work in Attain ?
Thanks
In short, there really is a way to execute a code unit from outside of Navision without going through the Navision Application Server?
I need to send XML messages to a code unit to have them parsed, and applied to the system the "right" way instead of just adding them to the Navision tables directly. I also need to have other code units supply information from Navision.
I know this can be done by using the Commerce Server or Portal sold by Navision, but that gets really expensive when you add the cost of Microsoft Biztalk or Commerce Server.
I had intended to use message queues (and still may) but I wanted to see if there really was a way to communicate with a code unit from another application (in my case it will be Java talking to the code unit).
Thanks!
Have you tried this?
...
Everybody on-line.
...
Looking good!
I think you haven't done anything wrong. Everything you've done seems right and Navision fully supports events.
In the past i have done some programming with phones and then i came to the conclusion that often the phone doesn't support certain functions.
For example i din't recieve an caller ID from every type of phone.
I suggest that the problem may be the same in your case, that your cell phone doesn't support (SMS) callbacks to the computer.
You can easily test this by using 3rd party software that has simmular functionality. If the SMS messages are not received by that application then this is not supported by your phone (or in the api layers between your program and the phone).
good luck
jan-pieter