Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: NetCallerID trigger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have NetCallerID that is working properly. I would like to broadcast the caller ID information to my Linux computer displays using the windows "YAC" program. This can be run from command prompt as ""C:\Program Files\Yac\YACTextSend.exe" TEXT" where TEXT is the actual message to broadcast.

When CID information is received I would like CQC to trigger an event that runs the above command line with the CID information (name and number) in the TEXT parameter. I can't seem to get any of this to work. Pouring over the reference library has not gotten me any closer. A push in the right direction would be appreciated.
I left the DEBUG item visible in the driver exactly for the triggering purpose. The other fields (other than time) are not necessarily going to change on every call but that text from the device is definitely going to change. That's what I use for my triggers.

Thanks for that Russ. Can you help me with more of the nitty gritty about how to set up the trigger?
In the Admin Interface, open the Driver fields (bottom right icon) and select your NetCallerID device. Scroll down to the Debug field and click Trigger. I use "Send an event on any value change." Save that and close the Field Browser. Then select the Event Server (bottom left icon) and select the Triggered tab. Add a new trigger and select the "Is Field Change For" on the first filter. Fill in the Field with Device.Debug where Device is the moniker you assigned to your driver. Finally, "Edit Action" at the bottom will allow you to put in the actions you want done.

OK so far so good.... now for the rest of the hand holding....

On trigger I need to run a the command line "C:/program files/YACsendtext.exe TEXTTOSEND"

where TEXTTOSEND is the caller ID info. I need to know how to configure the System::ExecApp command to pass the .exe with the associated text as a single line command from CQC action.
You don't have to do that. It will create the single command correctly. So provide the program path and the put the text to send into the parameter field. Quote it to make sure it is seen as a single parameter if that's what you want the program to see.
I moved the program to the C:\ root folder to eliminate the issues with spaces in directory names but still no luck. Here is my

System::ExecApp(C:\YACTextSend.exe, test,,Show)
I have also tried
System::ExecApp("C:\YACTextSend.exe", "test",,Show)
System::ExecApp(C:\YACTextSend.exe, "test",,Show)

when I run "C:\YACTextSend.exe test" (without quotes) from the command line it works.

I know the event is properly triggering since I can make it do other stuff but just can't get this exec to work.
Unless you are passing a value that has spaces in it, you won't need the quotes anyway. And you never need any quotes on the path to the program since that's a single parameter to the exec app command so it knows it's all one thing.

One thing you should do, though it's probably not a problem in this case, is that you should escape slashes, so C:\\Whatever, because \ is an escape character. It only matters if the next character is one that's escapable and I don't think Y is, but it's something you should always do when you use slashes in an action command parameter.

This isn't a GUI program is it? I assume it's just a simple command line program? Is it some ported Unix program? If so, it might not correctly deal with command line parameters that are quoted. This happens sometimes. And CQC (well the underlying CIDLib stuff) will quote all parameters so that it doesn't have to guess if they need them or not. Some Linux programs will choke on this.

One thing you might want to do is first to just try it from a simple key mapping in the admin interface, to remove any issues of running in a service and see if it works there first.
Making some progress...

When I keymap the command:
Quote:System::ExecApp(C:\YACTextSend.exe, test, Show)

it works like a charm (except it sends the message surrounded by quotes which I can live with for now)

However when I try the same command in a triggered event I get no joy and an error in the log saying:
Quote:The application is running but could not be activated
Scheduled/Triggered event 'callerIDDistribute' failed

Dean this was written in Visual Studio.Net and is not a GUI program just a simple command line
I assume that it's still trying to do some GUI stuff. Try using Hidden for the show type and see if that helps.
Pages: 1 2