webphone FAQ

Q1.

How to prefer one codec?

Answer:


Enable only one codec by applet parameters and disable all others. In this case the call might fail if the other end doesn’t support the selected codec.
For example the following parameters will force the softphone to use only pcmu:

   -usepcmu=3
   -usepcma=1
   -useg729=1
   -usegsm=1
   -usespeex=1
   -usespeexwb =1
   -usespeexuwb =1


Q2.

NAT settings

Answer:

You may have to change the webphone configuration according to your SIP server if you have any problems with devices behind NAT (router, firewall).
If your server has NAT support then set the usestun and userport parameters to 0 and you should not have any problem with the signaling and media for webphone behind NAT. If your server doesn’t have NAT support then you should set these settings to 2. In this case the webphone will always try to discover its external network address.


Q3.

How to prevent browser caching?

Answer:

When multiple webphone are used with different parameters, in some environments the browser can cache the previous download and not to apply the new parameters. This can be avoided by using different URL for the applets with different parameters.
Otherwise the applet cache can be disabled as described here and here.


Q4.

I have problems on MAC or/and with browser X

Answer:

Please consult the “Popup.htm” source in the Examples directory. Alternatively you can consider deploying by JNLP.
The Java Script API is not working in my browser

Please check the JSAPI.htm and the Popup.htm source in the Examples directory for a working demo.
Also make sure that jar and jnlp mime types are allowed in your webserver.
More help on interaction between java and javascript:
http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html
http://java.sun.com/products/plugin/1.3/docs/jsobject.html
http://java.sun.com/docs/books/tutorial/deployment/applet/invokingJavaScriptFromApplet.html
http://java.sun.com/docs/books/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html


Q5.

The webphone doesn’t receive incoming calls

Answer:

To be able to receive calls, the webphone must be registered to your server by clicking on the “Connect” button on the user interface (or in case if you don’t display the webphone GUI than you can use the “register” applet parameter with supplied username and password)

Once the webphone is registered, the server should be able to send incoming calls to it.

The other reason can be if your server doesn’t handle NAT properly.
Please try to start the webphone with usestun parameter set to 0, and if still not works then try it with 2.

If the calls are still not coming, please send us a log (set the applet loglevel parameter to 4)


Q6.

Can you reduce the size of the applet?

Answer:

Although the default applet size is very small by default, we can reduce the size of your copy even more by removing some components not used by you. Contact us about the possibilities. You might be required to pay for this additional customization.


Q7.

How can I replace the applet certificate?

Answer:

To use a certificate that is recognized by Java installations on  the internet, you need to get a certificate from a certification authority that have their root certificates shipped and installed with the JDK/JRE. You can list the installed root certificates with the following command: keytool -list -keystore /usr/local/j2sdkXXX/jre/lib/security/cacerts (adapt the path to your installation, press ENTER when asked for a password)
We are providing the java applet with a selfsigned certificate. You can replace this ceritificate with yours that you can purchase from CA companies like VeriSign, Equifax Secure, Entrust, GTE Cyber Trust, Thawte, GeoTrust, BALTIMORE, etc.
You will need to request a "code signing digital certificate for java applet”.

To apply your certificate you can use the jarsigner tool. You can read more details here and here.

Example: 


check:
keytool -list -storetype pkcs12 -keystore codesigncert.pfx


get alias:
keytool -list -storetype pkcs12 -keystore codesigncert.pfx -v


sign jar:
jarsigner -storetype pkcs12 -keystore codesigncert.pfx -signedjar orig_webphone.jar result_webphone.jar KEY

Alternatively you can download a GUI for the jarsigner named KeyTool IUI
 


Q8.

Is there any way to get the source code?

Answer:

No. The applet is a close-source application.


Q9.

Can I buy 1,2,…,x license with a lower price?

Answer:

No. We are selling the webphone only with unlimited client usage. If you are not a VoIP service provider, please contact us to discuss the other pricing options.


Q10.

The demo examples are not working on my PC

Answer:

This issue can happen in some circumstances only if you launch the applet a from local file for testing (not from a web server).
Make sure that the file path is not too large for java. Copy the example directory to the C:\ directory and try again.
 


Q11.

How to customize the applet loader?

Answer:

You can use the JNLP deployment method with an icon parameter in the information section:
Example:
<information>
        <title>Mizu Webphone demo</title>
        <vendor>Mizutech</vendor>
    <href>"http://www.mizu-voip.com/"</href>
    <description>A VoIP client applet</description>
        <description kind="short">VoIP client application to initiate phone calls over the internet.</description>
    <icon href="http://www.mizu-voip.com/wicon.jpg"/>
        <icon kind="splash" href="http://www.mizu-voip.com/wicon.jpg"/>
    </information>

<icon>
Describes an icon/image that represents the application. Web Start uses the icons during startup in the download progress popup, for desktop shortcuts and in the Web Start application manager. 64x64 icons are shown in the download progress popup and 32x32 icons are used for desktop icons and in the Web Start app manager. Web Start automatically resizes icons with other dimensions.
Attributes:
href=url , required
    Contains a URL to a web location containing an image or an icon. Only JPEG and GIF graphic formats are supported.
version=version , optional
    Specifies the version of the image.
width=pixels , optional
    Describes the width of the icon in pixels.
height=pixels , optional
    Describes the height of the icon in pixels.
kind=default|selected|disabled|rollover, optional
    Describes the use of the icon. Default value is default.
depth=number , optional
    Describes the color depth of the image in bits-per-pixel. Common values are 8, 16, or 24.
size=bytes , optional
    Specifies the size of the image in bytes.


Q12.

Is it working with any VoIP servers?

Answer:

Yes. The webphone is using the SIP protocol standard to communicate with VoIP servers and sofswitches. Since most of the VoIP servers are based on the SIP protocol today the webphone should work without any issue.
If you have any incompatibility problem, please contact support@mizu-voip.com with a problem description and a detailed log (loglevel set to 4). For more tests please send us your VoIP server address with 3 test accounts.


Q13.

How to access the applet from Java Script?

Answer:

Example:
    function getMizuApplet()
    {
       if (theApplet == null) {
          theApplet = document.getElementById('webphone');
       }
       // See if we're using the old Java Plug-In and the JNLPAppletLauncher
       try {
          theApplet = theApplet.getSubApplet();
       } catch (e) {
          // Using new-style applet -- ignore
       }
    return theApplet;
    }

    // Call API_XXX() via the getMizuApplet() method
    getMizuApplet().API_XXX();


Q14.

Is it working with any mobile device?
 

Answer:

No. The webphone works only on devices that have Java Standard Edition. For Java Mobile Edition we have a separate client application that can be used to initiate calls, callbacks, phone to phone calls or send SMS message trough our VoIP server.


Q15.

Is it working with any browsers?

Answer:

We have made tests with all major browsers and we have not found any incompatibility issues. None of the existing users has applet or OS dependent issues.


Q16.

Can Mizutech do custom development if required?

Answer:

Yes, please contact us at support@mizu-voip.com.


Q17.

Are there benefits or drawbacks making SIP calls using Java applet vs a Flash component?

Answer:

Flash doesn’t have the codec’s commonly used in VoIP (such as g711 (pcmu/pcma), gsm, speex, g.729, g.723, etc) and plugins are not allowed. It has only its proprietary codec, so all implementation will need a separate “media gateway” which will do the conversion. Please note that codec conversion should be avoided in VoIP whenever possible because sound quality loss, high resource utilization, additional costs and additional network complexity.


Q18.

What is the default codec priority?

Answer:

Set its priority to 3 and set the priority for all other codes to 2. In this case you preferred codec will be used whenever the other endpoint supports it and other codec’s are used only if otherwise the call would fail.
If the codec’s has the same priority set by applet parameters (2 or 3) than the following priority order will be applied:
1.    speex ultrawideband
2.    speex wideband
3.    G.729
4.    PCMU
5.    PCMA
6.    speex narrowband
7.    GSM
(The other endpoint usually will pick up the first codec, or the webphone will pick-up the first in this list from the list of codec’s sent by the other peer)
*Please note that the G.729, GSM and speex narrowband codec’s are disabled by default. Set useg729,usegsm and usespeex to 2 or 3 to enable them. (Make sure you have the proper G.729 licenses)


Q19.

How to prefer one codec?

Answer:


Set its priority to 3 and set the priority for all other codes to 2. In this case you preferred codec will be used whenever the other endpoint supports it and other codec’s are used only if otherwise the call would fail.
For example the following parameters will set g.729 as the preferred codec:
    -useg729=3
    -usepcmu=2
   -usepcma=2
   -usegsm=2
   -usespeex=2
   -usespeexwb =2
   -usespeexuwb =2


Q20.

Example for DES encryption

Answer:



import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.spec.*;


public class DesEncrypter {
        Cipher ecipher;
        Cipher dcipher;
        String passPhrase = "XXX"; //get from Mizutech
        int iterationCount = 3;
        // 8-bytes Salt
        byte[] salt = {
            (byte)0xA9, (byte)0x9B, (byte)0xC8, (byte)0x32,
            (byte)0x56, (byte)0x34, (byte)0xE3, (byte)0x03
        };

       DesEncrypter()
       {
           try{
               KeySpec keySpec = new PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount);
               SecretKey key = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(keySpec);

               ecipher = Cipher.getInstance(key.getAlgorithm());
               dcipher = Cipher.getInstance(key.getAlgorithm());

               AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt,iterationCount);
               ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
               dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);

           } catch (Exception e) { Common.PutToDebugLogException("des ctor",e); }
       }

        public String encrypt(String str) {
            try {
                // Encode the string into bytes using utf-8
                byte[] utf8 = str.getBytes("UTF8");

                // Encrypt
                byte[] enc = ecipher.doFinal(utf8);

                // Encode bytes to base64 to get a string
                return 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 bytes
                byte[] dec = new sun.misc.BASE64Decoder().decodeBuffer(str);

                // Decrypt
                byte[] utf8 = dcipher.doFinal(dec);

                // Decode using utf-8
                return new String(utf8, "UTF8");
            } catch (Exception e) { Common.PutToDebugLogException("des decrypt",e); }
            return str;
        }
    }


Q21.

Example for XOR encryption

Answer:


public static String strxor(String str, String key) {
        try {
        String result = null;
        byte[] strBuf = str.getBytes();
        byte[] keyBuf = key.getBytes();
        int c = 0;
        int z = keyBuf.length;
        ByteArrayOutputStream baos = new ByteArrayOutputStream(strBuf.length);
        for (int i = 0; i < strBuf.length; i++) {
          byte bS = strBuf[i];
          byte bK = keyBuf[c];
          byte bO = (byte)(bS ^ bK);
          if (c < z - 1) {
            c++;
          } else {
            c = 0;
          }
          baos.write(bO);
        }

          baos.flush();
          result = baos.toString();
          baos.close();
          baos = null;
          return result;
        } catch (Exception e) { Common.PutToDebugLogException(3,"xor",e); }
        return str;
      }