Returns version string of the active 24U Phone Companion, formatted as requested by the parameter.
|versionFormat||Defines the format of the returned version.|
|"short"||To get just the version number. Default value.|
|"long"||To get the plug-in name followed by its version number.|
|"platform"||To get the platform of the code currently running.|
This function is very important and it has the same output format in all 24U Plug-Ins. You should call this function every time you need to check if the plug-in is properly installed to the FileMaker. Even if the plug-in is not registered (or badly registered) this function should work. Calling this function in the startup script of your solution is recommended.
Returns requested version format or platform. If this function returns "?" than the plug-in is not properly installed or FileMaker cannot load and activate it for some reason.
Phone_Version( "long" )
This will return the plug-in name and its version. In this case it is "24U Phone Companion 1.0".
Phone_Version( "platform" )
Returns "Mac OS X" or "Windows" depending on the platform the plug-in is currently running.
Attempts to unlock (register) your copy of 24U Phone Companion with the specified code.
|originalSerialNumber||The original (non upgrade) code to unlock the full version of the plug-in.|
|upgradeSerialNumber||The upgrade code to unlock the full version of the plug-in.|
If the code(s) is valid, 24U Phone Companion gets unlocked and stays in this state until you quit the FileMaker Pro application, deactivate the plug-in, or the registration code expires. While unlocked, 24U Phone Companion is fully functional and does not bother the user with a shareware reminder.
Returns a non-zero error code when the serial numbers are wrong if the numbers cannot be used. Returns 0 if the plug-in was successfully registered.
Phone_Register( "PHC10J-CM244H-U4UGBN" )
This function will register the plug-in with serial number PHC10J-CM244H-U4UGBN. This method is useful when you register the plug-in with developer license but it can be used for end-user licenses as well.
Phone_Register( "PHC10J-CM244H-U4UGBN PHC20J-BTPDSK-D3AJ9C" )
Use combination of serial numbers delimited by empty space to register using upgrade code. The first code must be the original one, all other codes should be upgrade codes.
Phone_Register( "PHC10J-CM244H-U4UGBN PHC20J-BTPDSK-D3AJ9C PHC30J-5B4J7Z-W9KFNS" )
The example of using one original number and two upgrade numbers. The original is for version 1.0 and upgrades are for 2.0 and 3.0.
Note: All serial numbers here are only for demonstration purposes. They will not work in real plug-in.
Connect to STLI server.
|serverIP||The IP address of the server.|
|serverPort||The port of the server.|
|timeout||The timeout for connection. Use float number in seconds. The default value is 3s.|
Call this function establish TCP connection to STLI server. This server is needed to control the line. All phone functions will work only if the plug-in is properly connected.
Function returns 0 id connection was successfully established. Otherwise it returns negative error code.
Phone_Connect( "10.0.0.2" ; 26535 )
The plug-in will attempt to connect to server with IP 10.0.0.2 on port 26535.
Phone_Connect( "188.8.131.52" ; 25001 ; 9.5 )
The plug-in will attempt to connect to server with IP 184.108.40.206 on port 25001 with 9.5 seconds timeout.
Disconnect from STLI server.
This function will cause that TCP connection to STLI server will be terminated. Use this function when you no longer need phone services.
Function returns 0 if the connection was terminated. It returns 0 even if there was no previous connection. Error code is returned when the connection was not terminated in the standard way (abnormal termination).
Function has no parameters. This will always terminate the connection and return status code.
Dials a specified telephone number on the specified calling device.
|localDevice||The phone number of device from which the call originates. The device must be local.|
|calledDirectoryNumber||Indicates the device to which the call should be directed. The number should direct to local or external device.|
This function will dial the number on the local phone. The format should be FileMaker text. It can contain all numbers, "*", "#" and "+".
Function returns 0 if the number was successfully dialed. It doesn't matter if the other side accepted the call or not. If some error occurred (line is not ready, server is not ready, line was forcefully disconnected or similar) the status number is returned.
Phone_Dial( "11" ; "17" )
This will dial the number 17 on the device with number 11.
Phone_Dial( "103" ; "05555925" )
You can use any number for outside calls. This will dial 05555925 number on the device with local number 103.
Answers (off-hook) an incoming call.
|localDevice||The local device which should answer the call.|
The called local device should be able to accept incoming call. It should be either speakerphone or headset equipped phone. The local device should be monitored for incoming calls. Use Phone_SetScriptEvent function to monitor incoming calls.
Function returns 0 if the call was successfully accepted. It the device cannot accept call or another problem occurred than the status code is returned.
Phone_Accept( "19" )
This will accept the call on the local device with number 19.
Hang up a call.
|localDevice||The phone number of the local device which should hang up.|
This function will hang up a call on the local phone. The call should be properly established and local device should be monitored with some event. Use Phone_SetScriptEvent to start monitoring events.
Function returns 0 if the phone was properly hanged up. In case of error the function returns negative error code.
Phone_HangUp( "19" )
This will hang up a call on the phone with number 19.
Tell the plug-in to launch the script when specified event is triggered from outside.
|localDevice||The phone number of the device for which the event will be triggered.|
|event||The type of the event which should be installed. See table below for possible types.|
|scriptName||The name of the script which should be triggered.|
|"onIncomingCall"||Run the script on incoming call from outside.|
|"onAnswerCall"||Run the script when incoming call is answered.|
|"onHangUp"||Run the script on hang up.|
|"onCalling"||Run the script when when the call is made from the phone.|
The function will call the specified script when the event of the specified type occurs. The script will receive a parameter which contains the number of controlled phone on the first line and the phone number of the second side on the second line.
To remove event for some number call Phone_SetScriptEvent( localDevice ; event ; "" ).
To remove all events for some number call Phone_SetScriptEvent( localDevice ; "" ; "" ).
To remove all events for all numbers call Phone_SetScriptEvent( "" ; "" ; "" ).
Function returns 0 if event is successfully installed or uninstalled. In case of error the function returns negative error code.
Phone_SetScriptEvent( "19" ; "onAnswerCall" ; "Save answered call" )
This will install the script named "Save answered call" for the local device with number 19.
Phone_SetScriptEvent( "105" ; "onCalling" ; "Show announcement" )
The script "Show announcement" will be called every time the user makes a call from the phone with number 105.
Function to get plug-in or phone server settings and other useful data.
|what||Which data should be get.|
|"lastError"||Returns the error code of the last error. If no error occurred 0 is returned.|
|"serverStatus"||Returns the status of the server. Can be "connected" or "disconnected".|
|"monitoredDevices"||Returns a value list of the devices which are currently monitored for events. See function Phone_SetScriptEvent to see how to install the event handler script. The value list is delimited by line break.|
|"serverResponseTimeout"||Gets the time how long Phone Companion waits for reply from TeamCall Server or Express.|
|"serverCommunicationDelay"||If Phone companion sends more than one message it waits very short time between each message. Use this parameter to obtain this value in seconds.|
Use this function to get important parameters.
Function returns data if everything is OK. In case of error the function returns "?". You can use Phone_Get("lastError") for more detailed error description.
Phone_Get( "lastError" )
Returns the error code of the last command. For example -50.
Set plug-in or phone server settings and other useful parameters.
|what||Which data should be set.|
|newValue||The new value for data.|
|"serverResponseTimeout"||Sets how long Phone Companion waits for reply from TeamCall Server or Express. The time is in seconds and the default value is 3 s.|
|"serverCommunicationDelay"||If Phone companion sends more than one message it waits very short time between each message. The default value is 0.1 s. Use longer delays if TeamCall is not able to react to fast communication.|
Use this function to set important parameters. Default communication delays and timeouts are set to work on local area networks. You can set longer values on slower networks (slow wireless networks) but the plug-in reactions will be also slower. Try to keep serverCommunicationDelay parameter as low as possible. Setting it too high (>1s) will essentially delay plug-in responses and probably will not help on broken link.
Function returns the real value of parameter if everything is OK. In case of error the function returns "?". You can use Phone_Get("lastError") for more detailed error description.
Phone_Set( "serverResponseTimeout" ; 4.5 )
The plug-in will wait for each answer from TeamCall up to 4.5 seconds. This also means that FileMaker will frozen for 4.5 seconds if TeamCall does not respond - do not set it too high.