Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

MyPhone Command Line API - Incoming Notification

Discussion in '3CX Phone System - General' started by uninet, Jun 29, 2013.

Thread Status:
Not open for further replies.
  1. uninet

    Joined:
    Jun 29, 2013
    Messages:
    4
    Likes Received:
    0
    I am trying to run a simple java program whenever my the phone rings using 3CX v11 and MyPhone latest builds. Under "Path to .exe" I have <path to java bin>\java.exe and under "Parameters" I have -jar <path to jar file>\SendCID.jar "%callid%"

    Now when the phone rings, a black DOS window with two lines of text flashes on the screen for a fraction of a second. It is not there long enough for me to read what it says, but it says something about not finding the main class.

    The same command <path to java bin>\java.exe -jar <path to jar file>\SendCID.jar "1234567890" runs without error when entered at a WindowsXP DOS prompt. Why should it be different here? and how do I make it work? How can I capture the error text to a file where I can read it?

    Richard
     
  2. ian.watts

    ian.watts Active Member

    Joined:
    Apr 8, 2011
    Messages:
    532
    Likes Received:
    1
    cmd /c prepended and > log.txt appended?

    Haven't tried... but passing it through a command prompt might avail the output redirect to the file. Else, wrap it into a batch and call it.. adding a pause statement last.
     
  3. uninet

    Joined:
    Jun 29, 2013
    Messages:
    4
    Likes Received:
    0
    Thanks, wrapping the java.exe command line in a .BAT file and adding a Pause command let me see what was wrong.

    As I discovered, the API starts up in the ...\All Users...\3CXMyPhone Client Addin directory.

    I had to insert a CD\ command to get to the java bin directory before it would let me run java.exe

    CallerID notification working fine now.
     
Thread Status:
Not open for further replies.