Code is pretty generic, taken from simpleRecord
OnSingleStepConferenceCallResponse(object sender, ThirdPartyCallController.SingleStepConferenceCallResponseArgs e)
{
if (e.getError.Length > 0)
{
Thread.Sleep(1000);
getThirdPartyCallController_OnSnapshotDeviceResponse(sender, lastSnapshotDeviceResponseArgsReceived);
return;
}
OnSnapshotDeviceResponse(object sender, ThirdPartyCallController.SnapshotDeviceResponseArgs e)
{
}
List<ThirdPartyCallController.SnapshotDeviceResponseArgs.DeviceInfo> LocalDeviceInfoList = e.getDeviceInfoList;
for (int cnt = 0; cnt < LocalDeviceInfoList.Count; cnt++)
{
ThirdPartyCallController.SnapshotDeviceResponseArgs.DeviceInfo devInfo;
devInfo = e.getDeviceInfoList[cnt];
int i;
// First thing we want to do is make sure all parties are in a connected state.
// We cannot do a single step conference on a call unless all parties are connected.
// If all parties are NOT connected simply sleep for 1 second and then do another
// snapsot device request.
for (i = 0; i < devInfo.getLocalConnectionStateList.Count; i++)
{
// Of course, there are always exceptions. If the connected state is null then a party who
// was once connected has dropped off. This is OK so just go on to the next party in the call.
if (devInfo.getLocalConnectionStateList[i].ToString() == "null")
continue;
string aa = devInfo.getLocalConnectionStateList[i].ToString();
if (devInfo.getLocalConnectionStateList[i].ToString() != "connected")
{
log.Debug("getThirdPartyCallController_OnSnapshotDeviceResponse sending another because all parties are not connected!");
Thread.Sleep(1000);
serviceProvider.getThirdPartyCallController.SnapshotDevice(e.getDeviceIdAsString, null);
return;
}
}
}
// Make sure we did not get an error. If we did, show the user and bail out
if (e.getError.Length > 0)
{
MessageBox.Show(e.getError);
return;
}
// If we got here then the call must be in an OK state to perform a single step conference.
// We need to save the information in lastSnapshotDeviceResponseArgsReceived. We will then
// request the contents of the display because we use the display name as part of the file name (when
// recording to the pc
lastSnapshotDeviceResponseArgsReceived = e;
//-----------------------------
string extensionToConferenceIn;
// Format the extension we want to conference in
extensionToConferenceIn = lastSnapshotDeviceResponseArgsReceived.getDeviceIdAsString; ;
extensionToConferenceIn = e.getDeviceIdAsString;
extensionToConferenceIn = extensionToConferenceIn.Substring(extensionToConferenceIn.IndexOf(":"));
extensionToConferenceIn = AssignAvailableRecordingThruExtension(GetExtension(e.getDeviceIdAsString)) + extensionToConferenceIn;
// Now attempt to conference in the recorder
ThirdPartyCallController.SnapshotDeviceResponseArgs.DeviceInfo devInfo1;
devInfo1 = (ThirdPartyCallController.SnapshotDeviceResponseArgs.DeviceInfo)lastSnapshotDeviceResponseArgsReceived.getDeviceInfoList[0];
serviceProvider.getThirdPartyCallController.SingleStepConferenceCall(devInfo1.getConnectionId,
extensionToConferenceIn,
Avaya.ApplicationEnablement.DMCC.ThirdPartyCallController.SingleStepConferenceCallParticipationType.Silent,
null);
currentRecordingExtension = GetExtension(e.getDeviceIdAsString);
//-----------------------------
// generate get display event for the extension we are trying to record
GetCurrentMonitoringDevice(GetExtension(e.getDeviceIdAsString)).getPhone.GetDisplay(null);
}
catch (Exception exc)
{
log.InfoFormat ("Exception in getThirdPartyCallController_OnSnapshotDeviceResponse: {0}", exc.Message);
}
}
|