mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix some callerid output
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -764,7 +764,7 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
|
|||||||
snprintf(passdata, passdatasize, "%d", msgnum);
|
snprintf(passdata, passdatasize, "%d", msgnum);
|
||||||
pbx_builtin_setvar_helper(ast, "VM_MSGNUM", passdata);
|
pbx_builtin_setvar_helper(ast, "VM_MSGNUM", passdata);
|
||||||
pbx_builtin_setvar_helper(ast, "VM_MAILBOX", mailbox);
|
pbx_builtin_setvar_helper(ast, "VM_MAILBOX", mailbox);
|
||||||
pbx_builtin_setvar_helper(ast, "VM_CALLERID", ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum));
|
pbx_builtin_setvar_helper(ast, "VM_CALLERID", ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum, "Unknown Caller"));
|
||||||
pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (cidname ? cidname : "an unknown caller"));
|
pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (cidname ? cidname : "an unknown caller"));
|
||||||
pbx_builtin_setvar_helper(ast, "VM_CIDNUM", (cidnum ? cidnum : "an unknown caller"));
|
pbx_builtin_setvar_helper(ast, "VM_CIDNUM", (cidnum ? cidnum : "an unknown caller"));
|
||||||
pbx_builtin_setvar_helper(ast, "VM_DATE", date);
|
pbx_builtin_setvar_helper(ast, "VM_DATE", date);
|
||||||
@@ -1395,7 +1395,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
|
|||||||
chan->exten,
|
chan->exten,
|
||||||
chan->priority,
|
chan->priority,
|
||||||
chan->name,
|
chan->name,
|
||||||
ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num),
|
ast_callerid_merge(callerid, sizeof(callerid), chan->cid.cid_name, chan->cid.cid_num, "Unknown"),
|
||||||
date, (long)time(NULL));
|
date, (long)time(NULL));
|
||||||
fclose(txt);
|
fclose(txt);
|
||||||
} else
|
} else
|
||||||
|
@@ -679,8 +679,10 @@ int ast_callerid_callwaiting_generate(unsigned char *buf, char *name, char *numb
|
|||||||
return __ast_callerid_generate(buf, name, number, 1, codec);
|
return __ast_callerid_generate(buf, name, number, 1, codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num)
|
char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown)
|
||||||
{
|
{
|
||||||
|
if (!unknown)
|
||||||
|
unknown = "<unknown>";
|
||||||
if (name && num)
|
if (name && num)
|
||||||
snprintf(buf, bufsiz, "\"%s\" <%s>", name, num);
|
snprintf(buf, bufsiz, "\"%s\" <%s>", name, num);
|
||||||
else if (name)
|
else if (name)
|
||||||
@@ -688,7 +690,7 @@ char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *nu
|
|||||||
else if (num)
|
else if (num)
|
||||||
strncpy(buf, num, bufsiz - 1);
|
strncpy(buf, num, bufsiz - 1);
|
||||||
else
|
else
|
||||||
strncpy(buf, "<unknown>", bufsiz - 1);
|
strncpy(buf, unknown, bufsiz - 1);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
int ast_callerid_split(const char *buf, char *name, int namelen, char *num, int numlen)
|
int ast_callerid_split(const char *buf, char *name, int namelen, char *num, int numlen)
|
||||||
|
@@ -165,7 +165,7 @@ extern int ast_isphonenumber(char *n);
|
|||||||
|
|
||||||
extern int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen);
|
extern int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen);
|
||||||
|
|
||||||
extern char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num);
|
extern char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Caller*ID and other GR-30 compatible generation
|
* Caller*ID and other GR-30 compatible generation
|
||||||
|
Reference in New Issue
Block a user