Author Message
AlexPupkin
Joined: Feb 8, 2012
Messages: 17
Offline
Is there some way to place Call outside (for example, to smb cellphone) from device,registered as Third Party Device?

Only way I know to do so, is to register device and and sequentialyl call PressButtonCommand for each digit.
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
Yes. Use makeCall(), just as you would do when making an internal call.

Martin
AlexPupkin
Joined: Feb 8, 2012
Messages: 17
Offline
But,AFAIK (accoording to manual),MakeCall requires two params: source ThirdPartyDeviceId and called ThirdPartyDeviceId , how can i use it to make call to external number?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
Just pass the digits you want to dial into getThirdPartyDeviceID(), same as if you were making a local call.
AlexPupkin
Joined: Feb 8, 2012
Messages: 17
Offline
Thanks!

Could?i pass params in MakeCall() as strings in proper format ([extension]:[switchname]:[swithip],[instance]) besides of calling corresponding method for both parties?

MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
You should always use GetDevieID or GetThirdPartyDeviceID as there is no guarantee that the format will not change in future.

Martin
AlexPupkin
Joined: Feb 8, 2012
Messages: 17
Offline
Maybe somebody could help me. I just need to get 3rd party device and start monitoring it. Here is my code.

void foo()
{
int InvokeId = sp.getThirdPartyCallController.GetThirdPartyDeviceId("CM", "3257", null);
sp.getThirdPartyCallController.OnGetThirdPartyDeviceIdResponse += getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse;
ThirdPartyCallController.ThirdPartyCallControlEvents ev = new ThirdPartyCallController.ThirdPartyCallControlEvents(true);
int i = sp.getThirdPartyCallController.StartMonitor(TPDeviceId, ev, null);
}

void getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse(object sender,
ThirdPartyCallController.GetThirdPartyDeviceIdResponseArgs e)
{
try
{

if (e.getError != "")
{

}
else
{
TPDeviceId = e.getDeviceIdAsString;
}
}
}
catch (Exception) { }
}

Only way i know to get deviceid is to get it while process OnGetThirdPartyDeviceIdResponse event. But it not fires immediately i call GetThirdPartyDeviceId,so in moment i ty to call StartMonitor - param is empty yet.
What i'm doing wrong?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
GetThirdPartyDeviceId() is an asynchronous call which will lead to the callback, getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse(), being executed some time in the future. This may happen in 1mS or it may take several hours. In any case, almost always, getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse() will be executed AFTER your call to startMonitor(). In this case, TPDeviceId to be null (or whatever you initialised it to be).

An apparent solution is to move StartMonitor() into getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse(), after TPDeviceId = e.getDeviceIdAsString. This means that StartMonitor() will only be called when TPDeviceId ia available.

Even this solution is flawed as it would mean that your application is using the DMCC SDK event thread to make API calls. You should not do this as it can cause a bottleneck. Instead, you should process the response using your own thread. One way to do this is to use getThirdPartyCallController_OnGetThirdPartyDeviceIdResponse() to put the response onto your own internal queue where you can process it using your own thread.

I would also suggest that you make sure to add the callback to the callback list BEFORE calling GetThirdPartyDeviceId(). Otherwise there is a tiny possibility that the response will come back before the callback is in place.

Martin
Go to:   
Mobile view