24U Phone Companion 1.0 Syntax

Phone_Version( { versionFormat } )

Returns version string of the active 24U Phone Companion, formatted as requested by the parameter.

Parameters

versionFormatDefines the format of the returned version.

Parameter values for versionFormat

"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.

Description

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.

Result

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.

Examples

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.

Phone_Register( originalSerialNumber { & " " & upgradeSerialNumber... } )

Attempts to unlock (register) your copy of 24U Phone Companion with the specified code.

Parameters

originalSerialNumberThe original (non upgrade) code to unlock the full version of the plug-in.
upgradeSerialNumberThe upgrade code to unlock the full version of the plug-in.

Description

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.

Result

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.

Examples

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.

Phone_Connect( serverIP ; serverPort { ; timeout } )

Connect to STLI server.

Parameters

serverIPThe IP address of the server.
serverPortThe port of the server.
timeoutThe timeout for connection. Use float number in seconds. The default value is 3s.

Description

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.

Result

Function returns 0 id connection was successfully established. Otherwise it returns negative error code.

Examples

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( "132.65.28.17" ; 25001 ; 9.5 )
The plug-in will attempt to connect to server with IP 132.65.28.17 on port 25001 with 9.5 seconds timeout.

Phone_Disconnect

Disconnect from STLI server.

Description

This function will cause that TCP connection to STLI server will be terminated. Use this function when you no longer need phone services.

Result

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).

Examples

Phone_Disconnect
Function has no parameters. This will always terminate the connection and return status code.

Phone_Dial( localDevice ; calledDirectoryNumber )

Dials a specified telephone number on the specified calling device.

Parameters

localDeviceThe phone number of device from which the call originates. The device must be local.
calledDirectoryNumberIndicates the device to which the call should be directed. The number should direct to local or external device.

Description

This function will dial the number on the local phone. The format should be FileMaker text. It can contain all numbers, "*", "#" and "+".

Result

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.

Examples

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.

Phone_Answer( localDevice )

Answers (off-hook) an incoming call.

Parameters

localDeviceThe local device which should answer the call.

Description

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.

Result

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.

Examples

Phone_Accept( "19" )
This will accept the call on the local device with number 19.

Phone_HangUp( localDevice )

Hang up a call.

Parameters

localDeviceThe phone number of the local device which should hang up.

Description

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.

Result

Function returns 0 if the phone was properly hanged up. In case of error the function returns negative error code.

Examples

Phone_HangUp( "19" )
This will hang up a call on the phone with number 19.

Phone_SetScriptEvent( localDevice ; event ; scriptName )

Tell the plug-in to launch the script when specified event is triggered from outside.

Parameters

localDeviceThe phone number of the device for which the event will be triggered.
eventThe type of the event which should be installed. See table below for possible types.
scriptNameThe name of the script which should be triggered.

Parameter values for event

eventDescription
"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.

Description

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( "" ; "" ; "" ).

Result

Function returns 0 if event is successfully installed or uninstalled. In case of error the function returns negative error code.

Examples

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.

Phone_Get( what )

Function to get plug-in or phone server settings and other useful data.

Parameters

whatWhich data should be get.

Parameter values for what

whatDescription
"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.

Description

Use this function to get important parameters.

Result

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.

Examples

Phone_Get( "lastError" )
Returns the error code of the last command. For example -50.

Phone_Set( what ; newValue )

Set plug-in or phone server settings and other useful parameters.

Parameters

whatWhich data should be set.
newValueThe new value for data.

Parameter values for what

whatDescription
"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.

Description

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.

Result

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.

Examples

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.