-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSoapCallClient.cs
More file actions
66 lines (55 loc) · 2.22 KB
/
Copy pathSoapCallClient.cs
File metadata and controls
66 lines (55 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using CallFire_csharp_sdk.Common.DataManagement;
using CallFire_csharp_sdk.Common.Resource;
using CallFire_csharp_sdk.Common.Resource.Mappers;
using CallFire_csharp_sdk.Common.Result;
using CallFire_csharp_sdk.Common.Result.Mappers;
namespace CallFire_csharp_sdk.API.Soap
{
public class SoapCallClient : BaseSoapClient, ICallClient
{
internal ICallServicePortTypeClient CallService;
public SoapCallClient(string username, string password)
{
CallService = new CallServicePortTypeClient(GetCustomBinding(), GetEndpointAddress<Call>())
{
ClientCredentials = { UserName = { UserName = username, Password = password } }
};
}
internal SoapCallClient(ICallServicePortTypeClient client)
{
CallService = client;
}
public long SendCall(CfSendCall cfSendCall)
{
return CallService.SendCall(new SendCall(cfSendCall));
}
public CfCallQueryResult QueryCalls(CfActionQuery cfActionQuery)
{
return CallQueryResultMapper.FromCallQueryResult(CallService.QueryCalls(new ActionQuery(cfActionQuery)));
}
public CfCall GetCall(long id)
{
return CallMapper.FromCall(CallService.GetCall(new IdRequest(id)));
}
public long CreateSound(CfCreateSound cfCreateSound, CfSoundFormat cfSoundFormat)
{
return CallService.CreateSound(new CreateSound(cfCreateSound));
}
public CfSoundMetaQueryResult QuerySoundMeta(CfQuery cfQuerySoundMeta)
{
return SoundMetaQueryResultMapper.FromSoundMetaQueryResult(CallService.QuerySoundMeta(new Query(cfQuerySoundMeta)));
}
public CfSoundMeta GetSoundMeta(long id)
{
return SoundMetaMapper.FromSoundMeta(CallService.GetSoundMeta(new IdRequest(id)));
}
public byte[] GetSoundData(CfGetSoundData cfGetSoundData)
{
return CallService.GetSoundData(new GetSoundData(cfGetSoundData));
}
public byte[] GetRecordingData(CfGetRecordingData cfGetRecordingData)
{
return CallService.GetRecordingData(new GetRecordingData(cfGetRecordingData));
}
}
}