Set AXL Server of Phone Systems Problem

Version 1
    This document was generated from CDN thread

    Created by: chao guo on 17-11-2013 09:09:06 PM
    Hi Team,

    Problem of Add AXL Servers of Phone System.
     
    We met a problem that using the interface to add the AXL Server of Phone System, when AXL Server added successfully; the AXL Server cannot test successfully.
     
    But when I add the AXL Server of Phone System manually, the AXL Server can be tested successfully.
     
    Details like the following:
     
    1: Using interface to add the AXL Server
     1public static boolean  addAXLServers(String authorization, String unityIp)
     2        throws HttpConnectionException {
     3      boolean flag = false;
     4      byte[] bArray = null;
     5      Socket socket = null;
     6      OutputStream out = null;
     7      InputStream in = null;
     8      String sAXLSOAPRequest = "";
     9      String sAXLRequest = null;
    10      authorization = new sun.misc.BASE64Encoder().encode(authorization
    11           .getBytes());
    12      sAXLSOAPRequest = "POST /vmrest/phonesystems/8a331e2c-c265-4f8f-b0c7-04898b0f29df/axlservers  HTTP/1.0\r\n";
    13      sAXLSOAPRequest += "Host:localhost:8443\r\n";
    14      sAXLSOAPRequest += "Authorization: Basic " + authorization + "\r\n";
    15      sAXLSOAPRequest += "Accept: application/*\r\n";
    16      sAXLSOAPRequest += "Content-type: application/xml\r\n";
    17      sAXLSOAPRequest += "Content-length: ";
    18      sAXLRequest = "";
    19      sAXLRequest += "<AXLServer>";
    20      sAXLRequest += "<MediaSwitchObjectId>8a331e2c-c265-4f8f-b0c7-04898b0f29df</MediaSwitchObjectId>";
    21      sAXLRequest += "<MediaRemoteServiceEnum>103</MediaRemoteServiceEnum>";
    22      sAXLRequest += "<HostOrIPAddress>192.168.0.106</HostOrIPAddress>";
    23      sAXLRequest += "<Port>8443</Port>";
    24      sAXLRequest += "<Precedence>0</Precedence>";
    25      sAXLRequest += "<CcmAXLUser>admin</CcmAXLUser>";
    26      sAXLRequest += "<CcmAXLPassword>ccie#13241</CcmAXLPassword>";
    27      sAXLRequest += "</AXLServer>";
    28      sAXLSOAPRequest += sAXLRequest.length();
    29      sAXLSOAPRequest += "\r\n\r\n";
    30      sAXLSOAPRequest += sAXLRequest;
    31      try {
    32        X509TrustManager xtm = new MyTrustManager();
    33        TrustManager[] mytm = { xtm };
    34        SSLContext ctx;
    35        ctx = SSLContext.getInstance("SSL");
    36        ctx.init(null, mytm, null);
    37        SSLSocketFactory sslFact = (SSLSocketFactory) ctx
    38              .getSocketFactory();
    39        socket = (SSLSocket) sslFact.createSocket(unityIp, 8443);
    40        in = socket.getInputStream();
    41        StringBuffer sb = new StringBuffer(2048);
    42        bArray = new byte[2048];
    43        int ch = 0;
    44        int sum = 0;
    45        out = socket.getOutputStream();
    46        out.write(sAXLSOAPRequest.getBytes());
    47        while ((ch = in.read(bArray)) != -1) {
    48           sum += ch;
    49           sb.append(new String(bArray, 0, ch));
    50        }
    51        socket.close();
    52        logger.info(sb.toString());
    53        flag = true;
    54      } catch (Exception e) {
    55        throw new HttpConnectionException();
    56      }
    57      return flag;
    58   }

    Using the method above, we can added the AXL Server. But Test Connection to CUCM failed. 
     
    2: Manually to add the AXL Server using the same configuration info which is used in the interface. Add successfully, Test Connection to CUCM Successful.

    From the above, we can find the difference between using interface to added the AXL Server and Manually.
     
    The difference is “Connection Password”.
     
    When I using interface to add the AXL Server, the Connection password is insert into the unity connection system directly. But manually added, I think the password which user input has been encrypted 
    by unity connection system again.
     
    How can we deal with it? Because we don’t know the encryption of unity connection system.