summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-08-07 00:26:11 +0000
committerRussell Bryant <russell@russellbryant.com>2006-08-07 00:26:11 +0000
commit954ed66a0a07fc24aa4d669e4bb820d8ebf49834 (patch)
tree2075dca3df92c3d15ffea2dca9af3f77cad16f10 /channels
parentce72e83a39611733df05dae4ae7cabc7dc7f81d4 (diff)
minor cleanups
- use appropriate types in some assignments - use ast_strlen_zero() - don't manually free cid fields since ast_set_callerid() will handle it git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_zap.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index ad3d2281b..7863dfaa7 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -6020,7 +6020,7 @@ static void *ss_thread(void *data)
chan->_state == AST_STATE_RINGING)
break; /* Got ring */
}
- dtmfbuf[i] = 0;
+ dtmfbuf[i] = '\0';
zt_setlinear(p->subs[index].zfd, p->subs[index].linear);
/* Got cid and ring. */
ast_log(LOG_DEBUG, "CID got string '%s'\n", dtmfbuf);
@@ -6028,10 +6028,10 @@ static void *ss_thread(void *data)
ast_log(LOG_DEBUG, "CID is '%s', flags %d\n",
dtmfcid, flags);
/* If first byte is NULL, we have no cid */
- if (dtmfcid[0])
+ if (!ast_strlen_zero(dtmfcid))
number = dtmfcid;
else
- number = 0;
+ number = NULL;
/* If set to use V23 Signalling, launch our FSK gubbins and listen for it */
} else if ((p->cid_signalling == CID_SIG_V23) || (p->cid_signalling == CID_SIG_V23_JP)) {
cs = callerid_new(p->cid_signalling);
@@ -6396,24 +6396,17 @@ static void *ss_thread(void *data)
}
else
cs = NULL;
- if (number || name) {
- if (chan->cid.cid_num) {
- free(chan->cid.cid_num);
- chan->cid.cid_num = NULL;
- }
- if (chan->cid.cid_name) {
- free(chan->cid.cid_name);
- chan->cid.cid_name = NULL;
- }
- }
+
if (number)
ast_shrink_phone_number(number);
-
ast_set_callerid(chan, number, name, number);
+
if (smdi_msg)
ASTOBJ_UNREF(smdi_msg, ast_smdi_md_message_destroy);
+
if (cs)
callerid_free(cs);
+
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
p->ringt = p->ringt_base;