4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
7 * Sooyoung Ha <yoosah.ha@samsung.com>
8 * Sungmin Ha <sungmin82.ha@samsung.com>
9 * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
11 * This library is free software; you can redistribute it and/or modify it under
12 * the terms of the GNU Lesser General Public License as published by the
13 * Free Software Foundation; either version 2.1 of the License, or (at your option)
16 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
17 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
19 * License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this library; if not, write to the Free Software Foundation, Inc., 51
23 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 #include "at_gen_resp.h"
34 #include "at_tx_call.h"
36 #include "server_tx_call.h"
39 #include <vconf/vconf.h>
40 #include <vconf/vconf-keys.h>
42 int at_tx_call_incoming_noti(void *data, int len)
44 TRACE(MSGL_VGSM_INFO, "RING noti\n");
46 /* add block 130321 : flight mode on, rssi zero, call barring set */
47 bool flightMode = false;
48 bool icb = false; // incomming call barring
51 call_barring_entry_t * resp_entry = get_call_barring_entry();
53 flightMode = is_flight_mode();
56 TRACE(MSGL_VGSM_INFO, "entry is NULL!!!\n");
58 for(i=0; i<resp_entry[0].count; i++) {
59 TRACE(MSGL_VGSM_INFO,"i : %d, type : %d\n", i, resp_entry[i].type);
60 if(resp_entry[i].type == 4 && resp_entry[i].ss_mode == 3) { // 'All incoming calls' has set
66 if(vconf_get_int(VCONFKEY_TELEPHONY_RSSI, &rssi)) {
67 TRACE(MSGL_WARN, "vconf_get_int(%s) fail\n", VCONFKEY_TELEPHONY_RSSI);
70 if(rssi != 0 && icb == false && flightMode == false) {
71 TRACE(MSGL_VGSM_INFO, "call OK, %d, %d, %d \n", rssi, icb, flightMode);
72 char sndbuf[SEND_BUF_SIZE];
73 memset(sndbuf, '\0', sizeof(sndbuf));
75 sprintf(sndbuf, "%s%s", RING, CRLF);
76 at_msg_send(ACK_SEQ_NOTIFICATION, sndbuf, strlen(sndbuf));
77 return at_tx_call_status_noti(data, strlen((char*)data));
79 TRACE(MSGL_VGSM_INFO, "cannot RING a call, %d, %d, %d \n", rssi, icb, flightMode);
85 int at_tx_call_connect_noti(void *data, int len)
87 TRACE(MSGL_VGSM_INFO, "CONNECT noti\n");
88 return server_tx_call_list_noti();
91 int at_tx_call_waiting_noti(void *data, int len)
93 TRACE(MSGL_VGSM_INFO, "+CCWA noti\n");
94 char sndbuf[SEND_BUF_SIZE];
95 memset(sndbuf, '\0', sizeof(sndbuf));
97 sprintf(sndbuf, "%s%s%s", CCWA, (char*)data, CRLF);
98 return at_msg_send(ACK_SEQ_NOTIFICATION, sndbuf, strlen(sndbuf));
101 int at_tx_call_list_noti(void *data, int len)
103 TRACE(MSGL_VGSM_INFO, "+CLCC noti\n");
104 return at_msg_send(ACK_SEQ_NOTIFICATION, data, len);
107 int at_tx_call_list_resp(void *data, int len)
109 TRACE(MSGL_VGSM_INFO, "+CLCC resp\n");
110 return at_msg_send(ACK_SEQ_RESPONSE, data, len);
113 int at_tx_call_status_noti(void *data, int len)
115 TRACE(MSGL_VGSM_INFO, "%%SCLCC noti\n");
116 char sndbuf[SEND_BUF_SIZE];
117 memset(sndbuf, '\0', sizeof(sndbuf));
119 sprintf(sndbuf, "%s%s%s", SCLCC, (char*)data, CRLF);
120 TRACE(MSGL_VGSM_INFO, "%s", sndbuf);
121 return at_msg_send(ACK_SEQ_NOTIFICATION, sndbuf, strlen(sndbuf));
124 int at_tx_call_burst_dtmf_noti(void *data, int len)
126 TRACE(MSGL_VGSM_INFO, "noti\n");
128 // return at_msg_send(ACK_SEQ_NOTIFICATION, data, len);
131 int at_tx_call_line_id_resp(void *data, int len)
133 TRACE(MSGL_VGSM_INFO, "resp\n");
135 // return at_msg_send(ACK_SEQ_RESPONSE, data, len);
138 int at_tx_call_gen_resp(char* resp)
140 TRACE(MSGL_VGSM_INFO, "call gen resp\n");
141 return at_gen_resp_send(resp);