Author Message
Ram_A
Joined: Sep 23, 2021
Messages: 5
Offline
Hi Team,

Could you please guide me setting a caller id as part of makecall request? any sample code would be greatly appreciated.

I am using the click2call(ccs) sample application and able to place a call using h.323 extension to a phone number. But I am not able to find the option to set the caller id. When calls goes out on a phone number the caller id I am seeing is extended extension number. But I want to set a different caller id so that when called party calls back it goes to IVR/wherever I wanted instead of calling party extension directly.

Thanks
Ram
MartinFlynn
Joined: Nov 30, 2009
Messages: 1825
Offline
I think you want to use the Special Application SA8481. You can find information on this by searching this forum. One useful thread is https://www.devconnectprogram.com/forums/posts/list/21965.page

Martin
Ram_A
Joined: Sep 23, 2021
Messages: 5
Offline
Thanks Martin for your quick reply, if I am not wrong the link you shared is talking about how to set the UUI, also I might not understand completely as they are not Java examples.
I am talking about setting the custom CLI/caller id. Could you please share any java examples that are available?

Below is the snippet of code I am using to make call.

calledDevice = getDeviceID(numberToCall);
MakeCall request = new MakeCall();
request.setCallingDevice(getDeviceID(extension));
request.setCalledDirectoryNumber(calledDevice);

MakeCallResponse response = callControlSvcs.makeCall(request);

Please let me know if you need more details.

Thanks,
Ram
MartinFlynn
Joined: Nov 30, 2009
Messages: 1825
Offline
Yes, with SA8481, the application places the fake called ID into UserData using a special format. When CM gets UserData in this format, it replaces the Calling ID with this number.

I don't have any Java sample code to hand but, if you search this forum, you may find some in a previous thread. In any case, the Java code should be very similar to the .Net code.

Martin
Ram_A
Joined: Sep 23, 2021
Messages: 5
Offline
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
MartinFlynn
Joined: Nov 30, 2009
Messages: 1825
Offline
Hi Ram,

Unfortunately, I cannot provide any more in-depth support on the forum. If you need further help with this, you should open a Devconnect Technical Support ticket. Please note that there may be a fee for further support.

Martin
Go to:   
Mobile view