summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-19 09:34:34 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-19 09:34:34 +0000
commit5f522a277d5ac93bae9d993cabc0f3e7b3dbb59e (patch)
treef4a1a4a61b01489242ad115921ecbbc1a09706c4 /src/util
parentcbbf4601211669ededac8d41d6adaec277af3e3b (diff)
gsmd: set and get Voicemail number (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3684 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r--src/util/shell.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/util/shell.c b/src/util/shell.c
index e621e33..a8109df 100644
--- a/src/util/shell.c
+++ b/src/util/shell.c
@@ -285,6 +285,9 @@ static int net_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
((void *) gmh + sizeof(*gmh));
const struct gsmd_own_number *num = (struct gsmd_own_number *)
((void *) gmh + sizeof(*gmh));
+ const struct gsmd_voicemail *vmail = (struct gsmd_voicemail *)
+ ((void *) gmh + sizeof(*gmh));
+ int result = *(int *) gmh->data;
static const char *oper_stat[] = {
[GSMD_OPER_UNKNOWN] = "of unknown status",
[GSMD_OPER_AVAILABLE] = "available",
@@ -341,6 +344,18 @@ static int net_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
"" : " services");
pending_responses --;
break;
+ case GSMD_NETWORK_VMAIL_SET:
+ if (result)
+ printf("Set voicemail error %i\n", result);
+ else
+ printf("Set voicemail OK \n");
+ pending_responses --;
+ break;
+ case GSMD_NETWORK_VMAIL_GET:
+ if(vmail->addr.number)
+ printf ("voicemail number is %s \n",vmail->addr.number);
+ pending_responses --;
+ break;
default:
return -EINVAL;
}
@@ -481,6 +496,8 @@ static int shell_help(void)
"\tsM\tSMS Set preferred storage (sM=mem1,mem2,mem3)\n"
"\tsc\tSMS Show Service Centre\n"
"\tsC\tSMS Set Service Centre (sC=number)\n"
+ "\tgvm\tGet Voicemail number\n"
+ "\tsvm\tSet Voicemail number(svm=number)\n"
"\tim\tGet imsi\n"
"\tcs\tGet Call status\n"
"\tgp\tGet PIN status\n"
@@ -766,6 +783,18 @@ int shell_main(struct lgsm_handle *lgsmh, int sync)
} else if (!strcmp(buf, "n")) {
lgsm_get_subscriber_num(lgsmh);
pending_responses ++;
+ } else if ( !strncmp(buf, "gvm", 3)) {
+ printf("Get Voicemail Number\n");
+ lgsm_voicemail_get(lgsmh);
+ pending_responses ++;
+ } else if ( !strncmp(buf, "svm", 3)) {
+ printf("Set Voicemail Number\n");
+ ptr = strchr(buf, '=');
+ if (!ptr || strlen(ptr) < 3)
+ printf("No.\n");
+ else
+ lgsm_voicemail_set(lgsmh, ptr + 1);
+ pending_responses ++;
} else if (!strncmp(buf, "im", 2)) {
printf("Get imsi\n");
lgsm_get_imsi(lgsmh);
personal git repositories of Harald Welte. Your mileage may vary