Sure, thanks Martin!
I have changed the code to set the UUI, but still I am not getting the caller ID I set as part of UUI. Could you please have a look into below code snippet and let me know if I am missing anything?
try {
System.out.println("makeCall to number: " + numberToCall);
calledDevice = getDeviceID(numberToCall);
MakeCall request = new MakeCall();
request.setCallingDevice(getDeviceID(extension));
request.setCalledDirectoryNumber(calledDevice);
// ram edited start
String newNumber = "xxx973xxxx";
byte[] uui = { 0x01, 0x02, 0x03 };
// Length of new number
int numberLen = newNumber.length();
// Length of UUI data
int uuiLen = uui.length;
// Size of buffer needed
int byteLen = 7 + numberLen + uuiLen;
// length of 'Information element'
int ieLen = 5 + numberLen + uuiLen;
// length of the number section
int numSectionLen = 2 + numberLen;
byte[] ba = new byte[byteLen];
int count = 0;
ba[count++] = 0x7E;
ba[count++] = (byte)ieLen;
ba[count++] = 0x10;
ba[count++] = (byte)numSectionLen;
ba[count++] = 1;
ba[count++] = 0x21;
// Put in the number
for (int i = 0; i < newNumber.length(); i++)
{
ba[count++] = (byte)newNumber.indexOf(i);
}
// Put in the UUI
ba[count++] = (byte)uuiLen;
for (int i = 0; i < uuiLen; i++)
{
ba[count++] = uui[i];
}
UserData userData = new UserData();
userData.setString(ba);
request.setUserData(userData);
// ram edited end
MakeCallResponse response = callControlSvcs.makeCall(request);
// callLogGui.callBack(numberToCall);
// callLogGui.displayCallStatus(actionListener, numberToCall, response.getCallingDevice());
}
Thanks,
Ram
|