diff --git a/acl.c b/acl.c
index 47edeb0f2b7f6fbd441cbb7e897af291d6f2a1ce..6e8c553c09337f73cfb6adf317213998f62407ad 100755
--- 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 f119f990a03bd1c52d2681046a51876269646d90..bc16d6ee589054f68911db1fb935cc3d5c678fec 100755
--- 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;
 		}
diff --git a/apps/app_dial.c b/apps/app_dial.c
index d5b46dfd1ebd273157125e2b9fee6ee0cb2408bb..6855ac33e4136021139a418e016d592e118ef9d8 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -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 */
diff --git a/apps/app_disa.c b/apps/app_disa.c
index 0eaf468ec3217ca5764b7aa28dc789a0777232e7..ee5985649e4e433a8b6eaf72fd8f3bd637922df9 100755
--- a/apps/app_disa.c
+++ b/apps/app_disa.c
@@ -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, "|");
diff --git a/apps/app_groupcount.c b/apps/app_groupcount.c
index 2c6bacf0079336d968aa7e7fd191fe915e306726..f0c86c4d1518dc7671019771bbc1f2e8254edb69 100755
--- a/apps/app_groupcount.c
+++ b/apps/app_groupcount.c
@@ -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))
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 35386f96abbc2e8a2779f3e3fcdb261b434c12e4..2e8d3d0e176a54a4e3b932efcf62d4d3b99c2877 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -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;
diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c
index 0c58dd63a4fec0bbe33a930b0a402601548149a4..de08e44694ef5cd0be8247fc353b48f16b5bee16 100755
--- a/apps/app_osplookup.c
+++ b/apps/app_osplookup.c
@@ -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;
diff --git a/apps/app_read.c b/apps/app_read.c
index eaff923e9a3ce4367bbbdc3bed476537cc09354f..d561c34d44a06079869d1f07c850de30035043a0 100755
--- a/apps/app_read.c
+++ b/apps/app_read.c
@@ -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");
diff --git a/apps/app_readfile.c b/apps/app_readfile.c
index 92815472bbe2d5c2e57772c08909914a589b8a72..0cff0a3276baceb0ed30c36ca4af82dc8110197a 100755
--- a/apps/app_readfile.c
+++ b/apps/app_readfile.c
@@ -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);
diff --git a/apps/app_realtime.c b/apps/app_realtime.c
index 7a1a63d4a5a42cb710e8725bdfa97e657d098064..6ae64f5c4d15b0b658ea9afd2b9726ea01f75ea3 100755
--- a/apps/app_realtime.c
+++ b/apps/app_realtime.c
@@ -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;
 }
diff --git a/apps/app_rpt.c b/apps/app_rpt.c
index b04c8489babbb48eac9093e965b5f845e3835575..2595bbbd78647a905f9fb1273b4233836b8ec8fe 100755
--- a/apps/app_rpt.c
+++ b/apps/app_rpt.c
@@ -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;
 }
 
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index fedfd127133e39ce1b8324b96cbea97cda12253d..b3fb4f9ccd786a8b4045085b4c04d03b9e5896e9 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -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 '*': 
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index 5aa2430a2f22c3fff17bdffcb738d3d038191bdf..2cff8f3148f6c8817d07798c74cff08b7be0ece1 100755
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -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);
 		
diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c
index 5e99529f6c20c948184af5bcdb35fecd6784bc4b..59076a25bccb937a7fe64afca25c4bf3ed960515 100755
--- a/cdr/cdr_tds.c
+++ b/cdr/cdr_tds.c
@@ -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 */
diff --git a/channel.c b/channel.c
index 5eb680d0205cb26e05f387317a894efa13f0c3e1..4e9b9320ad4bf7b07c169acc03a79c6ffd210601 100755
--- 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;
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index d27e8169ad829364a4583201ab6c47816626da65..c14b0d4b1d680819bcc33e3dd85fe329199e984d 100755
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -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;
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 50fcaeb438d93137f19ec41d8f22553ee20e6599..d3740b6ddf3b968d23fbd161f853fc951d23ef15 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -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;
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 78f7d374933377cb6abc57ea084c72676e0a4eb8..0bddcafc779a46527ffad96c150c8c9d576e1083 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -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);
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 20290aba00a5de10b58d4fe837c91783fb0a7a14..dd8aa6501cf30286d1d5613d9f4b2b10bb523220 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -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;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 24cc457a6ac80e14c30ba52592343a98619b18bb..8b620fbaa82b1d351c21bd8a35fc8da4182d95b6 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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);
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index bbb336c4750de65d15b975b1580596b0d1e0d918..6b9f4b8544680ebb61fe3a81f832cdb3c441e989 100755
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -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);
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 09c7b1df720a730f3e46a36cabd2a2d2b59abea8..946eac569ec4d1fb41465f680688840a4daf4bf7 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -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 {
diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c
index 5feec89a7a38dc579d8da5130320f635100728ef..f44dcba8c9750f41766bc30e89ae8676189f0db2 100755
--- a/channels/iax2-provision.c
+++ b/channels/iax2-provision.c
@@ -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 eceef43c19703eeda47eca4881d76c279f0d0f7b..f5865cc1e61a33e77cf75877890fea30b8869076 100755
--- 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) {
diff --git a/manager.c b/manager.c
index eb4d22937dcfe5cb76dab27b8f7bc58c4ac5198f..8b8c66bb17b29f33a533bab0d24aa07a53ca5884 100755
--- 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 79a903480f667e01b6ffa7a7bcef3fc973fbabc8..68c0a55eb8b6fbf8449d1b40e2efbbab957fd2fe 100755
--- 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);
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index 33a669396e273fe8391f38f77fbce6208405c169..a2056e7842656ef8648a5dec7c97e81387d1f3f5 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -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;
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index b80867b29eb2d62bed9ad9dbab991a6bea553001..ca3c4441afb30af5e42b185e38dad2f9b248e5e2 100755
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -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;
diff --git a/pbx/pbx_loopback.c b/pbx/pbx_loopback.c
index 8fb7b3f7ebec92cb3b1c34f0106effe554315e1e..065cac855f50f38f546b52cddf5c55f028de1428 100755
--- a/pbx/pbx_loopback.c
+++ b/pbx/pbx_loopback.c
@@ -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)
diff --git a/res/res_features.c b/res/res_features.c
index 99874a8b4ebb6772371effff338fd5f192e533c2..06ff702174554d5797313f8903676deef3cb7148 100755
--- a/res/res_features.c
+++ b/res/res_features.c
@@ -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;
diff --git a/res/res_osp.c b/res/res_osp.c
index 570df78b1c8e41e4dd4599a05cb77c91c1415825..e86a2e8810a0ff037ce1bc356ff8a7b871c449a4 100755
--- a/res/res_osp.c
+++ b/res/res_osp.c
@@ -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);