Mizu Webphone - Mizu Voip
Mizu Webphone - Mizu Voip
Mizu Webphone - Mizu Voip
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
}public String encrypt(String str) {try {// Encode the string into bytes using utf-8byte[] utf8 = str.getBytes("UTF8");}// Encryptbyte[] enc = ecipher.doFinal(utf8);// Encode bytes to base64 to get a stringreturn new sun.misc.BASE64Encoder().encode(enc);} catch (Exception e) { Common.PutToDebugLogException("des encrypt",e); }return str;public String decrypt(String str) {try {// Decode base64 to get bytesbyte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);// Decryptbyte[] utf8 = dcipher.doFinal(dec);}}// Decode using utf-8return new String(utf8, "UTF8");} catch (Exception e) { Common.PutToDebugLogException("des decrypt",e); }return str;JavaScript APIThe webphone has an easy to use API and can be easily controlled by external javascript function calls.You can completely hide the webphone (or run it in compact mode) and present your custom design created with html, css, flash or with any other tool.The syntax is very simple:document.applets[0].functionname();Example:function webphonetojs(message){//this is an optional function if you would like to be notified about webphone events//this function will be called by the applet//you will have to parse the message and act accordinglyalert(message);}function do_something(){document.applets[0].functionname();}Or you might use the following format:document.getElementById('webphone').getSubApplet().method(params);document.getElementById('webphone').method(params);Notifications (status updates, events, etc) from the webphone is wired to your javascript function named “webphonetojs”.For a working example please check the ”Toolkit_with_JS.htm” that you should find in the demo package.