aboutsummaryrefslogtreecommitdiffstats
path: root/call.c
blob: 8d86f61f49059ef6bb12e89e1686924b63c6c24b (plain)
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
/**
 * This file is part of libmsm-h1.
 *
 * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
 *
 * libmsm-h1 is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * libmsm-h1 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with libmsm-h1.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <call.h>
#include "radio_internal.h"

void msm_call_outgoing(const char *number, int identity, int request_id)
{
	struct msm_call_outgoing call;

	memset(&call, 0x00, sizeof(call));

	if(strlen(number) > 82) {
		printf("Outgoing call number too long\n");
		return;
	}

	call.type = MSM_CALL_TYPE_VOICE;
	call.identity = identity;
	call.prefix = MSM_CALL_PREFIX_NONE;

	call.length = strlen(number);
	memcpy(call.number, number, strlen(number));

	msm_send(MSM_CALL_OUTGOING, MSM_TYPE_EXEC, (unsigned char*)&call, sizeof(call), request_id);
}

void msm_call_release(int request_id)
{
	msm_send_exec(MSM_CALL_RELEASE, request_id);
}

void msm_call_answer(int request_id)
{
	msm_send_exec(MSM_CALL_ANSWER, request_id);
}

void msm_call_list(int request_id)
{
	msm_send_get(MSM_CALL_LIST, request_id);
}