aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_vpb.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 04:25:21 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-03 04:25:21 +0000
commit4c50c16addfc846eefccf8d517e696a23e869bd1 (patch)
tree9e29310d1f0916eaa0b2301492a9ed5f1c5e093a /channels/chan_vpb.c
parent9f9c7882f4f3b0b592576b1f9a44a44b77c4d472 (diff)
Blocked revisions 36725 via svnmerge
........ r36725 | russell | 2006-07-03 00:19:09 -0400 (Mon, 03 Jul 2006) | 4 lines use ast_set_callerid to be more consistent and to make sure that the "callerid" option in the conf files is always handled the same way and sets ANI (issue #7285, gkloepfer) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@36726 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_vpb.c')
-rw-r--r--channels/chan_vpb.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c
index 836150219..d615e606a 100644
--- a/channels/chan_vpb.c
+++ b/channels/chan_vpb.c
@@ -804,18 +804,14 @@ static void get_callerid_ast(struct vpb_pvt *p)
}
if (number)
ast_shrink_phone_number(number);
- if (!ast_strlen_zero(number)) {
- owner->cid.cid_num = strdup(number);
- owner->cid.cid_ani = strdup(number);
- if (!ast_strlen_zero(name)){
- owner->cid.cid_name = strdup(name);
- snprintf(p->callerid,(sizeof(p->callerid)-1),"%s %s",number,name);
- }
- else {
- snprintf(p->callerid,(sizeof(p->callerid)-1),"%s",number);
- }
+ ast_set_callerid(owner,
+ number, name,
+ owner->cid.cid_ani ? NULL : number);
+ if (!ast_strlen_zero(name)){
+ snprintf(p->callerid,(sizeof(p->callerid)-1),"%s %s",number,name);
+ } else {
+ snprintf(p->callerid,(sizeof(p->callerid)-1),"%s",number);
}
-
if (cs)
callerid_free(cs);
}