summaryrefslogtreecommitdiff
path: root/src/libgsmd
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-01-03 09:13:39 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-01-03 09:13:39 +0000
commit315e8b45506745f4b28f658772cc65cdef9a2d9e (patch)
treeaa5ee79cba4688243461ee896e068d6fc1787671 /src/libgsmd
parent6cf14fb22b3bb03822fd0b09d633913fc3ecea64 (diff)
gsmd: add Call Forwarding function (Sean Chiang)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3760 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/libgsmd')
-rw-r--r--src/libgsmd/libgsmd_voicecall.c123
1 files changed, 123 insertions, 0 deletions
diff --git a/src/libgsmd/libgsmd_voicecall.c b/src/libgsmd/libgsmd_voicecall.c
index 8804cce..c40ea51 100644
--- a/src/libgsmd/libgsmd_voicecall.c
+++ b/src/libgsmd/libgsmd_voicecall.c
@@ -125,3 +125,126 @@ int lgsm_voice_ctrl(struct lgsm_handle *lh, const struct lgsm_voicecall_ctrl *ct
return 0;
}
+
+int lgsm_voice_fwd_disable(struct lgsm_handle *lh,
+ enum lgsmd_voicecall_fwd_reason reason)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL,
+ GSMD_VOICECALL_FWD_DIS, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *) gmh->data = reason;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);;
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
+
+int lgsm_voice_fwd_enable(struct lgsm_handle *lh,
+ enum lgsmd_voicecall_fwd_reason reason)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL,
+ GSMD_VOICECALL_FWD_EN, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *) gmh->data = reason;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);;
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
+
+int lgsm_voice_fwd_stat(struct lgsm_handle *lh,
+ enum lgsmd_voicecall_fwd_reason reason)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL,
+ GSMD_VOICECALL_FWD_STAT, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *) gmh->data = reason;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);;
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
+
+int lgsm_voice_fwd_reg(struct lgsm_handle *lh,
+ struct lgsm_voicecall_fwd_reg *fwd_reg)
+{
+ struct gsmd_msg_hdr *gmh;
+ struct gsmd_call_fwd_reg *gcfr;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL,
+ GSMD_VOICECALL_FWD_REG, sizeof(struct gsmd_call_fwd_reg));
+ if (!gmh)
+ return -ENOMEM;
+
+ gcfr = (struct gsmd_call_fwd_reg *)gmh->data;
+ gcfr->reason = fwd_reg->reason;
+ strcpy(gcfr->addr.number, fwd_reg->number.addr);
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);;
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
+
+int lgsm_voice_fwd_erase(struct lgsm_handle *lh,
+ enum lgsmd_voicecall_fwd_reason reason)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_VOICECALL,
+ GSMD_VOICECALL_FWD_ERAS, sizeof(int));
+ if (!gmh)
+ return -ENOMEM;
+
+ *(int *) gmh->data = reason;
+
+ rc = lgsm_send(lh, gmh);
+ if (rc < gmh->len + sizeof(*gmh)) {
+ lgsm_gmh_free(gmh);;
+ return -EIO;
+ }
+
+ lgsm_gmh_free(gmh);
+
+ return 0;
+}
personal git repositories of Harald Welte. Your mileage may vary