summaryrefslogtreecommitdiff
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-07-03 04:25:21 +0000
committerRussell Bryant <russell@russellbryant.com>2006-07-03 04:25:21 +0000
commit73e8e2ab1fae6c7a83fd98b7997440631b39c912 (patch)
tree9e29310d1f0916eaa0b2301492a9ed5f1c5e093a /channels/chan_skinny.c
parent03a277c5cc64577060d1e614a8e91dc1a30cd089 (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: https://origsvn.digium.com/svn/asterisk/trunk@36726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 0dc12419f..aaaf85609 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -2093,12 +2093,10 @@ static void *skinny_ss(void *data)
} else {
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
ast_copy_string(l->lastnumberdialed, exten, sizeof(l->lastnumberdialed));
- if (!ast_strlen_zero(l->cid_num)) {
- if (!l->hidecallerid) {
- chan->cid.cid_num = strdup(l->cid_num);
- chan->cid.cid_ani = strdup(l->cid_num);
- }
- }
+ ast_set_callerid(chan,
+ l->hidecallerid ? "" : l->cid_num,
+ l->hidecallerid ? "" : l->cid_name,
+ chan->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(chan, AST_STATE_RING);
res = ast_pbx_run(chan);
if (res) {
@@ -2525,8 +2523,7 @@ static struct ast_channel *skinny_new(struct skinny_line *l, int state)
ast_string_field_set(tmp, call_forward, l->call_forward);
ast_copy_string(tmp->context, l->context, sizeof(tmp->context));
ast_copy_string(tmp->exten, l->exten, sizeof(tmp->exten));
- tmp->cid.cid_num = ast_strdup(l->cid_num);
- tmp->cid.cid_name = ast_strdup(l->cid_name);
+ ast_set_callerid(tmp, l->cid_num, l->cid_name, l->cid_num);
tmp->priority = 1;
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
@@ -2720,12 +2717,10 @@ static int handle_stimulus_message(skinny_req *req, struct skinnysession *s)
if (ast_exists_extension(c, c->context, l->lastnumberdialed, 1, l->cid_num)) {
if (!ast_matchmore_extension(c, c->context, l->lastnumberdialed, 1, l->cid_num)) {
ast_copy_string(c->exten, l->lastnumberdialed, sizeof(c->exten));
- if (!ast_strlen_zero(l->cid_num)) {
- if (!l->hidecallerid) {
- c->cid.cid_num = strdup(l->cid_num);
- c->cid.cid_ani = strdup(l->cid_num);
- }
- }
+ ast_set_callerid(c,
+ l->hidecallerid ? "" : l->cid_num,
+ l->hidecallerid ? "" : l->cid_name,
+ c->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(c, AST_STATE_RING);
res = ast_pbx_run(c);
if (res) {
@@ -2766,12 +2761,10 @@ static int handle_stimulus_message(skinny_req *req, struct skinnysession *s)
if (!ast_matchmore_extension(c, c->context, sd->exten, 1, l->cid_num)) {
ast_copy_string(c->exten, sd->exten, sizeof(c->exten));
ast_copy_string(l->lastnumberdialed, sd->exten, sizeof(l->lastnumberdialed));
- if (!ast_strlen_zero(l->cid_num)) {
- if (!l->hidecallerid) {
- c->cid.cid_num = strdup(l->cid_num);
- c->cid.cid_ani = strdup(l->cid_num);
- }
- }
+ ast_set_callerid(c,
+ l->hidecallerid ? "" : l->cid_num,
+ l->hidecallerid ? "" : l->cid_name,
+ c->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(c, AST_STATE_RING);
res = ast_pbx_run(c);
if (res) {
@@ -3422,12 +3415,10 @@ static int handle_soft_key_event_message(skinny_req *req, struct skinnysession *
if (ast_exists_extension(c, c->context, l->lastnumberdialed, 1, l->cid_num)) {
if (!ast_matchmore_extension(c, c->context, l->lastnumberdialed, 1, l->cid_num)) {
ast_copy_string(c->exten, l->lastnumberdialed, sizeof(c->exten));
- if (!ast_strlen_zero(l->cid_num)) {
- if (!l->hidecallerid) {
- c->cid.cid_num = strdup(l->cid_num);
- c->cid.cid_ani = strdup(l->cid_num);
- }
- }
+ ast_set_callerid(c,
+ l->hidecallerid ? "" : l->cid_num,
+ l->hidecallerid ? "" : l->cid_name,
+ c->cid.cid_ani ? NULL : l->cid_num);
ast_setstate(c, AST_STATE_RING);
res = ast_pbx_run(c);
if (res) {