Asterisk chinese voicemail intro

Let's Asterisk Speak Chinese Usage.

Change asterisk-sources/apps/app_voicemail.c add Function vm_intro_cn in every where


/* Chinese syntax
-----------------------------------------
By hoowa sun 2007-2-5
*/
static int vm_intro_cn(struct ast_channel *chan,struct vm_state *vms)
{
/* Introduce messages they have */
int res;
if (vms->newmessages || vms->oldmessages)
{
res = ast_play_and_wait(chan, "vm-youhave");
if (vms->newmessages) {
res = say_and_wait(chan, vms->newmessages, chan->language);
if (!res)
res = ast_play_and_wait(chan, "vm-line");
res = ast_play_and_wait(chan, "vm-INBOX");
if (vms->oldmessages && !res)
res = ast_play_and_wait(chan, "vm-and");
else if (!res) {
if ((vms->newmessages == 1))
res = ast_play_and_wait(chan, "vm-message");
else
res = ast_play_and_wait(chan, "vm-messages");
}

}
if (!res && vms->oldmessages) {
res = say_and_wait(chan, vms->oldmessages, chan->language);
if (!res)
res = ast_play_and_wait(chan, "vm-line");
res = ast_play_and_wait(chan, "vm-Old");
if (!res) {
if (vms->oldmessages == 1)
res = ast_play_and_wait(chan, "vm-message");
else
res = ast_play_and_wait(chan, "vm-messages");
}
}
} else {
res = ast_play_and_wait(chan, "vm-you");
res = ast_play_and_wait(chan, "vm-no");
if (!res)
res = ast_play_and_wait(chan, "vm-messages");
}
return res;
}



Change asterisk-sources/apps/app_voicemail.c modify function vm_intro


add this
} else if (!strcasecmp(chan->language, "cn")) { /* CHINA syntax by hoowa sun */
return vm_intro_cn(chan, vms);

after
} else if (!strcasecmp(chan->language, "no")) { /* NORWEGIAN syntax */
return vm_intro_no(chan, vms);


change asterisk-source/apps/app_voicemail.c add


/* Chinese syntax
by hoowa.sun 2007-2-5
*/
static int vm_browse_messages_cn(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;

if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);
} else {
cmd = ast_play_and_wait(chan, "vm-you");
if (!cmd)
cmd = ast_play_and_wait(chan, "vm-no");
if (!cmd) {
snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox);
cmd = ast_play_and_wait(chan, vms->fn);
}
if (!cmd)
cmd = ast_play_and_wait(chan, "vm-messages");
}
return cmd;
}


Change asterisk-sources/apps/app_voicemail.c modify function vm_browse_messages


add this
} else if (!strcasecmp(chan->language, "cn")){
return vm_browse_messages_cn(chan, vms, vmu); /* CHINA hoowa.sun */

after
} else if (!strcasecmp(chan->language, "gr")){
return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */




make && make install


if your select chinese will be better speaks

hoowa.sun

:)

Let's Asterisk Speak Chinese Usage.

Change asterisk-sources/apps/app_voicemail.c add Function vm_intro_cn in every where


/* Chinese syntax
-----------------------------------------
By hoowa sun 2007-2-5
*/
static int vm_intro_cn(struct ast_channel *chan,struct vm_state *vms)
{
/* Introduce messages they have */
int res;
if (vms->newmessages || vms->oldmessages)
{
res = ast_play_and_wait(chan, "vm-youhave");
if (vms->newmessages) {
res = say_and_wait(chan, vms->newmessages, chan->language);
if (!res)
res = ast_play_and_wait(chan, "vm-line");
res = ast_play_and_wait(chan, "vm-INBOX");
if (vms->oldmessages && !res)
res = ast_play_and_wait(chan, "vm-and");
else if (!res) {
if ((vms->newmessages == 1))
res = ast_play_and_wait(chan, "vm-message");
else
res = ast_play_and_wait(chan, "vm-messages");
}

}
if (!res && vms->oldmessages) {
res = say_and_wait(chan, vms->oldmessages, chan->language);
if (!res)
res = ast_play_and_wait(chan, "vm-line");
res = ast_play_and_wait(chan, "vm-Old");
if (!res) {
if (vms->oldmessages == 1)
res = ast_play_and_wait(chan, "vm-message");
else
res = ast_play_and_wait(chan, "vm-messages");
}
}
} else {
res = ast_play_and_wait(chan, "vm-you");
res = ast_play_and_wait(chan, "vm-no");
if (!res)
res = ast_play_and_wait(chan, "vm-messages");
}
return res;
}



Change asterisk-sources/apps/app_voicemail.c modify function vm_intro


add this
} else if (!strcasecmp(chan->language, "cn")) { /* CHINA syntax by hoowa sun */
return vm_intro_cn(chan, vms);

after
} else if (!strcasecmp(chan->language, "no")) { /* NORWEGIAN syntax */
return vm_intro_no(chan, vms);


change asterisk-source/apps/app_voicemail.c add


/* Chinese syntax
by hoowa.sun 2007-2-5
*/
static int vm_browse_messages_cn(struct ast_channel *chan, struct vm_state *vms, struct ast_vm_user *vmu)
{
int cmd=0;

if (vms->lastmsg > -1) {
cmd = play_message(chan, vmu, vms);
} else {
cmd = ast_play_and_wait(chan, "vm-you");
if (!cmd)
cmd = ast_play_and_wait(chan, "vm-no");
if (!cmd) {
snprintf(vms->fn, sizeof(vms->fn), "vm-%s", vms->curbox);
cmd = ast_play_and_wait(chan, vms->fn);
}
if (!cmd)
cmd = ast_play_and_wait(chan, "vm-messages");
}
return cmd;
}


Change asterisk-sources/apps/app_voicemail.c modify function vm_browse_messages


add this
} else if (!strcasecmp(chan->language, "cn")){
return vm_browse_messages_cn(chan, vms, vmu); /* CHINA hoowa.sun */

after
} else if (!strcasecmp(chan->language, "gr")){
return vm_browse_messages_gr(chan, vms, vmu); /* GREEK */




make && make install


if your select chinese will be better speaks

hoowa.sun

:)

Created by: hoowa, Last modification: Mon 05 of Feb, 2007 (07:56 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+