Ringtone plugin
From KuneriLite wiki
Contents |
Introduction
KuneriLite Ringtone plug-in can launch any SWF when voice call is ringing, answer or hang up call and optionally mute default ringtone.
This makes Flash ringing tones possible for S60 phones.
IMPORTANT NOTES
1 Application using this plug-in must be signed. Fill your certificate information into KuneriLite Wizard UI.
2 Port value for loadVariables is fixed for ringtone plug-in: it must be 2001!
3 Because used ringtone SWF launching method and security restrictions of
FL2 and FL3 players, ringtone SWF file cannot load external media assets (for instance loadMovie cannot be used).
Therefore, implement your ringtone SWF files as simple as possible, embedding everything.
4 For testing there is free Ringtone Tester application available. You can install it and replace \data\others\trusted\KLRingtoneTester\KLRingtoneTester.swf and ring.swf files with your own.
You don't need to go through signing process, for just to test Flash ringtones!
Interface
loadVariables("http://127.0.0.1:2001/<Key>/ring?klCommand=<Command>&
<Arguments>, "<TargetMc>");
| General Parameters | |
| In KuneriLite versions 0.9.7.1 and above, port value must be 2001 for all ringtone plug-in calls! | |
| <Key> | Unique key for your KuneriLite license (default Basic) |
| <Command> | Name of the command to be called. |
| <Arguments> | Required arguments for commands. Each command may have different arguments with various parameter values. |
| <TargetMC> | Flash Lite movie clip that will receive the response back. |
Status of a command can be controlled via klError and klEnd variables. klError returns the response message from KuneriLite server application and klEnd value indicates that conversation is finalized and all data is received. For meaning of klError values, please refer to "Error Values" section below
Commands
enableringswf
This command should be called first. Starts listening incoming voice calls and launches given SWF when call starts ringing. Default ringing tone can be muted.
Returns
Returns 0 to klError if successful, or an error code if there is any problem setting up plug-in.
Arguments
klPath
| Path to the SWF file. |
klMute
| When given, default ringing tone won't be played and audio in SWF is audible instead. |
Example
loadVariables("http://127.0.0.1:1001/Basic/ring?klCommand=enableringswf&
klPath=ring.swf&klMute=1&", "");
disableringswf
This command should be called when KuneriLite ringing tone plug-in is not needed anymore.
Stops listening of incoming voice calls. All plug-in resources will be freed.
callerid
Returns name and phone number of the caller.
Returns
klError
| Error code (0 if successful, -1 if call is not ongoing) |
klName
| Name of the caller, if found from phone's contacts. |
klNumber
| Phone number of the caller, presented in international form. |
getpath
Returns path of the current active ringtone.
Returns
klError
| Error code (0 if successful, -1 if ringtone is not set) |
klPath
| Full path of the SWF. |
answercall
This command is not particularly required, since call can be answered/rejected by phone keys.
If call controlling is needed from Flash side, this command
should be called from actual ringtone SWF, launched by the plug-in.
Incoming voice call in answered and opened SWF will be closed.
Returns
klError
| Error code (0 if successful, -1 if call is not ongoing) |
hangupcall
This command is not particularly required, since call can be answered/rejected by phone keys.
If call controlling is needed from Flash side, this command
should be called from actual ringtone SWF, launched by the plug-in.
Incoming voice call is rejected and opened SWF will be closed.
Returns
klError
| Error code (0 if successful, -1 if call is not ongoing) |
Error values
Common error statuses are mentioned below.
| 0 | Success |
| -1 | Call is not ongoing or ringtone is not set |
| -11 | Plug-in is already enabled and listening voice calls |
| -28 | Given URL is malformed |

