diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/shell.c | 29 |
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); |