summaryrefslogtreecommitdiff
path: root/src/libgsmd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgsmd')
-rw-r--r--src/libgsmd/libgsmd_voicecall.c25
1 files changed, 25 insertions, 0 deletions
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);
personal git repositories of Harald Welte. Your mileage may vary