From a04e6effed0b81ec7495df2a1448484645b20cc5 Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 12 Jan 2007 23:57:33 +0000 Subject: - use talloc (of samba project) to debug memory allocations and simplify code - introduce new ucmd_alloc() function - add DTMF support to gsmd, libgsmd and gsmd-util - fix crash of libgsmd when events don't have handlers registered - implement call progress for TI modem - split modem init string in separate commands to fit our parser git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@544 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/libgsmd/libgsmd_voicecall.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/libgsmd') diff --git a/src/libgsmd/libgsmd_voicecall.c b/src/libgsmd/libgsmd_voicecall.c index 2a1d6e6..b21ca37 100644 --- a/src/libgsmd/libgsmd_voicecall.c +++ b/src/libgsmd/libgsmd_voicecall.c @@ -51,6 +51,31 @@ int lgsm_voice_out_init(struct lgsm_handle *lh, return 0; } +int lgsm_voice_dtmf(struct lgsm_handle *lh, char dtmf_char) +{ + struct gsmd_msg_hdr *gmh; + struct gsmd_dtmf *gd; + int rc; + + gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL, + GSMD_VOICECALL_DTMF, sizeof(*gd)+1); + if (!gmh) + return -ENOMEM; + gd = (struct gsmd_dtmf *) gmh->data; + gd->len = 1; + gd->dtmf[0] = dtmf_char; + + rc = lgsm_send(lh, gmh); + if (rc < gmh->len + sizeof(*gd)+1) { + lgsm_gmh_free(gmh);; + return -EIO; + } + + lgsm_gmh_free(gmh); + + return 0; +} + int lgsm_voice_in_accept(struct lgsm_handle *lh) { return lgsm_send_simple(lh, GSMD_MSG_VOICECALL, GSMD_VOICECALL_ANSWER); -- cgit v1.2.3