don't use '%i' at all, since we have no current use cases that need non base-10 parsi...
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 29 Apr 2005 17:00:33 +0000 (17:00 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 29 Apr 2005 17:00:33 +0000 (17:00 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5533 65c4cc65-6c06-0410-ace0-fbb531ad65f3

31 files changed:
acl.c
app.c
apps/app_dial.c
apps/app_disa.c
apps/app_groupcount.c
apps/app_meetme.c
apps/app_osplookup.c
apps/app_read.c
apps/app_readfile.c
apps/app_realtime.c
apps/app_rpt.c
apps/app_voicemail.c
cdr/cdr_pgsql.c
cdr/cdr_tds.c
channel.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_mgcp.c
channels/chan_phone.c
channels/chan_sip.c
channels/chan_skinny.c
channels/chan_zap.c
channels/iax2-provision.c
cli.c
manager.c
pbx.c
pbx/pbx_config.c
pbx/pbx_dundi.c
pbx/pbx_loopback.c
res/res_features.c
res/res_osp.c

diff --git a/acl.c b/acl.c
index 47edeb0..6e8c553 100755 (executable)
--- a/acl.c
+++ b/acl.c
@@ -150,7 +150,7 @@ struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
                        nm++;
                }
                if (!strchr(nm, '.')) {
-                       if ((sscanf(nm, "%i", &x) == 1) && (x >= 0) && (x <= 32)) {
+                       if ((sscanf(nm, "%d", &x) == 1) && (x >= 0) && (x <= 32)) {
                                y = 0;
                                for (z=0;z<x;z++) {
                                        y >>= 1;
diff --git a/app.c b/app.c
index f119f99..bc16d6e 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -571,7 +571,7 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
        end=start;  /* pre-initialize end to be same as start in case we never get into loop */
        for (x=0;x<fmtcnt;x++) {
                others[x] = ast_writefile(recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
-               ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing:  %s format: %s, %p\n", x, recordfile, sfmt[x], others[x]);
+               ast_verbose( VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, recordfile, sfmt[x], others[x]);
 
                if (!others[x]) {
                        break;
@@ -793,7 +793,7 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
        end=start;  /* pre-initialize end to be same as start in case we never get into loop */
        for (x=0;x<fmtcnt;x++) {
                others[x] = ast_writefile(prependfile, sfmt[x], comment, O_TRUNC, 0, 0700);
-               ast_verbose( VERBOSE_PREFIX_3 "x=%i, open writing:  %s format: %s, %p\n", x, prependfile, sfmt[x], others[x]);
+               ast_verbose( VERBOSE_PREFIX_3 "x=%d, open writing:  %s format: %s, %p\n", x, prependfile, sfmt[x], others[x]);
                if (!others[x]) {
                        break;
                }
index d5b46df..6855ac3 100755 (executable)
@@ -693,7 +693,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
                if ((cdl = strstr(transfer, "S("))) {
                        calldurationlimit=atoi(cdl+2);
                        if (option_verbose > 2)
-                               ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %i seconds.\n",calldurationlimit);                 
+                               ast_verbose(VERBOSE_PREFIX_3 "Setting call duration limit to %d seconds.\n",calldurationlimit);                 
                } 
 
                /* Extract DTMF strings to send upon successfull connect */
index 0eaf468..ee59856 100755 (executable)
@@ -143,8 +143,8 @@ static int disa_exec(struct ast_channel *chan, void *data)
                ast_log(LOG_WARNING, "disa requires an argument (passcode/passcode file)\n");
                return -1;
        }
-       ast_log(LOG_DEBUG, "Digittimeout: %i\n", digittimeout);
-       ast_log(LOG_DEBUG, "Responsetimeout: %i\n", firstdigittimeout);
+       ast_log(LOG_DEBUG, "Digittimeout: %d\n", digittimeout);
+       ast_log(LOG_DEBUG, "Responsetimeout: %d\n", firstdigittimeout);
        strncpy(tmp, (char *)data, sizeof(tmp)-1);
        stringp=tmp;
        strsep(&stringp, "|");
index 2c6bacf..f0c86c4 100755 (executable)
@@ -114,7 +114,7 @@ static int group_check_exec(struct ast_channel *chan, void *data)
 
        ast_app_group_split_group(data, limit, sizeof(limit), category, sizeof(category));
 
-       if ((sscanf(limit, "%i", &max) == 1) && (max > -1)) {
+       if ((sscanf(limit, "%d", &max) == 1) && (max > -1)) {
                count = ast_app_group_get_count(pbx_builtin_getvar_helper(chan, category), category);
                if (count > max) {
                        if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
index 35386f9..2e8d3d0 100755 (executable)
@@ -464,7 +464,7 @@ static int conf_cmd(int fd, int argc, char **argv) {
                /* Show all the users */
                user = cnf->firstuser;
                while(user) {
-                       ast_cli(fd, "User #: %i  Channel: %s %s %s %s %s\n", user->user_no, user->chan->name, (user->userflags & CONFFLAG_ADMIN) ? "(Admin)" : "", (user->userflags & CONFFLAG_MONITOR) ? "(Listen only)" : "", (user->adminflags & ADMINFLAG_MUTED) ? "(Admn Muted)" : "", istalking(user->talking));
+                       ast_cli(fd, "User #: %d  Channel: %s %s %s %s %s\n", user->user_no, user->chan->name, (user->userflags & CONFFLAG_ADMIN) ? "(Admin)" : "", (user->userflags & CONFFLAG_MONITOR) ? "(Listen only)" : "", (user->adminflags & ADMINFLAG_MUTED) ? "(Admn Muted)" : "", istalking(user->talking));
                        user = user->nextuser;
                }
                ast_cli(fd,"%d users in that conference.\n",cnf->users);
@@ -535,7 +535,7 @@ static char *complete_confcmd(char *line, char *word, int pos, int state) {
                                /* Search for the user */
                                usr = cnf->firstuser;
                                while(usr) {
-                                       snprintf(usrno, sizeof(usrno), "%i", usr->user_no);
+                                       snprintf(usrno, sizeof(usrno), "%d", usr->user_no);
                                        if (!strncasecmp(word, usrno, strlen(word))) {
                                                if (++which > state)
                                                        break;
@@ -839,7 +839,7 @@ zapretry:
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n"
                        "Meetme: %s\r\n"
-                       "Usernum: %i\r\n",
+                       "Usernum: %d\r\n",
                        chan->name, chan->uniqueid, conf->confno, user->user_no);
 
        if (!firstpass && !(confflags & CONFFLAG_MONITOR) && !(confflags & CONFFLAG_ADMIN)) {
@@ -1047,7 +1047,7 @@ zapretry:
                                                                "Channel: %s\r\n"
                                                                "Uniqueid: %s\r\n"
                                                                "Meetme: %s\r\n"
-                                                               "Usernum: %i\r\n",
+                                                               "Usernum: %d\r\n",
                                                                chan->name, chan->uniqueid, conf->confno, user->user_no);
                                                }
                                                if (user->talking && totalsilence > MEETME_DELAYDETECTENDTALK) {
@@ -1056,7 +1056,7 @@ zapretry:
                                                                "Channel: %s\r\n"
                                                                "Uniqueid: %s\r\n"
                                                                "Meetme: %s\r\n"
-                                                               "Usernum: %i\r\n",
+                                                               "Usernum: %d\r\n",
                                                                chan->name, chan->uniqueid, conf->confno, user->user_no);
                                                }
                                        }
@@ -1273,7 +1273,7 @@ outrun:
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n"
                        "Meetme: %s\r\n"
-                       "Usernum: %i\r\n",
+                       "Usernum: %d\r\n",
                        chan->name, chan->uniqueid, conf->confno, user->user_no);
                prev = NULL;
                conf->users--;
@@ -1340,7 +1340,7 @@ outrun:
                        }
                }
                /* Return the number of seconds the user was in the conf */
-               snprintf(meetmesecs, sizeof(meetmesecs), "%i", (int) (time(NULL) - user->jointime));
+               snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
                pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
        }
        free(user);
@@ -1451,7 +1451,7 @@ static int count_exec(struct ast_channel *chan, void *data)
 
        if (localdata && !ast_strlen_zero(localdata)){
                /* have var so load it and exit */
-               snprintf(val,sizeof(val), "%i",count);
+               snprintf(val,sizeof(val), "%d",count);
                pbx_builtin_setvar_helper(chan, localdata,val);
        } else {
                if (chan->_state != AST_STATE_UP)
@@ -1706,7 +1706,7 @@ static struct ast_conf_user* find_user(struct ast_conference *conf, char *caller
        if (conf && callerident) {
                user = conf->firstuser;
                while(user) {
-                       snprintf(usrno, sizeof(usrno), "%i", user->user_no);
+                       snprintf(usrno, sizeof(usrno), "%d", user->user_no);
                        if (strcmp(usrno, callerident) == 0)
                                return user;
                        user = user->nextuser;
index 0c58dd6..de08e44 100755 (executable)
@@ -150,7 +150,7 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
        cause = str2cause((char *)data);
        temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
        result.handle = -1;
-       if (temp && strlen(temp) && (sscanf(temp, "%i", &result.handle) == 1) && (result.handle > -1)) {
+       if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
                if ((res = ast_osp_next(&result, cause)) > 0) {
                        char tmp[80];
                        snprintf(tmp, sizeof(tmp), "%d", result.handle);
@@ -203,7 +203,7 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
        cause = str2cause((char *)data);
        temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
        result.handle = -1;
-       if (temp && strlen(temp) && (sscanf(temp, "%i", &result.handle) == 1) && (result.handle > -1)) {
+       if (temp && strlen(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
                if (!ast_osp_terminate(result.handle, cause, start, duration)) {
                        pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
                        res = 1;
index eaff923..d561c34 100755 (executable)
@@ -119,7 +119,7 @@ static int read_exec(struct ast_channel *chan, void *data)
                if ((maxdigits<1) || (maxdigits>255)) {
                        maxdigits = 255;
                } else if (option_verbose > 2)
-                       ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %i digits.\n", maxdigits);
+                       ast_verbose(VERBOSE_PREFIX_3 "Accepting a maximum of %d digits.\n", maxdigits);
        }
        if (!(varname) || ast_strlen_zero(varname)) {
                ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n");
index 9281547..0cff0a3 100755 (executable)
@@ -78,7 +78,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
                if(len < strlen(returnvar))
                        returnvar[len]='\0';
                else
-                       ast_log(LOG_WARNING,"%s is longer than %i, and %i \n",file,len,strlen(returnvar));
+                       ast_log(LOG_WARNING,"%s is longer than %d, and %d \n",file,len,strlen(returnvar));
        }
        pbx_builtin_setvar_helper(chan, varname, returnvar);
        free(returnvar);
index 7a1a63d..6ae64f5 100755 (executable)
@@ -87,7 +87,7 @@ static int cli_update_realtime(int fd, int argc, char **argv) {
                return RESULT_SUCCESS;
        }
 
-       ast_cli(fd, "Updated %i RealTime record(s).\n", res);
+       ast_cli(fd, "Updated %d RealTime record(s).\n", res);
 
        return RESULT_SUCCESS;
 }
index b04c848..2595bbb 100755 (executable)
@@ -347,7 +347,7 @@ static int myatoi(char *str)
 int    ret;
 
        if (str == NULL) return -1;
-       if (sscanf(str,"%i",&ret) != 1) return -1;
+       if (sscanf(str,"%d",&ret) != 1) return -1;
        return ret;
 }
 
index fedfd12..b3fb4f9 100755 (executable)
@@ -859,7 +859,7 @@ static int last_message_index(char *dir)
                        SQLFreeHandle (SQL_HANDLE_STMT, stmt);
                        goto yuck;
                }
-               if (sscanf(rowdata, "%i", &x) != 1)
+               if (sscanf(rowdata, "%d", &x) != 1)
                        ast_log(LOG_WARNING, "Failed to read message count!\n");
                SQLFreeHandle (SQL_HANDLE_STMT, stmt);
        } else
@@ -920,7 +920,7 @@ static int message_exists(char *dir, int msgnum)
                        SQLFreeHandle (SQL_HANDLE_STMT, stmt);
                        goto yuck;
                }
-               if (sscanf(rowdata, "%i", &x) != 1)
+               if (sscanf(rowdata, "%d", &x) != 1)
                        ast_log(LOG_WARNING, "Failed to read message count!\n");
                SQLFreeHandle (SQL_HANDLE_STMT, stmt);
        } else
@@ -4072,7 +4072,7 @@ static int vm_newuser(struct ast_channel *chan, struct ast_vm_user *vmu, struct
                vm_change_password(vmu,newpassword);
        else 
                vm_change_password_shell(vmu,newpassword);
-       ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
+       ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
        cmd = ast_play_and_wait(chan,"vm-passchanged");
 
        /* If forcename is set, have the user record their name */      
@@ -4174,7 +4174,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct
                                vm_change_password(vmu,newpassword);
                        else 
                                vm_change_password_shell(vmu,newpassword);
-                       ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword));
+                       ast_log(LOG_DEBUG,"User %s set password to %s of length %d\n",vms->username,newpassword,(int)strlen(newpassword));
                        cmd = ast_play_and_wait(chan,"vm-passchanged");
                        break;
                case '*': 
index 5aa2430..2cff8f3 100755 (executable)
@@ -101,7 +101,7 @@ static int pgsql_log(struct ast_cdr *cdr)
 
                snprintf(sqlcmd,sizeof(sqlcmd),"INSERT INTO %s (calldate,clid,src,dst,dcontext,channel,dstchannel,"
                                 "lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid,userfield) VALUES"
-                                " ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%i,%i,'%s',%i,'%s','%s','%s')",
+                                " ('%s','%s','%s','%s','%s', '%s','%s','%s','%s',%d,%d,'%s',%d,'%s','%s','%s')",
                                 table,timestr,clid,cdr->src, cdr->dst, dcontext,channel, dstchannel, lastapp, lastdata,
                                 cdr->duration,cdr->billsec,ast_cdr_disp2str(cdr->disposition),cdr->amaflags, cdr->accountcode, uniqueid, userfield);
                
index 5e99529..59076a2 100755 (executable)
@@ -147,8 +147,8 @@ static int tds_log(struct ast_cdr *cdr)
                        "%s, "          /* start */
                        "%s, "          /* answer */
                        "%s, "          /* end */
-                       "%i, "          /* duration */
-                       "%i, "          /* billsec */
+                       "%d, "          /* duration */
+                       "%d, "          /* billsec */
                        "'%s', "        /* disposition */
                        "'%s', "        /* amaflags */
                        "'%s'"          /* uniqueid */
index 5eb680d..4e9b932 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -854,7 +854,7 @@ int ast_hangup(struct ast_channel *chan)
        manager_event(EVENT_FLAG_CALL, "Hangup", 
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n"
-                       "Cause: %i\r\n",
+                       "Cause: %d\r\n",
                        chan->name, chan->uniqueid, chan->hangupcause);
        ast_channel_free(chan);
        return res;
index d27e816..c14b0d4 100755 (executable)
@@ -1996,7 +1996,7 @@ int reload_config(void)
                        else
                                capability &= ~format;
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format)) {
+                       if (sscanf(v->value, "%d", &format)) {
                                tos = format & 0xff;
                        } else if (!strcasecmp(v->value, "lowdelay")) {
                                tos = IPTOS_LOWDELAY;
index 50fcaeb..d3740b6 100755 (executable)
@@ -8360,7 +8360,7 @@ static int set_config(char *config_file, int reload)
                        if (trunkfreq < 10)
                                trunkfreq = 10;
                } else if (!strcasecmp(v->name, "autokill")) {
-                       if (sscanf(v->value, "%i", &x) == 1) {
+                       if (sscanf(v->value, "%d", &x) == 1) {
                                if (x >= 0)
                                        autokill = x;
                                else
@@ -8393,7 +8393,7 @@ static int set_config(char *config_file, int reload)
                        if (!ast_context_find(regcontext))
                                ast_context_create(NULL, regcontext, channeltype);
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format) == 1)
+                       if (sscanf(v->value, "%d", &format) == 1)
                                tos = format & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                tos = IPTOS_LOWDELAY;
index 78f7d37..0bddcaf 100755 (executable)
@@ -4132,7 +4132,7 @@ static int reload_config(void)
                        else
                                capability &= ~format;
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format) == 1)
+                       if (sscanf(v->value, "%d", &format) == 1)
                                tos = format & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                tos = IPTOS_LOWDELAY;
@@ -4147,7 +4147,7 @@ static int reload_config(void)
                        else
                                ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno);
                } else if (!strcasecmp(v->name, "port")) {
-                       if (sscanf(v->value, "%i", &ourport) == 1) {
+                       if (sscanf(v->value, "%d", &ourport) == 1) {
                                bindaddr.sin_port = htons(ourport);
                        } else {
                                ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config);
index 20290ab..dd8aa65 100755 (executable)
@@ -219,7 +219,7 @@ static int phone_digit(struct ast_channel *ast, char digit)
                ast_log(LOG_WARNING, "Unknown digit '%c'\n", digit);
                return -1;
        }
-       ast_log(LOG_NOTICE, "Dialed %i\n", outdigit);
+       ast_log(LOG_NOTICE, "Dialed %d\n", outdigit);
        ioctl(p->fd, PHONE_PLAY_TONE, outdigit);
        p->lastformat = -1;
        return 0;
index 24cc457..8b620fb 100755 (executable)
@@ -1630,7 +1630,7 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout)
        res = 0;
        ast_set_flag(p, SIP_OUTGOING);
 #ifdef OSP_SUPPORT
-       if (!osptoken || !osphandle || (sscanf(osphandle, "%i", &p->osphandle) != 1)) {
+       if (!osptoken || !osphandle || (sscanf(osphandle, "%d", &p->osphandle) != 1)) {
                /* Force Disable OSP support */
                ast_log(LOG_DEBUG, "Disabling OSP support for this call. osptoken = %s, osphandle = %s\n", osptoken, osphandle);
                osptoken = NULL;
@@ -3510,7 +3510,7 @@ static int __transmit_response(struct sip_pvt *p, char *msg, struct sip_request
        struct sip_request resp;
        int seqno = 0;
 
-       if (reliable && (sscanf(get_header(req, "CSeq"), "%i ", &seqno) != 1)) {
+       if (reliable && (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1)) {
                ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq"));
                return -1;
        }
@@ -3574,7 +3574,7 @@ static int transmit_response_with_auth(struct sip_pvt *p, char *msg, struct sip_
        char tmp[256];
        int seqno = 0;
 
-       if (reliable && (sscanf(get_header(req, "CSeq"), "%i ", &seqno) != 1)) {
+       if (reliable && (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1)) {
                ast_log(LOG_WARNING, "Unable to determine sequence number from '%s'\n", get_header(req, "CSeq"));
                return -1;
        }
@@ -3825,7 +3825,7 @@ static int transmit_response_with_sdp(struct sip_pvt *p, char *msg, struct sip_r
 {
        struct sip_request resp;
        int seqno;
-       if (sscanf(get_header(req, "CSeq"), "%i ", &seqno) != 1) {
+       if (sscanf(get_header(req, "CSeq"), "%d ", &seqno) != 1) {
                ast_log(LOG_WARNING, "Unable to get seqno from '%s'\n", get_header(req, "CSeq"));
                return -1;
        }
@@ -8858,7 +8858,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
        /* Must have Cseq */
        if (ast_strlen_zero(cmd) || ast_strlen_zero(cseq))
                return -1;
-       if (sscanf(cseq, "%i%n", &seqno, &len) != 1) {
+       if (sscanf(cseq, "%d%n", &seqno, &len) != 1) {
                ast_log(LOG_DEBUG, "No seqno in '%s'\n", cmd);
                return -1;
        }
@@ -8897,7 +8897,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                extract_uri(p, req);
                while(*e && (*e < 33)) 
                        e++;
-               if (sscanf(e, "%i %n", &respid, &len) != 1) {
+               if (sscanf(e, "%d %n", &respid, &len) != 1) {
                        ast_log(LOG_WARNING, "Invalid response: '%s'\n", e);
                } else {
                        handle_response(p, respid, e + len, req,ignore, seqno);
@@ -10250,7 +10250,7 @@ static int reload_config(void)
                                ast_log(LOG_WARNING, "Unable to locate host '%s'\n", v->value);
                } else if (!strcasecmp(v->name, "outboundproxyport")) {
                        /* Port needs to be after IP */
-                       sscanf(v->value, "%i", &format);
+                       sscanf(v->value, "%d", &format);
                        outboundproxyip.sin_port = htons(format);
                } else if (!strcasecmp(v->name, "autocreatepeer")) {
                        autocreatepeer = ast_true(v->value);
@@ -10298,7 +10298,7 @@ static int reload_config(void)
                                memcpy(&externip.sin_addr, hp->h_addr, sizeof(externip.sin_addr));
                        time(&externexpire);
                } else if (!strcasecmp(v->name, "externrefresh")) {
-                       if (sscanf(v->value, "%i", &externrefresh) != 1) {
+                       if (sscanf(v->value, "%d", &externrefresh) != 1) {
                                ast_log(LOG_WARNING, "Invalid externrefresh value '%s', must be an integer >0 at line %d\n", v->value, v->lineno);
                                externrefresh = 10;
                        }
@@ -10311,7 +10311,7 @@ static int reload_config(void)
                } else if (!strcasecmp(v->name, "recordhistory")) {
                        recordhistory = ast_true(v->value);
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format) == 1)
+                       if (sscanf(v->value, "%d", &format) == 1)
                                tos = format & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                tos = IPTOS_LOWDELAY;
@@ -10326,7 +10326,7 @@ static int reload_config(void)
                        else
                                ast_log(LOG_WARNING, "Invalid tos value at line %d, should be 'lowdelay', 'throughput', 'reliability', 'mincost', or 'none'\n", v->lineno);
                } else if (!strcasecmp(v->name, "bindport")) {
-                       if (sscanf(v->value, "%i", &ourport) == 1) {
+                       if (sscanf(v->value, "%d", &ourport) == 1) {
                                bindaddr.sin_port = htons(ourport);
                        } else {
                                ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config);
index bbb336c..6b9f4b8 100755 (executable)
@@ -2888,7 +2888,7 @@ static int reload_config(void)
                        else
                                capability &= ~format;
                } else if (!strcasecmp(v->name, "port")) {
-                       if (sscanf(v->value, "%i", &ourport) == 1) {
+                       if (sscanf(v->value, "%d", &ourport) == 1) {
                                bindaddr.sin_port = htons(ourport);
                        } else {
                                ast_log(LOG_WARNING, "Invalid port number '%s' at line %d of %s\n", v->value, v->lineno, config);
index 09c7b1d..946eac5 100755 (executable)
@@ -8331,7 +8331,7 @@ static void *pri_dchannel(void *vpri)
                                                }
                                                if (e->hangup.aoc_units > -1)
                                                        if (option_verbose > 2)
-                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %i unit%s\n",
+                                                               ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
                                                                        pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
                                                ast_mutex_unlock(&pri->pvts[chanpos]->lock);
                                        } else {
@@ -8377,7 +8377,7 @@ static void *pri_dchannel(void *vpri)
                                                                ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
                                                        if (e->hangup.aoc_units > -1)
                                                                if (option_verbose > 2)
-                                                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %i unit%s\n",
+                                                                       ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
                                                                                pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, (int)e->hangup.aoc_units, (e->hangup.aoc_units == 1) ? "" : "s");
                                                } else {
                                                        pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
@@ -9771,7 +9771,7 @@ static int setup_zap(int reload)
                                        echocancel=128;
                        }
                } else if (!strcasecmp(v->name, "echotraining")) {
-                       if (sscanf(v->value, "%i", &y) == 1) {
+                       if (sscanf(v->value, "%d", &y) == 1) {
                                if ((y < 10) || (y > 4000)) {
                                        ast_log(LOG_WARNING, "Echo training time must be within the range of 10 to 2000 ms at line %d\n", v->lineno);                                   
                                } else {
index 5feec89..f44dcba 100755 (executable)
@@ -287,7 +287,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg,
        v = ast_variable_browse(cfg, s);
        while(v) {
                if (!strcasecmp(v->name, "port") || !strcasecmp(v->name, "serverport")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x > 0) && (x < 65535)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x < 65535)) {
                                if (!strcasecmp(v->name, "port")) {
                                        cur->port = x;
                                        foundportno = 1;
@@ -313,7 +313,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg,
                        } else
                                ast_log(LOG_WARNING, "Ignoring invalid codec '%s' for '%s' at line %d\n", v->value, s, v->lineno);
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &x) == 1)
+                       if (sscanf(v->value, "%d", &x) == 1)
                                cur->tos = x & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                cur->tos = IPTOS_LOWDELAY;
diff --git a/cli.c b/cli.c
index eceef43..f5865cc 100755 (executable)
--- a/cli.c
+++ b/cli.c
@@ -583,7 +583,7 @@ static int handle_debuglevel(int fd, int argc, char *argv[])
        char *filename = "<any>";
        if ((argc < 3) || (argc > 4))
                return RESULT_SHOWUSAGE;
-       if (sscanf(argv[2], "%i", &newlevel) != 1)
+       if (sscanf(argv[2], "%d", &newlevel) != 1)
                return RESULT_SHOWUSAGE;
        option_debug = newlevel;
        if (argc == 4) {
index eb4d229..8b8c66b 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -896,7 +896,7 @@ static void *fast_originate(void *data)
                        "Channel: %s/%s\r\n"
                        "Context: %s\r\n"
                        "Exten: %s\r\n"
-                       "Reason: %i\r\n"
+                       "Reason: %d\r\n"
                        "Uniqueid: %s\r\n",
                        in->idtext, in->tech, in->data, in->context, in->exten, reason, chan ? chan->uniqueid : "<null>");
        else
@@ -906,7 +906,7 @@ static void *fast_originate(void *data)
                        "Channel: %s/%s\r\n"
                        "Context: %s\r\n"
                        "Exten: %s\r\n"
-                       "Reason: %i\r\n"
+                       "Reason: %d\r\n"
                        "Uniqueid: %s\r\n",
                        in->idtext, in->tech, in->data, in->context, in->exten, reason, chan ? chan->uniqueid : "<null>");
 
diff --git a/pbx.c b/pbx.c
index 79a9034..68c0a55 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -1057,7 +1057,7 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c
                snprintf(workspace, workspacelen, "%s", c->uniqueid);
                *ret = workspace;
        } else if (c && !strcmp(var, "HANGUPCAUSE")) {
-               snprintf(workspace, workspacelen, "%i", c->hangupcause);
+               snprintf(workspace, workspacelen, "%d", c->hangupcause);
                *ret = workspace;
        } else if (c && !strcmp(var, "ACCOUNTCODE")) {
                strncpy(workspace, c->accountcode, workspacelen - 1);
@@ -5261,7 +5261,7 @@ static void wait_for_hangup(struct ast_channel *chan, void *data)
        struct ast_frame *f;
        int waittime;
        
-       if (!data || !strlen(data) || (sscanf(data, "%i", &waittime) != 1) || (waittime < 0))
+       if (!data || !strlen(data) || (sscanf(data, "%d", &waittime) != 1) || (waittime < 0))
                waittime = -1;
        if (waittime > -1) {
                ast_safe_sleep(chan, waittime * 1000);
index 33a6693..a2056e7 100755 (executable)
@@ -1191,7 +1191,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
        if (!strcmp(prior, "hint")) {
                        iprior = PRIORITY_HINT;
                } else {
-                       if (sscanf(prior, "%i", &iprior) != 1) {
+                       if (sscanf(prior, "%d", &iprior) != 1) {
                                ast_cli(fd, "'%s' is not a valid priority\n", prior);
                                prior = NULL;
                        }
@@ -1700,7 +1700,7 @@ static int pbx_load_module(void)
                                                                else
                                                                        ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
                                                        } else  {
-                                                               if (sscanf(pri, "%i", &ipri) != 1) {
+                                                               if (sscanf(pri, "%d", &ipri) != 1) {
                                                                        if ((ipri = ast_findlabel_extension2(NULL, con, realext, pri, cidmatch)) < 1) {
                                                                                ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
                                                                                ipri = 0;
index b80867b..ca3c444 100755 (executable)
@@ -4059,7 +4059,7 @@ static void build_mapping(char *name, char *value)
                        } else if (x >= 4) {
                                strncpy(map->dcontext, name, sizeof(map->dcontext) - 1);
                                strncpy(map->lcontext, fields[0], sizeof(map->lcontext) - 1);
-                               if ((sscanf(fields[1], "%i", &map->weight) == 1) && (map->weight >= 0) && (map->weight < 60000)) {
+                               if ((sscanf(fields[1], "%d", &map->weight) == 1) && (map->weight >= 0) && (map->weight < 60000)) {
                                        strncpy(map->dest, fields[3], sizeof(map->dest) - 1);
                                        if ((map->tech = str2tech(fields[2]))) {
                                                map->dead = 0;
@@ -4502,14 +4502,14 @@ static int set_config(char *config_file, struct sockaddr_in* sin)
                } else if (!strcasecmp(v->name, "authdebug")) {
                        authdebug = ast_true(v->value);
                } else if (!strcasecmp(v->name, "ttl")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x < DUNDI_DEFAULT_TTL)) {
                                dundi_ttl = x;
                        } else {
                                ast_log(LOG_WARNING, "'%s' is not a valid TTL at line %d, must be number from 1 to %d\n",
                                        v->value, v->lineno, DUNDI_DEFAULT_TTL);
                        }
                } else if (!strcasecmp(v->name, "autokill")) {
-                       if (sscanf(v->value, "%i", &x) == 1) {
+                       if (sscanf(v->value, "%d", &x) == 1) {
                                if (x >= 0)
                                        global_autokilltimeout = x;
                                else
@@ -4525,7 +4525,7 @@ static int set_config(char *config_file, struct sockaddr_in* sin)
                        else
                                ast_log(LOG_WARNING, "Invalid global endpoint identifier '%s' at line %d\n", v->value, v->lineno);
                } else if (!strcasecmp(v->name, "tos")) {
-                       if (sscanf(v->value, "%i", &format) == 1)
+                       if (sscanf(v->value, "%d", &format) == 1)
                                tos = format & 0xff;
                        else if (!strcasecmp(v->value, "lowdelay"))
                                tos = IPTOS_LOWDELAY;
index 8fb7b3f..065cac8 100755 (executable)
@@ -108,7 +108,7 @@ static void loopback_subst(char **newexten, char **newcontext, int *priority, ch
        if (con && !ast_strlen_zero(con))
                *newcontext = con;
        if (pri && !ast_strlen_zero(pri))
-               sscanf(pri, "%i", priority);
+               sscanf(pri, "%d", priority);
 }
 
 static int loopback_exists(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
index 99874a8..06ff702 100755 (executable)
@@ -1571,7 +1571,7 @@ static int load_config(void)
                                } else
                                        parkingtime = parkingtime * 1000;
                        } else if (!strcasecmp(var->name, "parkpos")) {
-                               if (sscanf(var->value, "%i-%i", &start, &end) != 2) {
+                               if (sscanf(var->value, "%d-%d", &start, &end) != 2) {
                                        ast_log(LOG_WARNING, "Format for parking positions is a-b, where a and b are numbers at line %d of parking.conf\n", var->lineno);
                                } else {
                                        parking_start = start;
index 570df78..e86a2e8 100755 (executable)
@@ -151,22 +151,22 @@ static int osp_build(struct ast_config *cfg, char *cat)
                        } else
                                ast_log(LOG_WARNING, "Too many Service points at line %d\n", v->lineno);
                } else if (!strcasecmp(v->name, "maxconnections")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x > 0) && (x <= 1000)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x > 0) && (x <= 1000)) {
                                osp->maxconnections = x;
                        } else
                                ast_log(LOG_WARNING, "maxconnections should be an integer from 1 to 1000, not '%s' at line %d\n", v->value, v->lineno);
                } else if (!strcasecmp(v->name, "retrydelay")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x >= 0) && (x <= 10)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x >= 0) && (x <= 10)) {
                                osp->retrydelay = x;
                        } else
                                ast_log(LOG_WARNING, "retrydelay should be an integer from 0 to 10, not '%s' at line %d\n", v->value, v->lineno);
                } else if (!strcasecmp(v->name, "retrylimit")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x >= 0) && (x <= 100)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x >= 0) && (x <= 100)) {
                                osp->retrylimit = x;
                        } else
                                ast_log(LOG_WARNING, "retrylimit should be an integer from 0 to 100, not '%s' at line %d\n", v->value, v->lineno);
                } else if (!strcasecmp(v->name, "timeout")) {
-                       if ((sscanf(v->value, "%i", &x) == 1) && (x >= 200) && (x <= 10000)) {
+                       if ((sscanf(v->value, "%d", &x) == 1) && (x >= 200) && (x <= 10000)) {
                                osp->timeout = x;
                        } else
                                ast_log(LOG_WARNING, "timeout should be an integer from 200 to 10000, not '%s' at line %d\n", v->value, v->lineno);