Generate Licence file
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_call.c
1 /*
2  * tel-plugin-at_standard
3  *
4  * Copyright (c) 2012 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22
23 #include <glib.h>
24
25 #include <tcore.h>
26 #include <server.h>
27 #include <plugin.h>
28 #include <core_object.h>
29 #include <co_call.h>
30
31 #include "at_call.h"
32
33 static TReturn call_dial(CoreObject *co, UserRequest *ur)
34 {
35         return TCORE_RETURN_ENOSYS;
36 }
37
38 static TReturn call_answer(CoreObject *co, UserRequest *ur)
39 {
40         return TCORE_RETURN_ENOSYS;
41 }
42
43 static TReturn call_release(CoreObject *co, UserRequest *ur)
44 {
45         return TCORE_RETURN_ENOSYS;
46 }
47
48 static TReturn call_hold(CoreObject *co, UserRequest *ur)
49 {
50         return TCORE_RETURN_ENOSYS;
51 }
52
53 static TReturn call_active(CoreObject *co, UserRequest *ur)
54 {
55         return TCORE_RETURN_ENOSYS;
56 }
57
58 static TReturn call_swap(CoreObject *co, UserRequest *ur)
59 {
60         return TCORE_RETURN_ENOSYS;
61 }
62
63 static TReturn call_join(CoreObject *co, UserRequest *ur)
64 {
65         return TCORE_RETURN_ENOSYS;
66 }
67
68 static TReturn call_split(CoreObject *co, UserRequest *ur)
69 {
70         return TCORE_RETURN_ENOSYS;
71 }
72
73 static TReturn call_deflect(CoreObject *co, UserRequest *ur)
74 {
75         return TCORE_RETURN_ENOSYS;
76 }
77
78 static TReturn call_transfer(CoreObject *co, UserRequest *ur)
79 {
80         return TCORE_RETURN_ENOSYS;
81 }
82
83 static TReturn send_dtmf(CoreObject *co, UserRequest *ur)
84 {
85         return TCORE_RETURN_ENOSYS;
86 }
87
88 static TReturn call_mute(CoreObject *co, UserRequest *ur)
89 {
90         return TCORE_RETURN_ENOSYS;
91 }
92
93 static TReturn call_unmute(CoreObject *co, UserRequest *ur)
94 {
95         return TCORE_RETURN_ENOSYS;
96 }
97
98 static TReturn call_get_mute_status(CoreObject *co, UserRequest *ur)
99 {
100         return TCORE_RETURN_ENOSYS;
101 }
102
103 static struct tcore_call_operations call_ops = {
104         .dial = call_dial,
105         .answer = call_answer,
106         .end = call_release,
107         .hold = call_hold,
108         .active = call_active,
109         .swap = call_swap,
110         .join = call_join,
111         .split = call_split,
112         .deflect = call_deflect,
113         .transfer = call_transfer,
114         .send_dtmf = send_dtmf,
115         .set_sound_path = NULL,
116         .set_sound_volume_level = NULL,
117         .get_sound_volume_level = NULL,
118         .mute = call_mute,
119         .unmute = call_unmute,
120         .get_mute_status = call_get_mute_status,
121         .set_sound_recording = NULL,
122         .set_sound_equalization = NULL,
123         .set_sound_noise_reduction = NULL,
124 };
125
126 static struct tcore_call_control_operations call_control_ops = {
127         .answer_hold_and_accept = NULL,
128         .answer_replace = NULL,
129         .answer_reject = NULL,
130         .end_specific = NULL,
131         .end_all_active = NULL,
132         .end_all_held = NULL,
133         .active = NULL,
134         .hold = NULL,
135         .swap = NULL,
136         .join = NULL,
137         .split = NULL,
138         .transfer = NULL,
139         .deflect = NULL,
140 };
141
142 gboolean at_call_init(TcorePlugin *cp)
143 {
144         CoreObject *co;
145         Server *server;
146
147         co = tcore_call_new(cp, &call_ops, NULL);
148         if (co == NULL)
149                 return FALSE;
150
151         tcore_call_control_set_operations(co, &call_control_ops);
152
153         server = tcore_plugin_ref_server(cp);
154         tcore_server_add_template_object(server, co);
155
156         return TRUE;
157 }
158
159 void at_call_exit(TcorePlugin *cp)
160 {
161         CoreObject *co;
162
163         if (cp == NULL)
164                 return;
165
166         co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_CALL);
167         if (co == NULL)
168                 return;
169
170         tcore_object_free(co);
171 }