diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_alsa.c | 6 | ||||
-rw-r--r-- | channels/chan_dahdi.c | 50 | ||||
-rw-r--r-- | channels/chan_gtalk.c | 8 | ||||
-rw-r--r-- | channels/chan_iax2.c | 68 | ||||
-rw-r--r-- | channels/chan_jingle.c | 12 | ||||
-rw-r--r-- | channels/chan_mgcp.c | 26 | ||||
-rw-r--r-- | channels/chan_motif.c | 14 | ||||
-rw-r--r-- | channels/chan_phone.c | 4 | ||||
-rw-r--r-- | channels/chan_pjsip.c | 4 | ||||
-rw-r--r-- | channels/chan_sip.c | 164 | ||||
-rw-r--r-- | channels/chan_skinny.c | 134 | ||||
-rw-r--r-- | channels/chan_unistim.c | 76 | ||||
-rw-r--r-- | channels/iax2/firmware.c | 2 | ||||
-rw-r--r-- | channels/iax2/parser.c | 4 | ||||
-rw-r--r-- | channels/pjsip/dialplan_functions.c | 6 | ||||
-rw-r--r-- | channels/sig_analog.c | 30 | ||||
-rw-r--r-- | channels/sig_pri.c | 16 | ||||
-rw-r--r-- | channels/sip/config_parser.c | 2 | ||||
-rw-r--r-- | channels/sip/include/sip.h | 2 |
19 files changed, 314 insertions, 314 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index 98adfddee..9d43ba139 100644 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -207,12 +207,12 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) direction = 0; err = snd_pcm_hw_params_set_rate_near(handle, hwparams, &rate, &direction); if (rate != DESIRED_RATE) - ast_log(LOG_WARNING, "Rate not correct, requested %d, got %d\n", DESIRED_RATE, rate); + ast_log(LOG_WARNING, "Rate not correct, requested %d, got %u\n", DESIRED_RATE, rate); direction = 0; err = snd_pcm_hw_params_set_period_size_near(handle, hwparams, &period_size, &direction); if (err < 0) - ast_log(LOG_ERROR, "period_size(%ld frames) is bad: %s\n", period_size, snd_strerror(err)); + ast_log(LOG_ERROR, "period_size(%lu frames) is bad: %s\n", period_size, snd_strerror(err)); else { ast_debug(1, "Period size is %d\n", err); } @@ -220,7 +220,7 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream) buffer_size = 4096 * 2; /* period_size * 16; */ err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffer_size); if (err < 0) - ast_log(LOG_WARNING, "Problem setting buffer size of %ld: %s\n", buffer_size, snd_strerror(err)); + ast_log(LOG_WARNING, "Problem setting buffer size of %lu: %s\n", buffer_size, snd_strerror(err)); else { ast_debug(1, "Buffer size is set to %d frames\n", err); } diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index ef2f19e70..b9b915064 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -1546,7 +1546,7 @@ static void my_handle_dtmf(void *pvt, struct ast_channel *ast, enum analog_sub a ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n", f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End", - f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); + (unsigned)f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); if (f->subclass.integer == 'f') { if (f->frametype == AST_FRAME_DTMF_END) { @@ -1645,7 +1645,7 @@ static struct ast_manager_event_blob *dahdichannel_to_ami(struct stasis_message return ast_manager_event_blob_create(EVENT_FLAG_CALL, "DAHDIChannel", "%s" - "DAHDISpan: %d\r\n" + "DAHDISpan: %u\r\n" "DAHDIChannel: %s\r\n", ast_str_buffer(channel_string), (unsigned int)ast_json_integer_get(span), @@ -2550,7 +2550,7 @@ static int my_dial_digits(void *pvt, enum analog_sub sub, struct analog_dialoper } if (sub != ANALOG_SUB_REAL) { - ast_log(LOG_ERROR, "Trying to dial_digits '%s' on channel %d subchannel %d\n", + ast_log(LOG_ERROR, "Trying to dial_digits '%s' on channel %d subchannel %u\n", dop->dialstr, p->channel, sub); return -1; } @@ -6988,7 +6988,7 @@ static void dahdi_handle_dtmf(struct ast_channel *ast, int idx, struct ast_frame ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n", f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End", - f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); + (unsigned)f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); if (p->confirmanswer) { if (f->frametype == AST_FRAME_DTMF_END) { @@ -7430,7 +7430,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) return NULL; } mssinceflash = ast_tvdiff_ms(ast_tvnow(), p->flashtime); - ast_debug(1, "Last flash was %d ms ago\n", mssinceflash); + ast_debug(1, "Last flash was %u ms ago\n", mssinceflash); if (mssinceflash < MIN_MS_SINCE_FLASH) { /* It hasn't been long enough since the last flashook. This is probably a bounce on hanging up. Hangup both channels now */ @@ -7593,7 +7593,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) res = tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_DIALTONE); break; default: - ast_log(LOG_WARNING, "FXO phone off hook in weird state %d??\n", ast_channel_state(ast)); + ast_log(LOG_WARNING, "FXO phone off hook in weird state %u??\n", ast_channel_state(ast)); } break; case SIG_FXSLS: @@ -7643,7 +7643,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) ast_setstate(ast, AST_STATE_UP); } } else if (ast_channel_state(ast) != AST_STATE_RING) - ast_log(LOG_WARNING, "Ring/Off-hook in strange state %d on channel %d\n", ast_channel_state(ast), p->channel); + ast_log(LOG_WARNING, "Ring/Off-hook in strange state %u on channel %d\n", ast_channel_state(ast), p->channel); break; default: ast_log(LOG_WARNING, "Don't know how to handle ring/off hook for signalling %d\n", p->sig); @@ -7887,7 +7887,7 @@ winkflashdone: if (p->dialing) ast_debug(1, "Ignoring wink on channel %d\n", p->channel); else - ast_debug(1, "Got wink in weird state %d on channel %d\n", ast_channel_state(ast), p->channel); + ast_debug(1, "Got wink in weird state %u on channel %d\n", ast_channel_state(ast), p->channel); break; case SIG_FEATDMF_TA: switch (p->whichwink) { @@ -7990,7 +7990,7 @@ winkflashdone: p->polaritydelaytv = ast_tvnow(); } } else - ast_debug(1, "Ignore switch to REVERSED Polarity on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Ignore switch to REVERSED Polarity on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } /* Removed else statement from here as it was preventing hangups from ever happening*/ /* Added AST_STATE_RING in if statement below to deal with calling party hangups that take place when ringing */ @@ -7999,21 +7999,21 @@ winkflashdone: (p->polarity == POLARITY_REV) && ((ast_channel_state(ast) == AST_STATE_UP) || (ast_channel_state(ast) == AST_STATE_RING)) ) { /* Added log_debug information below to provide a better indication of what is going on */ - ast_debug(1, "Polarity Reversal event occured - DEBUG 1: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); + ast_debug(1, "Polarity Reversal event occured - DEBUG 1: channel %d, state %u, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); if (ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) > p->polarityonanswerdelay) { ast_debug(1, "Polarity Reversal detected and now Hanging up on channel %d\n", p->channel); ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT); p->polarity = POLARITY_IDLE; } else - ast_debug(1, "Polarity Reversal detected but NOT hanging up (too close to answer event) on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Polarity Reversal detected but NOT hanging up (too close to answer event) on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } else { p->polarity = POLARITY_IDLE; - ast_debug(1, "Ignoring Polarity switch to IDLE on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Ignoring Polarity switch to IDLE on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } /* Added more log_debug information below to provide a better indication of what is going on */ - ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); + ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %u, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); break; default: ast_debug(1, "Dunno what to do with event %d on channel %d\n", res, p->channel); @@ -8533,7 +8533,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast) /* Don't accept in-band DTMF when in overlap dial mode */ ast_debug(1, "Absorbing inband %s DTMF digit: 0x%02X '%c' on %s\n", f->frametype == AST_FRAME_DTMF_BEGIN ? "begin" : "end", - f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); + (unsigned)f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); f->frametype = AST_FRAME_NULL; f->subclass.integer = 0; @@ -8644,7 +8644,7 @@ static int dahdi_write(struct ast_channel *ast, struct ast_frame *frame) /* Write a frame of (presumably voice) data */ if (frame->frametype != AST_FRAME_VOICE) { if (frame->frametype != AST_FRAME_IMAGE) - ast_log(LOG_WARNING, "Don't know what to do with frame type '%d'\n", frame->frametype); + ast_log(LOG_WARNING, "Don't know what to do with frame type '%u'\n", frame->frametype); return 0; } if ((frame->subclass.format.id != AST_FORMAT_SLINEAR) && @@ -8836,15 +8836,15 @@ static struct ast_str *create_channel_name(struct dahdi_pvt *i) ast_mutex_lock(&i->pri->lock); y = ++i->pri->new_chan_seq; if (is_outgoing) { - ast_str_set(&chan_name, 0, "i%d/%s-%x", i->pri->span, address, y); + ast_str_set(&chan_name, 0, "i%d/%s-%x", i->pri->span, address, (unsigned)y); address[0] = '\0'; } else if (ast_strlen_zero(i->cid_subaddr)) { /* Put in caller-id number only since there is no subaddress. */ - ast_str_set(&chan_name, 0, "i%d/%s-%x", i->pri->span, i->cid_num, y); + ast_str_set(&chan_name, 0, "i%d/%s-%x", i->pri->span, i->cid_num, (unsigned)y); } else { /* Put in caller-id number and subaddress. */ ast_str_set(&chan_name, 0, "i%d/%s:%s-%x", i->pri->span, i->cid_num, - i->cid_subaddr, y); + i->cid_subaddr, (unsigned)y); } ast_mutex_unlock(&i->pri->lock); #endif /* defined(HAVE_PRI) */ @@ -15122,9 +15122,9 @@ static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli ast_cli(a->fd, "Echo Cancellation:\n"); if (tmp->echocancel.head.tap_length) { - ast_cli(a->fd, "\t%d taps\n", tmp->echocancel.head.tap_length); + ast_cli(a->fd, "\t%u taps\n", tmp->echocancel.head.tap_length); for (x = 0; x < tmp->echocancel.head.param_count; x++) { - ast_cli(a->fd, "\t\t%s: %ud\n", tmp->echocancel.params[x].name, tmp->echocancel.params[x].value); + ast_cli(a->fd, "\t\t%s: %dd\n", tmp->echocancel.params[x].name, tmp->echocancel.params[x].value); } ast_cli(a->fd, "\t%scurrently %s\n", tmp->echocanbridged ? "" : "(unless TDM bridged) ", tmp->echocanon ? "ON" : "OFF"); } else { @@ -15185,7 +15185,7 @@ static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli ast_cli(a->fd, "PRI Flags: "); if (chan->resetting != SIG_PRI_RESET_IDLE) { - ast_cli(a->fd, "Resetting=%d ", chan->resetting); + ast_cli(a->fd, "Resetting=%u ", chan->resetting); } if (chan->call) ast_cli(a->fd, "Call "); @@ -15204,7 +15204,7 @@ static char *dahdi_show_channel(struct ast_cli_entry *e, int cmd, struct ast_cli if (tmp->subs[SUB_REAL].dfd > -1) { memset(&ci, 0, sizeof(ci)); if (!ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GETCONF, &ci)) { - ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, ci.confmode); + ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, (unsigned)ci.confmode); } if (!ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GETCONFMUTE, &x)) { ast_cli(a->fd, "Actual Confmute: %s\n", x ? "Yes" : "No"); @@ -16741,12 +16741,12 @@ static void process_echocancel(struct dahdi_chan_conf *confp, const char *data, } param; if (ast_app_separate_args(params[x], '=', (char **) ¶m, 2) < 1) { - ast_log(LOG_WARNING, "Invalid echocancel parameter supplied at line %d: '%s'\n", line, params[x]); + ast_log(LOG_WARNING, "Invalid echocancel parameter supplied at line %u: '%s'\n", line, params[x]); continue; } if (ast_strlen_zero(param.name) || (strlen(param.name) > sizeof(confp->chan.echocancel.params[0].name)-1)) { - ast_log(LOG_WARNING, "Invalid echocancel parameter supplied at line %d: '%s'\n", line, param.name); + ast_log(LOG_WARNING, "Invalid echocancel parameter supplied at line %u: '%s'\n", line, param.name); continue; } @@ -16754,7 +16754,7 @@ static void process_echocancel(struct dahdi_chan_conf *confp, const char *data, if (param.value) { if (sscanf(param.value, "%30d", &confp->chan.echocancel.params[confp->chan.echocancel.head.param_count].value) != 1) { - ast_log(LOG_WARNING, "Invalid echocancel parameter value supplied at line %d: '%s'\n", line, param.value); + ast_log(LOG_WARNING, "Invalid echocancel parameter value supplied at line %u: '%s'\n", line, param.value); continue; } } diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index 032cb2161..7427fe138 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -924,8 +924,8 @@ static int gtalk_create_candidates(struct gtalk *client, struct gtalk_pvt *p, ch ast_copy_string(ours1->name, "rtp", sizeof(ours1->name)); ours1->port = ntohs(sin.sin_port); ours1->preference = 1; - snprintf(user, sizeof(user), "%08lx%08lx", ast_random(), ast_random()); - snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random()); + snprintf(user, sizeof(user), "%08lx%08lx", (long unsigned)ast_random(), (long unsigned)ast_random()); + snprintf(pass, sizeof(pass), "%08lx%08lx", (long unsigned)ast_random(), (long unsigned)ast_random()); ast_copy_string(ours1->username, user, sizeof(ours1->username)); ast_copy_string(ours1->password, pass, sizeof(ours1->password)); ast_copy_string(ours1->ip, ast_sockaddr_stringify_addr(&us), @@ -1081,7 +1081,7 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const ast_copy_string(tmp->them, them, sizeof(tmp->them)); ast_copy_string(tmp->us, us, sizeof(tmp->us)); } else { - snprintf(tmp->sid, sizeof(tmp->sid), "%08lx%08lx", ast_random(), ast_random()); + snprintf(tmp->sid, sizeof(tmp->sid), "%08lx%08lx", (long unsigned)ast_random(), (long unsigned)ast_random()); ast_copy_string(tmp->them, idroster, sizeof(tmp->them)); ast_copy_string(tmp->us, us, sizeof(tmp->us)); tmp->initiator = 1; @@ -1716,7 +1716,7 @@ static int gtalk_write(struct ast_channel *ast, struct ast_frame *frame) return 0; break; default: - ast_log(LOG_WARNING, "Can't send %d type frames with Gtalk write\n", + ast_log(LOG_WARNING, "Can't send %u type frames with Gtalk write\n", frame->frametype); return 0; } diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index a83152b0e..4beacfb22 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -381,7 +381,7 @@ static int (*iax2_regfunk)(const char *username, int onoff) = NULL; break; \ \ for (idx = 0; idx < 16; idx++) \ - sprintf(digest + (idx << 1), "%2.2x", (unsigned char) key[idx]); \ + sprintf(digest + (idx << 1), "%2.2x", (unsigned) key[idx]); \ \ ast_log(LOG_NOTICE, msg " IAX_COMMAND_RTKEY to rotate key to '%s'\n", digest); \ } while(0) @@ -2451,7 +2451,7 @@ static int calltoken_required(struct ast_sockaddr *addr, const char *name, int s user_unref(user); } - ast_debug(1, "Determining if address %s with username %s requires calltoken validation. Optional = %d calltoken_required = %d \n", ast_sockaddr_stringify_addr(addr), name, optional, calltoken_required); + ast_debug(1, "Determining if address %s with username %s requires calltoken validation. Optional = %d calltoken_required = %u \n", ast_sockaddr_stringify_addr(addr), name, optional, calltoken_required); if (((calltoken_required == CALLTOKEN_NO) || (calltoken_required == CALLTOKEN_AUTO)) || (optional && (calltoken_required == CALLTOKEN_DEFAULT))) { res = 0; @@ -3330,7 +3330,7 @@ static int send_packet(struct iax_frame *f) /* Called with iaxsl held */ if (iaxdebug) { - ast_debug(3, "Sending %d on %d/%d to %s\n", f->ts, callno, iaxs[callno]->peercallno, ast_sockaddr_stringify(&iaxs[callno]->addr)); + ast_debug(3, "Sending %u on %d/%d to %s\n", f->ts, callno, iaxs[callno]->peercallno, ast_sockaddr_stringify(&iaxs[callno]->addr)); } if (f->transfer) { iax_outputframe(f, NULL, 0, &iaxs[callno]->transfer, f->datalen - sizeof(struct ast_iax2_full_hdr)); @@ -3489,7 +3489,7 @@ static void __attempt_transmit(const void *data) iax2_destroy(callno); } else { if (iaxs[callno]->owner) { - ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %d, subclass = %u, ts=%d, seqno=%d)\n", + ast_log(LOG_WARNING, "Max retries exceeded to host %s on %s (type = %u, subclass = %d, ts=%u, seqno=%d)\n", ast_sockaddr_stringify_addr(&iaxs[f->callno]->addr), ast_channel_name(iaxs[f->callno]->owner), f->af.frametype, @@ -5424,7 +5424,7 @@ static int iax2_key_rotate(const void *vpvt) ast_mutex_lock(&iaxsl[pvt->callno]); pvt->keyrotateid = ast_sched_add(sched, 120000 + (ast_random() % 180001), iax2_key_rotate, vpvt); - snprintf(key, sizeof(key), "%lX", ast_random()); + snprintf(key, sizeof(key), "%lX", (unsigned long)ast_random()); MD5Init(&md5); MD5Update(&md5, (unsigned char *) key, strlen(key)); @@ -5715,7 +5715,7 @@ static int iax2_indicate(struct ast_channel *c, int condition, const void *data, case AST_CONTROL_REDIRECTING: if (!ast_test_flag64(pvt, IAX_SENDCONNECTEDLINE)) { /* We are not configured to allow sending these updates. */ - ast_debug(2, "Callno %u: Config blocked sending control frame %d.\n", + ast_debug(2, "Callno %d: Config blocked sending control frame %d.\n", callno, condition); goto done; } @@ -6054,7 +6054,7 @@ static unsigned int calc_timestamp(struct chan_iax2_pvt *p, unsigned int ts, str * frame size too) */ if (iaxdebug && abs(ms - p->nextpred) > MAX_TIMESTAMP_SKEW ) - ast_debug(1, "predicted timestamp skew (%u) > max (%u), using real ts instead.\n", + ast_debug(1, "predicted timestamp skew (%d) > max (%d), using real ts instead.\n", abs(ms - p->nextpred), MAX_TIMESTAMP_SKEW); if (f->samples >= rate) /* check to make sure we don't core dump */ @@ -6109,7 +6109,7 @@ static unsigned int calc_rxstamp(struct chan_iax2_pvt *p, unsigned int offset) if (ast_tvzero(p->rxcore)) { p->rxcore = ast_tvnow(); if (iaxdebug) - ast_debug(1, "calc_rxstamp: call=%d: rxcore set to %d.%6.6d - %dms\n", + ast_debug(1, "calc_rxstamp: call=%d: rxcore set to %d.%6.6d - %ums\n", p->callno, (int)(p->rxcore.tv_sec), (int)(p->rxcore.tv_usec), offset); p->rxcore = ast_tvsub(p->rxcore, ast_samp2tv(offset, 1000)); #if 1 @@ -6196,7 +6196,7 @@ static int iax2_trunk_queue(struct chan_iax2_pvt *pvt, struct iax_frame *fr) tpeer->trunkdataalloc += DEFAULT_TRUNKDATA; tpeer->trunkdata = tmp; - ast_debug(1, "Expanded trunk '%s' to %d bytes\n", ast_sockaddr_stringify(&tpeer->addr), tpeer->trunkdataalloc); + ast_debug(1, "Expanded trunk '%s' to %u bytes\n", ast_sockaddr_stringify(&tpeer->addr), tpeer->trunkdataalloc); } else { ast_log(LOG_WARNING, "Maximum trunk data space exceeded to %s\n", ast_sockaddr_stringify(&tpeer->addr)); ast_mutex_unlock(&tpeer->lock); @@ -6336,7 +6336,7 @@ static int decode_frame(ast_aes_decrypt_key *dcx, struct ast_iax2_full_hdr *fh, padding = 16 + (workspace[15] & 0x0f); if (iaxdebug) - ast_debug(1, "Decoding full frame with length %d (padding = %d) (15=%02x)\n", *datalen, padding, workspace[15]); + ast_debug(1, "Decoding full frame with length %d (padding = %d) (15=%02x)\n", *datalen, padding, (unsigned)workspace[15]); if (*datalen < padding + sizeof(struct ast_iax2_full_hdr)) return -1; @@ -6383,7 +6383,7 @@ static int encrypt_frame(ast_aes_encrypt_key *ecx, struct ast_iax2_full_hdr *fh, workspace[15] &= 0xf0; workspace[15] |= (padding & 0xf); if (iaxdebug) - ast_debug(1, "Encoding full frame %d/%d with length %d + %d padding (15=%02x)\n", fh->type, fh->csub, *datalen, padding, workspace[15]); + ast_debug(1, "Encoding full frame %d/%d with length %d + %d padding (15=%02x)\n", fh->type, fh->csub, *datalen, padding, (unsigned)workspace[15]); *datalen += padding; memcpy_encrypt(efh->encdata, workspace, *datalen - sizeof(struct ast_iax2_full_enc_hdr), ecx); if (*datalen >= 32 + sizeof(struct ast_iax2_full_enc_hdr)) @@ -6975,10 +6975,10 @@ static char *handle_cli_iax2_show_threads(struct ast_cli_entry *e, int cmd, stru AST_LIST_LOCK(&idle_list); AST_LIST_TRAVERSE(&idle_list, thread, list) { #ifdef DEBUG_SCHED_MULTITHREAD - ast_cli(a->fd, "Thread %d: state=%d, update=%d, actions=%d, func='%s'\n", + ast_cli(a->fd, "Thread %d: state=%u, update=%d, actions=%d, func='%s'\n", thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc); #else - ast_cli(a->fd, "Thread %d: state=%d, update=%d, actions=%d\n", + ast_cli(a->fd, "Thread %d: state=%u, update=%d, actions=%d\n", thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions); #endif threadcount++; @@ -6992,10 +6992,10 @@ static char *handle_cli_iax2_show_threads(struct ast_cli_entry *e, int cmd, stru else type = 'P'; #ifdef DEBUG_SCHED_MULTITHREAD - ast_cli(a->fd, "Thread %c%d: state=%d, update=%d, actions=%d, func='%s'\n", + ast_cli(a->fd, "Thread %c%d: state=%u, update=%d, actions=%d, func='%s'\n", type, thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc); #else - ast_cli(a->fd, "Thread %c%d: state=%d, update=%d, actions=%d\n", + ast_cli(a->fd, "Thread %c%d: state=%u, update=%d, actions=%d\n", type, thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions); #endif threadcount++; @@ -7005,10 +7005,10 @@ static char *handle_cli_iax2_show_threads(struct ast_cli_entry *e, int cmd, stru AST_LIST_LOCK(&dynamic_list); AST_LIST_TRAVERSE(&dynamic_list, thread, list) { #ifdef DEBUG_SCHED_MULTITHREAD - ast_cli(a->fd, "Thread %d: state=%d, update=%d, actions=%d, func='%s'\n", + ast_cli(a->fd, "Thread %d: state=%u, update=%d, actions=%d, func='%s'\n", thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions, thread->curfunc); #else - ast_cli(a->fd, "Thread %d: state=%d, update=%d, actions=%d\n", + ast_cli(a->fd, "Thread %d: state=%u, update=%d, actions=%d\n", thread->threadnum, thread->iostate, (int)(t - thread->checktime), thread->actions); #endif dynamiccount++; @@ -7409,8 +7409,8 @@ static int ast_cli_netstats(struct mansession *s, int fd, int limit_fmt) int numchans = 0; char first_message[10] = { 0, }; char last_message[10] = { 0, }; -#define ACN_FORMAT1 "%-20.25s %4d %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d %s%s %4s%s\n" -#define ACN_FORMAT2 "%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s%s %s%s\n" +#define ACN_FORMAT1 "%-20.25s %4u %4d %4d %5d %3d %5d %4d %6d %4d %4d %5d %3d %5d %4d %6d %s%s %4s%s\n" +#define ACN_FORMAT2 "%s %u %d %d %d %d %d %d %d %d %d %d %d %d %d %d %s%s %s%s\n" for (x = 0; x < ARRAY_LEN(iaxs); x++) { ast_mutex_lock(&iaxsl[x]); if (iaxs[x]) { @@ -7661,7 +7661,7 @@ static int send_command(struct chan_iax2_pvt *i, char type, int command, unsigne { if (type == AST_FRAME_CONTROL && !iax2_is_control_frame_allowed(command)) { /* Control frame should not go out on the wire. */ - ast_debug(2, "Callno %u: Blocked sending control frame %d.\n", + ast_debug(2, "Callno %d: Blocked sending control frame %d.\n", i->callno, command); return 0; } @@ -8097,7 +8097,7 @@ static int authenticate_verify(struct chan_iax2_pvt *p, struct iax_ies *ies) MD5Final(digest, &md5); /* If they support md5, authenticate with it. */ for (x=0;x<16;x++) - sprintf(requeststr + (x << 1), "%2.2x", digest[x]); /* safe */ + sprintf(requeststr + (x << 1), "%2.2x", (unsigned)digest[x]); /* safe */ if (!strcasecmp(requeststr, md5secret)) { res = 0; break; @@ -8229,7 +8229,7 @@ static int register_verify(int callno, struct ast_sockaddr *addr, struct iax_ies MD5Update(&md5, (unsigned char *)tmppw, strlen(tmppw)); MD5Final(digest, &md5); for (x=0;x<16;x++) - sprintf(requeststr + (x << 1), "%2.2x", digest[x]); /* safe */ + sprintf(requeststr + (x << 1), "%2.2x", (unsigned)digest[x]); /* safe */ if (!strcasecmp(requeststr, md5secret)) break; } @@ -8313,7 +8313,7 @@ static int authenticate(const char *challenge, const char *secret, const char *k MD5Final(digest, &md5); /* If they support md5, authenticate with it. */ for (x=0;x<16;x++) - sprintf(digres + (x << 1), "%2.2x", digest[x]); /* safe */ + sprintf(digres + (x << 1), "%2.2x", (unsigned)digest[x]); /* safe */ if (pvt) { build_encryption_keys(digest, pvt); } @@ -9387,7 +9387,7 @@ static int timing_read(int *id, int fd, short events, void *cbdata) res = send_trunk(tpeer, &now); trunk_timed++; if (iaxtrunkdebug) { - ast_verbose(" - Trunk peer (%s) has %d call chunk%s in transit, %d bytes backloged and has hit a high water mark of %d bytes\n", + ast_verbose(" - Trunk peer (%s) has %d call chunk%s in transit, %u bytes backloged and has hit a high water mark of %u bytes\n", ast_sockaddr_stringify(&tpeer->addr), res, (res != 1) ? "s" : "", @@ -9579,7 +9579,7 @@ static void log_jitterstats(unsigned short callno) localooo = jbinfo.frames_ooo; localpackets = jbinfo.frames_in; } - ast_debug(3, "JB STATS:%s ping=%d ljitterms=%d ljbdelayms=%d ltotlost=%d lrecentlosspct=%d ldropped=%d looo=%d lrecvd=%d rjitterms=%d rjbdelayms=%d rtotlost=%d rrecentlosspct=%d rdropped=%d rooo=%d rrecvd=%d\n", + ast_debug(3, "JB STATS:%s ping=%u ljitterms=%d ljbdelayms=%d ltotlost=%d lrecentlosspct=%d ldropped=%d looo=%d lrecvd=%d rjitterms=%d rjbdelayms=%d rtotlost=%d rrecentlosspct=%d rdropped=%d rooo=%d rrecvd=%d\n", ast_channel_name(iaxs[callno]->owner), iaxs[callno]->pingtime, localjitter, @@ -10270,7 +10270,7 @@ static int socket_process_helper(struct iax2_thread *thread) } if (ntohs(mh->callno) & IAX_FLAG_FULL) { if (iaxdebug) - ast_debug(1, "Received packet %d, (%d, %u)\n", fh->oseqno, f.frametype, f.subclass.integer); + ast_debug(1, "Received packet %d, (%u, %d)\n", fh->oseqno, f.frametype, f.subclass.integer); /* Check if it's out of order (and not an ACK or INVAL) */ fr->oseqno = fh->oseqno; fr->iseqno = fh->iseqno; @@ -10310,7 +10310,7 @@ static int socket_process_helper(struct iax2_thread *thread) (f.subclass.integer != IAX_COMMAND_VNAK)) || (f.frametype != AST_FRAME_IAX)) { /* If it's not an ACK packet, it's out of order. */ - ast_debug(1, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n", + ast_debug(1, "Packet arrived out of order (expecting %d, got %d) (frametype = %u, subclass = %d)\n", iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, f.subclass.integer); /* Check to see if we need to request retransmission, * and take sequence number wraparound into account */ @@ -10550,7 +10550,7 @@ static int socket_process_helper(struct iax2_thread *thread) f.subclass.integer != IAX_COMMAND_LAGRP) { iaxs[fr->callno]->last = fr->ts; if (iaxdebug) - ast_debug(1, "For call=%d, set last=%d\n", fr->callno, fr->ts); + ast_debug(1, "For call=%d, set last=%u\n", fr->callno, fr->ts); } iaxs[fr->callno]->last_iax_message = f.subclass.integer; if (!iaxs[fr->callno]->first_iax_message) { @@ -11007,7 +11007,7 @@ static int socket_process_helper(struct iax2_thread *thread) peer = iaxs[fr->callno]->peerpoke; if ((peer->lastms < 0) || (peer->historicms > peer->maxms)) { if (iaxs[fr->callno]->pingtime <= peer->maxms) { - ast_log(LOG_NOTICE, "Peer '%s' is now REACHABLE! Time: %d\n", peer->name, iaxs[fr->callno]->pingtime); + ast_log(LOG_NOTICE, "Peer '%s' is now REACHABLE! Time: %u\n", peer->name, iaxs[fr->callno]->pingtime); ast_endpoint_set_state(peer->endpoint, AST_ENDPOINT_ONLINE); blob = ast_json_pack("{s: s, s: i}", "peer_status", "Reachable", @@ -11016,7 +11016,7 @@ static int socket_process_helper(struct iax2_thread *thread) } } else if ((peer->historicms > 0) && (peer->historicms <= peer->maxms)) { if (iaxs[fr->callno]->pingtime > peer->maxms) { - ast_log(LOG_NOTICE, "Peer '%s' is now TOO LAGGED (%d ms)!\n", peer->name, iaxs[fr->callno]->pingtime); + ast_log(LOG_NOTICE, "Peer '%s' is now TOO LAGGED (%u ms)!\n", peer->name, iaxs[fr->callno]->pingtime); ast_endpoint_set_state(peer->endpoint, AST_ENDPOINT_ONLINE); blob = ast_json_pack("{s: s, s: i}", "peer_status", "Lagged", @@ -11726,7 +11726,7 @@ immediatedial: if (f.frametype == AST_FRAME_CONTROL) { if (!iax2_is_control_frame_allowed(f.subclass.integer)) { /* Control frame not allowed to come from the wire. */ - ast_debug(2, "Callno %u: Blocked receiving control frame %d.\n", + ast_debug(2, "Callno %d: Blocked receiving control frame %d.\n", fr->callno, f.subclass.integer); ast_variables_destroy(ies.vars); ast_mutex_unlock(&iaxsl[fr->callno]); @@ -11737,7 +11737,7 @@ immediatedial: if (iaxs[fr->callno] && !ast_test_flag64(iaxs[fr->callno], IAX_RECVCONNECTEDLINE)) { /* We are not configured to allow receiving these updates. */ - ast_debug(2, "Callno %u: Config blocked receiving control frame %d.\n", + ast_debug(2, "Callno %d: Config blocked receiving control frame %d.\n", fr->callno, f.subclass.integer); ast_variables_destroy(ies.vars); ast_mutex_unlock(&iaxsl[fr->callno]); @@ -11809,7 +11809,7 @@ immediatedial: fr->outoforder = 0; } else { if (iaxdebug && iaxs[fr->callno]) { - ast_debug(1, "Received out of order packet... (type=%d, subclass %d, ts = %d, last = %d)\n", f.frametype, f.subclass.integer, fr->ts, iaxs[fr->callno]->last); + ast_debug(1, "Received out of order packet... (type=%u, subclass %d, ts = %u, last = %u)\n", f.frametype, f.subclass.integer, fr->ts, iaxs[fr->callno]->last); } fr->outoforder = -1; } @@ -11824,7 +11824,7 @@ immediatedial: iaxs[fr->callno]->last = fr->ts; #if 1 if (iaxdebug) - ast_debug(1, "For call=%d, set last=%d\n", fr->callno, fr->ts); + ast_debug(1, "For call=%d, set last=%u\n", fr->callno, fr->ts); #endif } diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index 685575349..68d9848e2 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -657,10 +657,10 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p, ours1->port = ntohs(sin.sin_port); ours1->priority = 1678246398; ours1->protocol = AJI_PROTOCOL_UDP; - snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random()); + snprintf(pass, sizeof(pass), "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); ast_copy_string(ours1->password, pass, sizeof(ours1->password)); ours1->type = AJI_CONNECT_HOST; - snprintf(user, sizeof(user), "%08lx%08lx", ast_random(), ast_random()); + snprintf(user, sizeof(user), "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); ast_copy_string(ours1->ufrag, user, sizeof(ours1->ufrag)); p->ourcandidates = ours1; @@ -677,11 +677,11 @@ static int jingle_create_candidates(struct jingle *client, struct jingle_pvt *p, ours2->port = ntohs(sin.sin_port); ours2->priority = 1678246397; ours2->protocol = AJI_PROTOCOL_UDP; - snprintf(pass, sizeof(pass), "%08lx%08lx", ast_random(), ast_random()); + snprintf(pass, sizeof(pass), "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); ast_copy_string(ours2->password, pass, sizeof(ours2->password)); ours2->type = AJI_CONNECT_PRFLX; - snprintf(user, sizeof(user), "%08lx%08lx", ast_random(), ast_random()); + snprintf(user, sizeof(user), "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); ast_copy_string(ours2->ufrag, user, sizeof(ours2->ufrag)); ours1->next = ours2; ours2 = NULL; @@ -814,7 +814,7 @@ static struct jingle_pvt *jingle_alloc(struct jingle *client, const char *from, ast_copy_string(tmp->sid, sid, sizeof(tmp->sid)); ast_copy_string(tmp->them, from, sizeof(tmp->them)); } else { - snprintf(tmp->sid, sizeof(tmp->sid), "%08lx%08lx", ast_random(), ast_random()); + snprintf(tmp->sid, sizeof(tmp->sid), "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); ast_copy_string(tmp->them, idroster, sizeof(tmp->them)); tmp->initiator = 1; } @@ -1326,7 +1326,7 @@ static int jingle_write(struct ast_channel *ast, struct ast_frame *frame) return 0; break; default: - ast_log(LOG_WARNING, "Can't send %d type frames with Jingle write\n", + ast_log(LOG_WARNING, "Can't send %u type frames with Jingle write\n", frame->frametype); return 0; } diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index ad2b8bc5b..1955edaea 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -1245,7 +1245,7 @@ static int mgcp_write(struct ast_channel *ast, struct ast_frame *frame) if (frame->frametype == AST_FRAME_IMAGE) return 0; else { - ast_log(LOG_WARNING, "Can't send %d type frames with MGCP write\n", frame->frametype); + ast_log(LOG_WARNING, "Can't send %u type frames with MGCP write\n", frame->frametype); return 0; } } else { @@ -2023,7 +2023,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req) sdpLineNum_iterator_init(&iterator); while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') { char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */ - if (sscanf(a, "rtpmap: %30u %127[^/]/", &codec, mimeSubtype) != 2) + if (sscanf(a, "rtpmap: %30d %127[^/]/", &codec, mimeSubtype) != 2) continue; /* Note: should really look at the 'freq' and '#chans' params too */ ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(sub->rtp), sub->rtp, codec, "audio", mimeSubtype, 0); @@ -2123,9 +2123,9 @@ static int init_req(struct mgcp_endpoint *p, struct mgcp_request *req, char *ver req->header[req->headers] = req->data + req->len; /* check if we need brackets around the gw name */ if (p->parent->isnamedottedip) { - snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %d %s@[%s] MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : ""); + snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %u %s@[%s] MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : ""); } else { -+ snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %d %s@%s MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : ""); ++ snprintf(req->header[req->headers], sizeof(req->data) - req->len, "%s %u %s@%s MGCP 1.0%s\r\n", verb, oseq, p->name, p->parent->name, p->ncs ? " NCS 1.0" : ""); } req->len += strlen(req->header[req->headers]); if (req->headers < MGCP_MAX_HEADERS) { @@ -2794,7 +2794,7 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub req = find_command(p, sub, &p->cmd_queue, &p->cmd_queue_lock, ident); if (!req) { - ast_verb(3, "No command found on [%s] for transaction %d. Ignoring...\n", + ast_verb(3, "No command found on [%s] for transaction %u. Ignoring...\n", gw->name, ident); return; } @@ -2808,10 +2808,10 @@ static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub p->hookstate = MGCP_ONHOOK; break; case 406: - ast_log(LOG_NOTICE, "Transaction %d timed out\n", ident); + ast_log(LOG_NOTICE, "Transaction %u timed out\n", ident); break; case 407: - ast_log(LOG_NOTICE, "Transaction %d aborted\n", ident); + ast_log(LOG_NOTICE, "Transaction %u aborted\n", ident); break; } if (sub) { @@ -2964,7 +2964,7 @@ static void start_rtp(struct mgcp_subchannel *sub) ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_NAT, sub->nat); } /* Make a call*ID */ - snprintf(sub->callid, sizeof(sub->callid), "%08lx%s", ast_random(), sub->txident); + snprintf(sub->callid, sizeof(sub->callid), "%08lx%s", (unsigned long)ast_random(), sub->txident); /* Transmit the connection create */ if(!sub->parent->pktcgatealloc) { transmit_connect_with_sdp(sub, NULL); @@ -4207,7 +4207,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->mwi_event_sub = stasis_subscribe(mailbox_specific_topic, mwi_event_cb, NULL); } } - snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", ast_random()); + snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", (unsigned long)ast_random()); e->msgstate = -1; e->amaflags = amaflags; ast_format_cap_copy(e->cap, global_capability); @@ -4236,7 +4236,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->hookstate = MGCP_ONHOOK; e->chanvars = copy_vars(chanvars); if (!ep_reload) { - /*snprintf(txident, sizeof(txident), "%08lx", ast_random());*/ + /*snprintf(txident, sizeof(txident), "%08lx", (unsigned long)ast_random());*/ for (i = 0; i < MAX_SUBS; i++) { sub = ast_calloc(1, sizeof(*sub)); if (sub) { @@ -4245,7 +4245,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) ast_mutex_init(&sub->cx_queue_lock); sub->parent = e; sub->id = i; - snprintf(sub->txident, sizeof(sub->txident), "%08lx", ast_random()); + snprintf(sub->txident, sizeof(sub->txident), "%08lx", (unsigned long)ast_random()); /*stnrcpy(sub->txident, txident, sizeof(sub->txident) - 1);*/ sub->cxmode = MGCP_CX_INACTIVE; sub->nat = nat; @@ -4347,7 +4347,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->onhooktime = time(NULL); /* ASSUME we're onhook */ e->hookstate = MGCP_ONHOOK; - snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", ast_random()); + snprintf(e->rqnt_ident, sizeof(e->rqnt_ident), "%08lx", (unsigned long)ast_random()); } for (i = 0, sub = NULL; i < MAX_SUBS; i++) { @@ -4369,7 +4369,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) ast_copy_string(sub->magic, MGCP_SUBCHANNEL_MAGIC, sizeof(sub->magic)); sub->parent = e; sub->id = i; - snprintf(sub->txident, sizeof(sub->txident), "%08lx", ast_random()); + snprintf(sub->txident, sizeof(sub->txident), "%08lx", (unsigned long)ast_random()); sub->cxmode = MGCP_CX_INACTIVE; sub->next = e->sub; e->sub = sub; diff --git a/channels/chan_motif.c b/channels/chan_motif.c index 80b7f0da0..d853839ab 100644 --- a/channels/chan_motif.c +++ b/channels/chan_motif.c @@ -727,7 +727,7 @@ static struct jingle_session *jingle_alloc(struct jingle_endpoint *endpoint, con } if (ast_strlen_zero(sid)) { - ast_string_field_build(session, sid, "%08lx%08lx", ast_random(), ast_random()); + ast_string_field_build(session, sid, "%08lx%08lx", (unsigned long)ast_random(), (unsigned long)ast_random()); session->outgoing = 1; ast_string_field_set(session, audio_name, "audio"); ast_string_field_set(session, video_name, "video"); @@ -782,7 +782,7 @@ static struct ast_channel *jingle_new(struct jingle_endpoint *endpoint, struct j return NULL; } - if (!(chan = ast_channel_alloc(1, state, S_OR(title, ""), S_OR(cid_name, ""), "", "", "", assignedids, requestor, 0, "Motif/%s-%04lx", str, ast_random() & 0xffff))) { + if (!(chan = ast_channel_alloc(1, state, S_OR(title, ""), S_OR(cid_name, ""), "", "", "", assignedids, requestor, 0, "Motif/%s-%04lx", str, (unsigned long)(ast_random() & 0xffff)))) { return NULL; } @@ -941,13 +941,13 @@ static int jingle_add_ice_udp_candidates_to_transport(struct ast_rtp_instance *r break; } - snprintf(tmp, sizeof(tmp), "%d", candidate->id); + snprintf(tmp, sizeof(tmp), "%u", candidate->id); iks_insert_attrib(local_candidate, "component", tmp); snprintf(tmp, sizeof(tmp), "%d", ast_str_hash(candidate->foundation)); iks_insert_attrib(local_candidate, "foundation", tmp); iks_insert_attrib(local_candidate, "generation", "0"); iks_insert_attrib(local_candidate, "network", "0"); - snprintf(tmp, sizeof(tmp), "%04lx", ast_random() & 0xffff); + snprintf(tmp, sizeof(tmp), "%04lx", (unsigned long)(ast_random() & 0xffff)); iks_insert_attrib(local_candidate, "id", tmp); iks_insert_attrib(local_candidate, "ip", ast_sockaddr_stringify_host(&candidate->address)); iks_insert_attrib(local_candidate, "port", ast_sockaddr_stringify_port(&candidate->address)); @@ -1339,7 +1339,7 @@ static int jingle_add_payloads_to_description(struct jingle_session *session, st if ((format.id == AST_FORMAT_G722) && ((session->transport == JINGLE_TRANSPORT_GOOGLE_V1) || (session->transport == JINGLE_TRANSPORT_GOOGLE_V2))) { iks_insert_attrib(payload, "clockrate", "16000"); } else { - snprintf(tmp, sizeof(tmp), "%d", ast_rtp_lookup_sample_rate2(1, &format, 0)); + snprintf(tmp, sizeof(tmp), "%u", ast_rtp_lookup_sample_rate2(1, &format, 0)); iks_insert_attrib(payload, "clockrate", tmp); } @@ -1715,7 +1715,7 @@ static int jingle_write(struct ast_channel *ast, struct ast_frame *frame) } break; default: - ast_log(LOG_WARNING, "Can't send %d type frames with Jingle write\n", + ast_log(LOG_WARNING, "Can't send %u type frames with Jingle write\n", frame->frametype); return 0; } @@ -2145,7 +2145,7 @@ static int jingle_interpret_ice_udp_transport(struct jingle_session *session, ik } if ((sscanf(component, "%30u", &local_candidate.id) != 1) || - (sscanf(priority, "%30u", &local_candidate.priority) != 1) || + (sscanf(priority, "%30u", (unsigned *)&local_candidate.priority) != 1) || (sscanf(port, "%30d", &real_port) != 1)) { jingle_queue_hangup_with_cause(session, AST_CAUSE_PROTOCOL_ERROR); ast_log(LOG_ERROR, "Invalid ICE-UDP candidate information received on session '%s'\n", session->sid); diff --git a/channels/chan_phone.c b/channels/chan_phone.c index 2adef5298..1e5e19d57 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -537,7 +537,7 @@ static struct ast_frame *phone_exception(struct ast_channel *ast) ast_setstate(ast, AST_STATE_UP); return &p->fr; } else - ast_log(LOG_WARNING, "Got off hook in weird state %d\n", ast_channel_state(ast)); + ast_log(LOG_WARNING, "Got off hook in weird state %u\n", ast_channel_state(ast)); } } #if 1 @@ -666,7 +666,7 @@ static int phone_write(struct ast_channel *ast, struct ast_frame *frame) /* Write a frame of (presumably voice) data */ if (frame->frametype != AST_FRAME_VOICE && p->mode != MODE_FXS) { if (frame->frametype != AST_FRAME_IMAGE) - ast_log(LOG_WARNING, "Don't know what to do with frame type '%d'\n", frame->frametype); + ast_log(LOG_WARNING, "Don't know what to do with frame type '%u'\n", frame->frametype); return 0; } if (!(frame->subclass.format.id == AST_FORMAT_G723_1 || diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index 8d347e7a0..4876f02a4 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -361,7 +361,7 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s } if (!(chan = ast_channel_alloc(1, state, S_OR(session->id.number.str, ""), S_OR(session->id.name.str, ""), "", "", "", assignedids, requestor, 0, "PJSIP/%s-%08x", ast_sorcery_object_get_id(session->endpoint), - ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) { + (unsigned)ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) { return NULL; } @@ -638,7 +638,7 @@ static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *frame) case AST_FRAME_MODEM: break; default: - ast_log(LOG_WARNING, "Can't send %d type frames with PJSIP\n", frame->frametype); + ast_log(LOG_WARNING, "Can't send %u type frames with PJSIP\n", frame->frametype); break; } diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 1f9453cb4..16a8a55e0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -863,7 +863,7 @@ static int regobjs = 0; /*!< Registry objects */ /*! @} */ static struct ast_flags global_flags[3] = {{0}}; /*!< global SIP_ flags */ -static int global_t38_maxdatagram; /*!< global T.38 FaxMaxDatagram override */ +static unsigned int global_t38_maxdatagram; /*!< global T.38 FaxMaxDatagram override */ static struct stasis_subscription *network_change_sub; /*!< subscription id for network change events */ static struct stasis_subscription *acl_change_sub; /*!< subscription id for named ACL system change events */ @@ -3289,7 +3289,7 @@ static void *_sip_tcp_helper_thread(struct ast_tcptls_session_instance *tcptls_s } break; default: - ast_log(LOG_ERROR, "Unknown tcptls thread alert '%d'\n", alert); + ast_log(LOG_ERROR, "Unknown tcptls thread alert '%u'\n", alert); } } } @@ -3539,7 +3539,7 @@ void dialog_unlink_all(struct sip_pvt *dialog) void *registry_unref(struct sip_registry *reg, char *tag) { - ast_debug(3, "SIP Registry %s: refcount now %d\n", reg->hostname, reg->refcount - 1); + ast_debug(3, "SIP Registry %s: refcount now %u\n", reg->hostname, reg->refcount - 1); ASTOBJ_UNREF(reg, sip_registry_destroy); return NULL; } @@ -3547,7 +3547,7 @@ void *registry_unref(struct sip_registry *reg, char *tag) /*! \brief Add object reference to SIP registry */ static struct sip_registry *registry_addref(struct sip_registry *reg, char *tag) { - ast_debug(3, "SIP Registry %s: refcount now %d\n", reg->hostname, reg->refcount + 1); + ast_debug(3, "SIP Registry %s: refcount now %u\n", reg->hostname, reg->refcount + 1); return ASTOBJ_REF(reg); /* Add pointer to registry in packet */ } @@ -3985,7 +3985,7 @@ static void build_via(struct sip_pvt *p) snprintf(p->via, sizeof(p->via), "SIP/2.0/%s %s;branch=z9hG4bK%08x%s", get_transport_pvt(p), ast_sockaddr_stringify_remote(&p->ourip), - (int) p->branch, rport); + (unsigned)p->branch, rport); } /*! \brief NAT fix - decide which IP address to use for Asterisk server? @@ -4343,7 +4343,7 @@ static enum sip_result __sip_reliable_xmit(struct sip_pvt *p, uint32_t seqno, in struct sip_pkt *pkt = NULL; int siptimer_a = DEFAULT_RETRANS; int xmitres = 0; - int respid; + unsigned respid; if (sipmethod == SIP_INVITE) { /* Note this is a pending invite */ @@ -5063,7 +5063,7 @@ static int sip_sendhtml(struct ast_channel *chan, int subclass, const char *data ast_string_field_build(p, url, "<%s>;mode=active", data); if (sip_debug_test_pvt(p)) - ast_debug(1, "Send URL %s, state = %d!\n", data, ast_channel_state(chan)); + ast_debug(1, "Send URL %s, state = %u!\n", data, ast_channel_state(chan)); switch (ast_channel_state(chan)) { case AST_STATE_RING: @@ -5080,7 +5080,7 @@ static int sip_sendhtml(struct ast_channel *chan, int subclass, const char *data } break; default: - ast_log(LOG_WARNING, "Don't know how to send URI when state is %d!\n", ast_channel_state(chan)); + ast_log(LOG_WARNING, "Don't know how to send URI when state is %u!\n", ast_channel_state(chan)); } return 0; @@ -5855,7 +5855,7 @@ static void change_t38_state(struct sip_pvt *p, int state) return; p->t38.state = state; - ast_debug(2, "T38 state changed to %d on channel %s\n", p->t38.state, chan ? ast_channel_name(chan) : "<none>"); + ast_debug(2, "T38 state changed to %u on channel %s\n", p->t38.state, chan ? ast_channel_name(chan) : "<none>"); /* If no channel was provided we can't send off a control frame */ if (!chan) @@ -7508,7 +7508,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame) } break; default: - ast_log(LOG_WARNING, "Can't send %d type frames with SIP write\n", frame->frametype); + ast_log(LOG_WARNING, "Can't send %u type frames with SIP write\n", frame->frametype); return 0; } @@ -8056,7 +8056,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit sip_pvt_unlock(i); /* Don't hold a sip pvt lock while we allocate a channel */ - tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, assignedids, requestor, i->amaflags, "SIP/%s-%08x", my_name, ast_atomic_fetchadd_int((int *)&chan_idx, +1)); + tmp = ast_channel_alloc(1, state, i->cid_num, i->cid_name, i->accountcode, i->exten, i->context, assignedids, requestor, i->amaflags, "SIP/%s-%08x", my_name, (unsigned)ast_atomic_fetchadd_int((int *)&chan_idx, +1)); } if (!tmp) { ast_log(LOG_WARNING, "Unable to allocate AST channel structure for SIP channel\n"); @@ -8508,7 +8508,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p } ast_str_append(&out, 0, " -> "); for (i = 0; i < f->datalen; i++) { - ast_str_append(&out, 0, "%02X ", arr[i]); + ast_str_append(&out, 0, "%02X ", (unsigned)arr[i]); } ast_verb(0, "%s\n", ast_str_buffer(out)); ast_free(out); @@ -8632,7 +8632,7 @@ static char *generate_random_string(char *buf, size_t size) for (x=0; x<4; x++) val[x] = ast_random(); - snprintf(buf, size, "%08lx%08lx%08lx%08lx", val[0], val[1], val[2], val[3]); + snprintf(buf, size, "%08lx%08lx%08lx%08lx", (unsigned long)val[0], (unsigned long)val[1], (unsigned long)val[2], (unsigned long)val[3]); return buf; } @@ -8732,13 +8732,13 @@ static void build_callid_registry(struct sip_registry *reg, const struct ast_soc /*! \brief Build SIP From tag value for REGISTER */ static void build_localtag_registry(struct sip_registry *reg) { - ast_string_field_build(reg, localtag, "as%08lx", ast_random()); + ast_string_field_build(reg, localtag, "as%08lx", (unsigned long)ast_random()); } /*! \brief Make our SIP dialog tag */ static void make_our_tag(struct sip_pvt *pvt) { - ast_string_field_build(pvt, tag, "as%08lx", ast_random()); + ast_string_field_build(pvt, tag, "as%08lx", (unsigned long)ast_random()); } /*! \brief Allocate Session-Timers struct w/in dialog */ @@ -9038,7 +9038,7 @@ static enum match_req_res match_req_to_dialog(struct sip_pvt *sip_pvt_ptr, struc /* totag did not match what we had stored for them. */ char invite_branch[32] = { 0, }; if (sip_pvt_ptr->invite_branch) { - snprintf(invite_branch, sizeof(invite_branch), "z9hG4bK%08x", (int) sip_pvt_ptr->invite_branch); + snprintf(invite_branch, sizeof(invite_branch), "z9hG4bK%08x", (unsigned)sip_pvt_ptr->invite_branch); } /* Forked Request Detection * @@ -10046,7 +10046,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action int newnoncodeccapability; const char *codecs; - int codec; + unsigned int codec; /* SRTP */ int secure_audio = FALSE; @@ -10054,7 +10054,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Others */ int sendonly = -1; - int numberofports; + unsigned int numberofports; int last_rtpmap_codec = 0; int red_data_pt[10]; /* For T.140 RED */ int red_num_gen = 0; /* For T.140 RED */ @@ -10170,7 +10170,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action int text = FALSE; int processed_crypto = FALSE; char protocol[18] = {0,}; - int x; + unsigned int x; struct ast_rtp_engine_dtls *dtls; numberofports = 0; @@ -10215,7 +10215,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Check number of ports offered for stream */ if (numberofports > 1) { - ast_log(LOG_WARNING, "%d ports offered for audio media, not supported by Asterisk. Will try anyway...\n", numberofports); + ast_log(LOG_WARNING, "%u ports offered for audio media, not supported by Asterisk. Will try anyway...\n", numberofports); } if ((!strcmp(protocol, "RTP/SAVPF") || !strcmp(protocol, "UDP/TLS/RTP/SAVPF")) && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) { @@ -10287,7 +10287,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action goto process_sdp_cleanup; } if (debug) { - ast_verbose("Found RTP audio format %d\n", codec); + ast_verbose("Found RTP audio format %u\n", codec); } ast_rtp_codecs_payloads_set_m_type(&newaudiortp, NULL, codec); @@ -10320,7 +10320,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Check number of ports offered for stream */ if (numberofports > 1) { - ast_log(LOG_WARNING, "%d ports offered for video stream, not supported by Asterisk. Will try anyway...\n", numberofports); + ast_log(LOG_WARNING, "%u ports offered for video stream, not supported by Asterisk. Will try anyway...\n", numberofports); } if (has_media_stream(p, SDP_VIDEO)) { @@ -10367,7 +10367,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action goto process_sdp_cleanup; } if (debug) { - ast_verbose("Found RTP video format %d\n", codec); + ast_verbose("Found RTP video format %u\n", codec); } ast_rtp_codecs_payloads_set_m_type(&newvideortp, NULL, codec); } @@ -10399,7 +10399,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action /* Check number of ports offered for stream */ if (numberofports > 1) { - ast_log(LOG_WARNING, "%d ports offered for text stream, not supported by Asterisk. Will try anyway...\n", numberofports); + ast_log(LOG_WARNING, "%u ports offered for text stream, not supported by Asterisk. Will try anyway...\n", numberofports); } if (!strcmp(protocol, "RTP/AVPF") && !ast_test_flag(&p->flags[2], SIP_PAGE3_USE_AVPF)) { @@ -10431,7 +10431,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action goto process_sdp_cleanup; } if (debug) { - ast_verbose("Found RTP text format %d\n", codec); + ast_verbose("Found RTP text format %u\n", codec); } ast_rtp_codecs_payloads_set_m_type(&newtextrtp, NULL, codec); } @@ -11065,7 +11065,7 @@ static int process_sdp_a_ice(const char *a, struct sip_pvt *p, struct ast_rtp_in int found = FALSE; char ufrag[256], pwd[256], foundation[32], transport[4], address[46], cand_type[6], relay_address[46] = ""; struct ast_rtp_engine_ice_candidate candidate = { 0, }; - int port, relay_port = 0; + unsigned int port, relay_port = 0; if (!instance || !(ice = ast_rtp_instance_get_ice(instance))) { return found; @@ -11077,7 +11077,7 @@ static int process_sdp_a_ice(const char *a, struct sip_pvt *p, struct ast_rtp_in } else if (sscanf(a, "ice-pwd: %255s", pwd) == 1) { ice->set_authentication(instance, NULL, pwd); found = TRUE; - } else if (sscanf(a, "candidate: %31s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, &candidate.priority, + } else if (sscanf(a, "candidate: %31s %30u %3s %30u %23s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport, (unsigned *)&candidate.priority, address, &port, cand_type, relay_address, &relay_port) >= 7) { candidate.foundation = foundation; candidate.transport = transport; @@ -11167,7 +11167,7 @@ static int process_sdp_a_dtls(const char *a, struct sip_pvt *p, struct ast_rtp_i static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_codecs *newaudiortp, int *last_rtpmap_codec) { int found = FALSE; - int codec; + unsigned int codec; char mimeSubtype[128]; char fmtp_string[256]; unsigned int sample_rate; @@ -11203,18 +11203,18 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newaudiortp, NULL, codec, "audio", mimeSubtype, ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0, sample_rate))) { if (debug) - ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Found audio description format %s for ID %u\n", mimeSubtype, codec); //found_rtpmap_codecs[last_rtpmap_codec] = codec; (*last_rtpmap_codec)++; found = TRUE; } else { ast_rtp_codecs_payloads_unset(newaudiortp, NULL, codec); if (debug) - ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Found unknown media description format %s for ID %u\n", mimeSubtype, codec); } } else { if (debug) - ast_verbose("Discarded description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Discarded description format %s for ID %u\n", mimeSubtype, codec); } } else if (sscanf(a, "fmtp: %30u %255[^\t\n]", &codec, fmtp_string) == 2) { struct ast_format *format; @@ -11232,7 +11232,7 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ case AST_FORMAT_SIREN7: if (sscanf(fmtp_string, "bitrate=%30u", &bit_rate) == 1) { if (bit_rate != 32000) { - ast_log(LOG_WARNING, "Got Siren7 offer at %d bps, but only 32000 bps supported; ignoring.\n", bit_rate); + ast_log(LOG_WARNING, "Got Siren7 offer at %u bps, but only 32000 bps supported; ignoring.\n", bit_rate); ast_rtp_codecs_payloads_unset(newaudiortp, NULL, codec); } else { found = TRUE; @@ -11242,7 +11242,7 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ case AST_FORMAT_SIREN14: if (sscanf(fmtp_string, "bitrate=%30u", &bit_rate) == 1) { if (bit_rate != 48000) { - ast_log(LOG_WARNING, "Got Siren14 offer at %d bps, but only 48000 bps supported; ignoring.\n", bit_rate); + ast_log(LOG_WARNING, "Got Siren14 offer at %u bps, but only 48000 bps supported; ignoring.\n", bit_rate); ast_rtp_codecs_payloads_unset(newaudiortp, NULL, codec); } else { found = TRUE; @@ -11252,7 +11252,7 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ case AST_FORMAT_G719: if (sscanf(fmtp_string, "bitrate=%30u", &bit_rate) == 1) { if (bit_rate != 64000) { - ast_log(LOG_WARNING, "Got G.719 offer at %d bps, but only 64000 bps supported; ignoring.\n", bit_rate); + ast_log(LOG_WARNING, "Got G.719 offer at %u bps, but only 64000 bps supported; ignoring.\n", bit_rate); ast_rtp_codecs_payloads_unset(newaudiortp, NULL, codec); } else { found = TRUE; @@ -11269,7 +11269,7 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ static int process_sdp_a_video(const char *a, struct sip_pvt *p, struct ast_rtp_codecs *newvideortp, int *last_rtpmap_codec) { int found = FALSE; - int codec; + unsigned int codec; char mimeSubtype[128]; unsigned int sample_rate; int debug = sip_debug_test_pvt(p); @@ -11283,19 +11283,19 @@ static int process_sdp_a_video(const char *a, struct sip_pvt *p, struct ast_rtp_ || !strncasecmp(mimeSubtype, "VP8", 3)) { if (!(ast_rtp_codecs_payloads_set_rtpmap_type_rate(newvideortp, NULL, codec, "video", mimeSubtype, 0, sample_rate))) { if (debug) - ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Found video description format %s for ID %u\n", mimeSubtype, codec); //found_rtpmap_codecs[last_rtpmap_codec] = codec; (*last_rtpmap_codec)++; found = TRUE; } else { ast_rtp_codecs_payloads_unset(newvideortp, NULL, codec); if (debug) - ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Found unknown media description format %s for ID %u\n", mimeSubtype, codec); } } } else { if (debug) - ast_verbose("Discarded description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Discarded description format %s for ID %u\n", mimeSubtype, codec); } } else if (sscanf(a, "fmtp: %30u %255s", &codec, fmtp_string) == 2) { struct ast_format *format; @@ -11315,7 +11315,7 @@ static int process_sdp_a_video(const char *a, struct sip_pvt *p, struct ast_rtp_ static int process_sdp_a_text(const char *a, struct sip_pvt *p, struct ast_rtp_codecs *newtextrtp, char *red_fmtp, int *red_num_gen, int *red_data_pt, int *last_rtpmap_codec) { int found = FALSE; - int codec; + unsigned int codec; char mimeSubtype[128]; unsigned int sample_rate; char *red_cp; @@ -11333,25 +11333,25 @@ static int process_sdp_a_text(const char *a, struct sip_pvt *p, struct ast_rtp_c } else if (!strncasecmp(mimeSubtype, "RED", 3)) { /* Text with Redudancy */ if (p->trtp) { ast_rtp_codecs_payloads_set_rtpmap_type_rate(newtextrtp, NULL, codec, "text", mimeSubtype, 0, sample_rate); - sprintf(red_fmtp, "fmtp:%d ", codec); + sprintf(red_fmtp, "fmtp:%u ", codec); if (debug) - ast_verbose("RED submimetype has payload type: %d\n", codec); + ast_verbose("RED submimetype has payload type: %u\n", codec); found = TRUE; } } } else { if (debug) - ast_verbose("Discarded description format %s for ID %d\n", mimeSubtype, codec); + ast_verbose("Discarded description format %s for ID %u\n", mimeSubtype, codec); } } else if (!strncmp(a, red_fmtp, strlen(red_fmtp))) { /* count numbers of generations in fmtp */ red_cp = &red_fmtp[strlen(red_fmtp)]; strncpy(red_fmtp, a, 100); - sscanf(red_cp, "%30u", &red_data_pt[*red_num_gen]); + sscanf(red_cp, "%30u", (unsigned *)&red_data_pt[*red_num_gen]); red_cp = strtok(red_cp, "/"); while (red_cp && (*red_num_gen)++ < AST_RED_MAX_GENERATION) { - sscanf(red_cp, "%30u", &red_data_pt[*red_num_gen]); + sscanf(red_cp, "%30u", (unsigned *)&red_data_pt[*red_num_gen]); red_cp = strtok(NULL, "/"); } red_cp = red_fmtp; @@ -11383,10 +11383,10 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p) } if ((sscanf(attrib, "t38faxmaxbuffer:%30u", &x) == 1)) { - ast_debug(3, "MaxBufferSize:%d\n", x); + ast_debug(3, "MaxBufferSize:%u\n", x); found = TRUE; } else if ((sscanf(attrib, "t38maxbitrate:%30u", &x) == 1) || (sscanf(attrib, "t38faxmaxrate:%30u", &x) == 1)) { - ast_debug(3, "T38MaxBitRate: %d\n", x); + ast_debug(3, "T38MaxBitRate: %u\n", x); switch (x) { case 14400: p->t38.their_parms.rate = AST_T38_RATE_14400; @@ -11415,7 +11415,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p) } else if ((sscanf(attrib, "t38faxmaxdatagram:%30u", &x) == 1) || (sscanf(attrib, "t38maxdatagram:%30u", &x) == 1)) { /* override the supplied value if the configuration requests it */ if (((signed int) p->t38_maxdatagram >= 0) && ((unsigned int) p->t38_maxdatagram > x)) { - ast_debug(1, "Overriding T38FaxMaxDatagram '%d' with '%d'\n", x, p->t38_maxdatagram); + ast_debug(1, "Overriding T38FaxMaxDatagram '%u' with '%d'\n", x, p->t38_maxdatagram); x = p->t38_maxdatagram; } ast_debug(3, "FaxMaxDatagram: %u\n", x); @@ -11423,7 +11423,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p) found = TRUE; } else if ((strncmp(attrib, "t38faxfillbitremoval", sizeof("t38faxfillbitremoval") - 1) == 0)) { if (sscanf(attrib, "t38faxfillbitremoval:%30u", &x) == 1) { - ast_debug(3, "FillBitRemoval: %d\n", x); + ast_debug(3, "FillBitRemoval: %u\n", x); if (x == 1) { p->t38.their_parms.fill_bit_removal = TRUE; } @@ -11434,7 +11434,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p) found = TRUE; } else if ((strncmp(attrib, "t38faxtranscodingmmr", sizeof("t38faxtranscodingmmr") - 1) == 0)) { if (sscanf(attrib, "t38faxtranscodingmmr:%30u", &x) == 1) { - ast_debug(3, "Transcoding MMR: %d\n", x); + ast_debug(3, "Transcoding MMR: %u\n", x); if (x == 1) { p->t38.their_parms.transcoding_mmr = TRUE; } @@ -11445,7 +11445,7 @@ static int process_sdp_a_image(const char *a, struct sip_pvt *p) found = TRUE; } else if ((strncmp(attrib, "t38faxtranscodingjbig", sizeof("t38faxtranscodingjbig") - 1) == 0)) { if (sscanf(attrib, "t38faxtranscodingjbig:%30u", &x) == 1) { - ast_debug(3, "Transcoding JBIG: %d\n", x); + ast_debug(3, "Transcoding JBIG: %u\n", x); if (x == 1) { p->t38.their_parms.transcoding_jbig = TRUE; } @@ -11540,7 +11540,7 @@ static int finalize_content(struct sip_request *req) return -1; } - snprintf(clen, sizeof(clen), "%zd", ast_str_strlen(req->content)); + snprintf(clen, sizeof(clen), "%zu", ast_str_strlen(req->content)); add_header(req, "Content-Length", clen); if (ast_str_strlen(req->content)) { @@ -12768,7 +12768,7 @@ static void add_ice_to_sdp(struct ast_rtp_instance *instance, struct ast_str **a i = ao2_iterator_init(candidates, 0); while ((candidate = ao2_iterator_next(&i))) { - ast_str_append(a_buf, 0, "a=candidate:%s %d %s %d ", candidate->foundation, candidate->id, candidate->transport, candidate->priority); + ast_str_append(a_buf, 0, "a=candidate:%s %u %s %d ", candidate->foundation, candidate->id, candidate->transport, candidate->priority); ast_str_append(a_buf, 0, "%s ", ast_sockaddr_stringify_host(&candidate->address)); if (candidate->type == AST_RTP_ICE_CANDIDATE_TYPE_SRFLX @@ -12870,7 +12870,7 @@ static void add_codec_to_sdp(const struct sip_pvt *p, unsigned int rate; if (debug) - ast_verbose("Adding codec %d (%s) to SDP\n", format->id, ast_getformatname(format)); + ast_verbose("Adding codec %u (%s) to SDP\n", format->id, ast_getformatname(format)); if (((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->rtp), 1, format, 0)) == -1) || !(mime = ast_rtp_lookup_mime_subtype2(1, format, 0, ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0)) || @@ -12886,9 +12886,9 @@ static void add_codec_to_sdp(const struct sip_pvt *p, ast_str_append(m_buf, 0, " %d", rtp_code); /* Opus mandates 2 channels in rtpmap */ if ((int)format->id == AST_FORMAT_OPUS) { - ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d/2\r\n", rtp_code, mime, rate); + ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%u/2\r\n", rtp_code, mime, rate); } else { - ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d\r\n", rtp_code, mime, rate); + ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%u\r\n", rtp_code, mime, rate); } ast_format_sdp_generate(format, rtp_code, a_buf); @@ -12952,7 +12952,7 @@ static void add_vcodec_to_sdp(const struct sip_pvt *p, struct ast_format *format return; if (debug) - ast_verbose("Adding video codec %d (%s) to SDP\n", format->id, ast_getformatname(format)); + ast_verbose("Adding video codec %u (%s) to SDP\n", format->id, ast_getformatname(format)); if (((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->vrtp), 1, format, 0)) == -1) || !(subtype = ast_rtp_lookup_mime_subtype2(1, format, 0, 0)) || @@ -12961,7 +12961,7 @@ static void add_vcodec_to_sdp(const struct sip_pvt *p, struct ast_format *format } ast_str_append(m_buf, 0, " %d", rtp_code); - ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d\r\n", rtp_code, subtype, rate); + ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%u\r\n", rtp_code, subtype, rate); /* VP8: add RTCP FIR support */ if ((int)format->id == AST_FORMAT_VP8) { ast_str_append(a_buf, 0, "a=rtcp-fb:* ccm fir\r\n"); @@ -12981,13 +12981,13 @@ static void add_tcodec_to_sdp(const struct sip_pvt *p, struct ast_format *format return; if (debug) - ast_verbose("Adding text codec %d (%s) to SDP\n", format->id, ast_getformatname(format)); + ast_verbose("Adding text codec %u (%s) to SDP\n", format->id, ast_getformatname(format)); if ((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->trtp), 1, format, 0)) == -1) return; ast_str_append(m_buf, 0, " %d", rtp_code); - ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d\r\n", rtp_code, + ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%u\r\n", rtp_code, ast_rtp_lookup_mime_subtype2(1, format, 0, 0), ast_rtp_lookup_sample_rate2(1, format, 0)); /* Add fmtp code here */ @@ -13033,12 +13033,12 @@ static void add_noncodec_to_sdp(const struct sip_pvt *p, int format, int rtp_code; if (debug) - ast_verbose("Adding non-codec 0x%x (%s) to SDP\n", format, ast_rtp_lookup_mime_subtype2(0, NULL, format, 0)); + ast_verbose("Adding non-codec 0x%x (%s) to SDP\n", (unsigned)format, ast_rtp_lookup_mime_subtype2(0, NULL, format, 0)); if ((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->rtp), 0, NULL, format)) == -1) return; ast_str_append(m_buf, 0, " %d", rtp_code); - ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%d\r\n", rtp_code, + ast_str_append(a_buf, 0, "a=rtpmap:%d %s/%u\r\n", rtp_code, ast_rtp_lookup_mime_subtype2(0, NULL, format, 0), ast_rtp_lookup_sample_rate2(0, NULL, format)); if (format == AST_RTP_DTMF) /* Indicate we support DTMF and FLASH... */ @@ -13503,8 +13503,8 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int "IP6" : "IP4", ast_sockaddr_stringify_addr_remote(&udptldest)); } - ast_str_append(&a_modem, 0, "a=T38FaxVersion:%d\r\n", p->t38.our_parms.version); - ast_str_append(&a_modem, 0, "a=T38MaxBitRate:%d\r\n", t38_get_rate(p->t38.our_parms.rate)); + ast_str_append(&a_modem, 0, "a=T38FaxVersion:%u\r\n", p->t38.our_parms.version); + ast_str_append(&a_modem, 0, "a=T38MaxBitRate:%u\r\n", t38_get_rate(p->t38.our_parms.rate)); if (p->t38.our_parms.fill_bit_removal) { ast_str_append(&a_modem, 0, "a=T38FaxFillBitRemoval\r\n"); } @@ -14355,7 +14355,7 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init, if (sdp) { offered_media_list_destroy(p); if (p->udptl && p->t38.state == T38_LOCAL_REINVITE) { - ast_debug(1, "T38 is in state %d on channel %s\n", p->t38.state, p->owner ? ast_channel_name(p->owner) : "<none>"); + ast_debug(1, "T38 is in state %u on channel %s\n", p->t38.state, p->owner ? ast_channel_name(p->owner) : "<none>"); add_sdp(&req, p, FALSE, FALSE, TRUE); } else if (p->rtp) { try_suggested_sip_codec(p); @@ -14861,7 +14861,7 @@ static int transmit_cc_notify(struct ast_cc_agent *agent, struct sip_pvt *subscr char subscription_state_hdr[64]; if (state < CC_QUEUED || state > CC_READY) { - ast_log(LOG_WARNING, "Invalid state provided for transmit_cc_notify (%d)\n", state); + ast_log(LOG_WARNING, "Invalid state provided for transmit_cc_notify (%u)\n", state); return -1; } @@ -15808,7 +15808,7 @@ void sip_auth_headers(enum sip_auth_type code, char **header, char **respheader) *header = "Proxy-Authenticate"; *respheader = "Proxy-Authorization"; } else { - ast_verbose("-- wrong response code %d\n", code); + ast_verbose("-- wrong response code %u\n", code); *header = *respheader = "Invalid"; } } @@ -16498,7 +16498,7 @@ static int build_path(struct sip_pvt *p, struct sip_peer *peer, struct sip_reque static void build_nonce(struct sip_pvt *p, int forceupdate) { if (p->stalenonce || forceupdate || ast_strlen_zero(p->nonce)) { - ast_string_field_build(p, nonce, "%08lx", ast_random()); /* Create nonce for challenge */ + ast_string_field_build(p, nonce, "%08lx", (unsigned long)ast_random()); /* Create nonce for challenge */ p->stalenonce = 0; } } @@ -20334,7 +20334,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct ast_cli(fd, " DirectMedACL : %s\n", AST_CLI_YESNO(ast_acl_list_is_empty(peer->directmediaacl) == 0)); ast_cli(fd, " T.38 support : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT))); ast_cli(fd, " T.38 EC mode : %s\n", faxec2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT))); - ast_cli(fd, " T.38 MaxDtgrm: %d\n", peer->t38_maxdatagram); + ast_cli(fd, " T.38 MaxDtgrm: %u\n", peer->t38_maxdatagram); ast_cli(fd, " DirectMedia : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA))); ast_cli(fd, " PromiscRedir : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR))); ast_cli(fd, " User=Phone : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_USEREQPHONE))); @@ -20473,7 +20473,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct astman_append(s, "SIP-TextSupport: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_TEXTSUPPORT)?"Y":"N")); astman_append(s, "SIP-T.38Support: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)?"Y":"N")); astman_append(s, "SIP-T.38EC: %s\r\n", faxec2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT))); - astman_append(s, "SIP-T.38MaxDtgrm: %d\r\n", peer->t38_maxdatagram); + astman_append(s, "SIP-T.38MaxDtgrm: %u\r\n", peer->t38_maxdatagram); astman_append(s, "SIP-Sess-Timers: %s\r\n", stmode2str(peer->stimer.st_mode_oper)); astman_append(s, "SIP-Sess-Refresh: %s\r\n", strefresherparam2str(peer->stimer.st_ref)); astman_append(s, "SIP-Sess-Expires: %d\r\n", peer->stimer.st_max_se); @@ -20978,7 +20978,7 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, " T.38 support: %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT))); ast_cli(a->fd, " T.38 EC mode: %s\n", faxec2str(ast_test_flag(&global_flags[1], SIP_PAGE2_T38SUPPORT))); - ast_cli(a->fd, " T.38 MaxDtgrm: %d\n", global_t38_maxdatagram); + ast_cli(a->fd, " T.38 MaxDtgrm: %u\n", global_t38_maxdatagram); if (!realtimepeers && !realtimeregs) ast_cli(a->fd, " SIP realtime: Disabled\n" ); else @@ -20992,10 +20992,10 @@ static char *sip_show_settings(struct ast_cli_entry *e, int cmd, struct ast_cli_ ast_cli(a->fd, " IP ToS RTP audio: %s\n", ast_tos2str(global_tos_audio)); ast_cli(a->fd, " IP ToS RTP video: %s\n", ast_tos2str(global_tos_video)); ast_cli(a->fd, " IP ToS RTP text: %s\n", ast_tos2str(global_tos_text)); - ast_cli(a->fd, " 802.1p CoS SIP: %d\n", global_cos_sip); - ast_cli(a->fd, " 802.1p CoS RTP audio: %d\n", global_cos_audio); - ast_cli(a->fd, " 802.1p CoS RTP video: %d\n", global_cos_video); - ast_cli(a->fd, " 802.1p CoS RTP text: %d\n", global_cos_text); + ast_cli(a->fd, " 802.1p CoS SIP: %u\n", global_cos_sip); + ast_cli(a->fd, " 802.1p CoS RTP audio: %u\n", global_cos_audio); + ast_cli(a->fd, " 802.1p CoS RTP video: %u\n", global_cos_video); + ast_cli(a->fd, " 802.1p CoS RTP text: %u\n", global_cos_text); ast_cli(a->fd, " Jitterbuffer enabled: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_ENABLED))); if (ast_test_flag(&global_jbconf, AST_JB_ENABLED)) { ast_cli(a->fd, " Jitterbuffer forced: %s\n", AST_CLI_YESNO(ast_test_flag(&global_jbconf, AST_JB_FORCED))); @@ -22166,7 +22166,7 @@ static int build_reply_digest(struct sip_pvt *p, int method, char* digest, int d else snprintf(uri, sizeof(uri), "%s:%s@%s", p->socket.type == AST_TRANSPORT_TLS ? "sips" : "sip", p->username, ast_sockaddr_stringify_host_remote(&p->sa)); - snprintf(cnonce, sizeof(cnonce), "%08lx", ast_random()); + snprintf(cnonce, sizeof(cnonce), "%08lx", (unsigned long)ast_random()); /* Check if we have peer credentials */ ao2_lock(p); @@ -22224,7 +22224,7 @@ static int build_reply_digest(struct sip_pvt *p, int method, char* digest, int d p->noncecount++; if (!ast_strlen_zero(p->qop)) - snprintf(resp, sizeof(resp), "%s:%s:%08x:%s:%s:%s", a1_hash, p->nonce, p->noncecount, cnonce, "auth", a2_hash); + snprintf(resp, sizeof(resp), "%s:%s:%08x:%s:%s:%s", a1_hash, p->nonce, (unsigned)p->noncecount, cnonce, "auth", a2_hash); else snprintf(resp, sizeof(resp), "%s:%s:%s", a1_hash, p->nonce, a2_hash); ast_md5_hash(resp_hash, resp); @@ -22236,7 +22236,7 @@ static int build_reply_digest(struct sip_pvt *p, int method, char* digest, int d /* XXX We hard code our qop to "auth" for now. XXX */ if (!ast_strlen_zero(p->qop)) - snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\"%s, qop=auth, cnonce=\"%s\", nc=%08x", username, p->realm, uri, p->nonce, resp_hash, opaque, cnonce, p->noncecount); + snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\"%s, qop=auth, cnonce=\"%s\", nc=%08x", username, p->realm, uri, p->nonce, resp_hash, opaque, cnonce, (unsigned)p->noncecount); else snprintf(digest, digest_len, "Digest username=\"%s\", realm=\"%s\", algorithm=MD5, uri=\"%s\", nonce=\"%s\", response=\"%s\"%s", username, p->realm, uri, p->nonce, resp_hash, opaque); @@ -22405,7 +22405,7 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat } else if (!strcasecmp(colname, "codecs")) { ast_getformatname_multiple(buf, len -1, peer->caps); } else if (!strcasecmp(colname, "encryption")) { - snprintf(buf, len, "%d", ast_test_flag(&peer->flags[1], SIP_PAGE2_USE_SRTP)); + snprintf(buf, len, "%u", ast_test_flag(&peer->flags[1], SIP_PAGE2_USE_SRTP)); } else if (!strncasecmp(colname, "chanvar[", 8)) { char *chanvar=colname + 8; struct ast_variable *v; @@ -25130,7 +25130,7 @@ static int handle_request_invite_st(struct sip_pvt *p, struct sip_request *req, break; default: - ast_log(LOG_ERROR, "Internal Error %d at %s:%d\n", st_get_mode(p, 1), __FILE__, __LINE__); + ast_log(LOG_ERROR, "Internal Error %u at %s:%d\n", st_get_mode(p, 1), __FILE__, __LINE__); break; } } else { @@ -25884,7 +25884,7 @@ static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, str p->invitestate = INV_TERMINATED; break; default: - ast_log(LOG_WARNING, "Don't know how to handle INVITE in state %d\n", ast_channel_state(c)); + ast_log(LOG_WARNING, "Don't know how to handle INVITE in state %u\n", ast_channel_state(c)); transmit_response(p, "100 Trying", req); break; } @@ -27998,7 +27998,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as (could be new request in existing SIP dialog as well...) */ p->method = req->method; /* Find out which SIP method they are using */ - ast_debug(4, "**** Received %s (%d) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd); + ast_debug(4, "**** Received %s (%u) - Command in SIP %s\n", sip_methods[p->method].text, sip_methods[p->method].id, cmd); if (p->icseq && (p->icseq > seqno) ) { if (p->pendinginvite && seqno == p->pendinginvite && (req->method == SIP_ACK || req->method == SIP_CANCEL)) { @@ -29833,7 +29833,7 @@ static void set_insecure_flags (struct ast_flags *flags, const char *value, int \returns non-zero if any config options were handled, zero otherwise */ static int handle_t38_options(struct ast_flags *flags, struct ast_flags *mask, struct ast_variable *v, - int *maxdatagram) + unsigned int *maxdatagram) { int res = 1; diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 8ed469ebe..01bca4f23 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -2022,7 +2022,7 @@ static void skinny_unlocksub(struct skinny_subchannel *sub) static int skinny_sched_del(int sched_id, struct skinny_subchannel *sub) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Deleting SCHED %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Deleting SCHED %d\n", sub->callid, sched_id); return ast_sched_del(sched, sched_id); } @@ -2031,7 +2031,7 @@ static int skinny_sched_add(int when, ast_sched_cb callback, struct skinny_subch { int ret; ret = ast_sched_add(sched, when, callback, sub); - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Added SCHED %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Added SCHED %d\n", sub->callid, ret); return ret; } @@ -2395,7 +2395,7 @@ static int transmit_response_bysession(struct skinnysession *s, struct skinny_re ast_mutex_lock(&s->lock); if ((letohl(req->len) > SKINNY_MAX_PACKET) || (letohl(req->len) < 0)) { - ast_log(LOG_WARNING, "transmit_response: the length of the request (%d) is out of bounds (%d)\n", letohl(req->len), SKINNY_MAX_PACKET); + ast_log(LOG_WARNING, "transmit_response: the length of the request (%u) is out of bounds (%d)\n", letohl(req->len), SKINNY_MAX_PACKET); ast_mutex_unlock(&s->lock); return -1; } @@ -2407,7 +2407,7 @@ static int transmit_response_bysession(struct skinnysession *s, struct skinny_re res = write(s->fd, s->outbuf, letohl(req->len)+8); if (res != letohl(req->len)+8) { - ast_log(LOG_WARNING, "Transmit: write only sent %d out of %d bytes: %s\n", res, letohl(req->len)+8, strerror(errno)); + ast_log(LOG_WARNING, "Transmit: write only sent %d out of %u bytes: %s\n", res, letohl(req->len)+8, strerror(errno)); if (res == -1) { ast_log(LOG_WARNING, "Transmit: Skinny Client was lost, unregistering\n"); end_session(s); @@ -2671,7 +2671,7 @@ static void transmit_connect(struct skinny_device *d, struct skinny_subchannel * req->data.openreceivechannel.echo = htolel(0); req->data.openreceivechannel.bitrate = htolel(0); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting OPEN_RECEIVE_CHANNEL_MESSAGE to %s, confid %d, partyid %d, ms %d, fmt %d, echo %d, brate %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting OPEN_RECEIVE_CHANNEL_MESSAGE to %s, confid %u, partyid %u, ms %d, fmt %d, echo %d, brate %d\n", d->name, sub->callid, sub->callid, fmt.cur_ms, codec_ast2skinny(&fmt.format), 0, 0); transmit_response(d, req); } @@ -2740,7 +2740,7 @@ static void transmit_selectsoftkeys(struct skinny_device *d, int instance, int c req->data.selectsoftkey.validKeyMask = htolel(newmask); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting SELECT_SOFT_KEYS_MESSAGE to %s, inst %d, callid %d, softkey %d, mask 0x%08x\n", - d->name, instance, callid, softkey, newmask); + d->name, instance, callid, softkey, (unsigned)newmask); transmit_response(d, req); } @@ -2860,7 +2860,7 @@ static void _transmit_displayprinotify(struct skinny_device *d, const char *text ast_copy_string(req->data.displayprinotify.text, text, sizeof(req->data.displayprinotify.text)); ast_copy_string(req->data.displayprinotify.text+octalstrlen, extratext, sizeof(req->data.displayprinotify.text)-octalstrlen); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n", - d->name, (uint8_t)*text, (uint8_t)*(text+1), extratext, timeout, priority); + d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority); } else { ast_copy_string(req->data.displayprinotify.text, text, sizeof(req->data.displayprinotify.text)); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE to %s, '%s', timeout=%d, priority=%d\n", @@ -2887,7 +2887,7 @@ static void _transmit_displayprinotifyvar(struct skinny_device *d, const char *t ast_copy_string(req->data.displayprinotifyvar.text+octalstrlen, extratext, sizeof(req->data.displayprinotifyvar.text)-octalstrlen); packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text) + strlen(extratext); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PRINOTIFY_MESSAGE_VARIABLE to %s, '\\%03o\\%03o', '%s', timeout=%d, priority=%d\n", - d->name, (uint8_t)*text, (uint8_t)*(text+1), extratext, timeout, priority); + d->name, (unsigned)*text, (unsigned)*(text+1), extratext, timeout, priority); } else { ast_copy_string(req->data.displayprinotifyvar.text, text, sizeof(req->data.displayprinotifyvar.text)); packetlen = req->len - MAXDISPLAYNOTIFYSTR + strlen(text); @@ -2925,7 +2925,7 @@ static void transmit_displaypromptstatus(struct skinny_device *d, const char *te ast_copy_string(req->data.displaypromptstatus.promptMessage, text, sizeof(req->data.displaypromptstatusvar.promptMessage)); ast_copy_string(req->data.displaypromptstatus.promptMessage+octalstrlen, extratext, sizeof(req->data.displaypromptstatus.promptMessage)-octalstrlen); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PROMPT_STATUS_MESSAGE to %s, '\\%03o\\%03o', '%s'\n", - d->name, (uint8_t)*text, (uint8_t)*(text+1), extratext); + d->name, (unsigned)*text, (unsigned)*(text+1), extratext); } else { ast_copy_string(req->data.displaypromptstatus.promptMessage, text, sizeof(req->data.displaypromptstatus.promptMessage)); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PROMPT_STATUS_MESSAGE to %s, '%s'\n", @@ -2951,7 +2951,7 @@ static void transmit_displaypromptstatusvar(struct skinny_device *d, const char ast_copy_string(req->data.displaypromptstatusvar.promptMessage+octalstrlen, extratext, sizeof(req->data.displaypromptstatusvar.promptMessage)-octalstrlen); packetlen = req->len - MAXCALLINFOSTR + strlen(text) + strlen(extratext); SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE to %s, '\\%03o\\%03o', '%s'\n", - d->name, (uint8_t)*text, (uint8_t)*(text+1), extratext); + d->name, (unsigned)*text, (unsigned)*(text+1), extratext); } else { ast_copy_string(req->data.displaypromptstatusvar.promptMessage, text, sizeof(req->data.displaypromptstatus.promptMessage)); packetlen = req->len - MAXCALLINFOSTR + strlen(text); @@ -3013,7 +3013,7 @@ static void transmit_closereceivechannel(struct skinny_device *d, struct skinny_ req->data.closereceivechannel.conferenceId = htolel(0); req->data.closereceivechannel.partyId = htolel(sub->callid); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CLOSE_RECEIVE_CHANNEL_MESSAGE to %s, confid %d, callid %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CLOSE_RECEIVE_CHANNEL_MESSAGE to %s, confid %d, callid %u\n", d->name, 0, sub->callid); transmit_response(d, req); } @@ -3028,7 +3028,7 @@ static void transmit_stopmediatransmission(struct skinny_device *d, struct skinn req->data.stopmedia.conferenceId = htolel(0); req->data.stopmedia.passThruPartyId = htolel(sub->callid); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting STOP_MEDIA_TRANSMISSION_MESSAGE to %s, confid %d, passthrupartyid %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting STOP_MEDIA_TRANSMISSION_MESSAGE to %s, confid %d, passthrupartyid %u\n", d->name, 0, sub->callid); transmit_response(d, req); } @@ -3065,7 +3065,7 @@ static void transmit_startmediatransmission(struct skinny_device *d, struct skin req->data.startmedia_ip6.qualifier.bitRate = htolel(0); } - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting START_MEDIA_TRANSMISSION_MESSAGE to %s, callid %d, passthrupartyid %d, ip %s:%d, ms %d, fmt %d, prec 127\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting START_MEDIA_TRANSMISSION_MESSAGE to %s, callid %u, passthrupartyid %u, ip %s:%d, ms %d, fmt %d, prec 127\n", d->name, sub->callid, sub->callid, ast_inet_ntoa(dest.sin_addr), dest.sin_port, fmt.cur_ms, codec_ast2skinny(&fmt.format)); transmit_response(d, req); } @@ -3095,7 +3095,7 @@ static void transmit_callstate(struct skinny_device *d, int buttonInstance, unsi req->data.callstate.lineInstance = htolel(buttonInstance); req->data.callstate.callReference = htolel(callid); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_STATE_MESSAGE to %s, state %s, inst %d, callid %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_STATE_MESSAGE to %s, state %s, inst %d, callid %u\n", d->name, callstate2str(state), buttonInstance, callid); transmit_response(d, req); } @@ -3207,7 +3207,7 @@ static void transmit_definetimedate(struct skinny_device *d) req->data.definetimedate.milliseconds = htolel(cmtime.tm_usec / 1000); req->data.definetimedate.timestamp = htolel(now.tv_sec); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DEFINETIMEDATE_MESSAGE to %s, date %d %d %d dow %d time %d:%d:%d.%d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DEFINETIMEDATE_MESSAGE to %s, date %u %u %u dow %u time %u:%u:%u.%u\n", d->name, req->data.definetimedate.year, req->data.definetimedate.month, req->data.definetimedate.day, req->data.definetimedate.dayofweek, req->data.definetimedate.hour, req->data.definetimedate.minute, req->data.definetimedate.seconds, req->data.definetimedate.milliseconds); transmit_response(d, req); @@ -3295,7 +3295,7 @@ static void transmit_softkeytemplateres(struct skinny_device *d) soft_key_template_default, sizeof(soft_key_template_default)); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting SOFT_KEY_TEMPLATE_RES_MESSAGE to %s, offset 0, keycnt %d, totalkeycnt %d, template data\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting SOFT_KEY_TEMPLATE_RES_MESSAGE to %s, offset 0, keycnt %u, totalkeycnt %u, template data\n", d->name, req->data.softkeytemplate.softKeyCount, req->data.softkeytemplate.totalSoftKeyCount); transmit_response(d, req); } @@ -3351,9 +3351,9 @@ static void transmit_registerack(struct skinny_device *d) #ifdef AST_DEVMODE { short res = req->data.regack.res[0] << 8 | req->data.regack.res[1]; - int res2 = req->data.regack.res2[0] << 24 | req->data.regack.res2[1] << 16 | req->data.regack.res2[2] << 8 | req->data.regack.res2[3]; + unsigned int res2 = req->data.regack.res2[0] << 24 | req->data.regack.res2[1] << 16 | req->data.regack.res2[2] << 8 | req->data.regack.res2[3]; SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting REGISTER_ACK_MESSAGE to %s, keepalive %d, datetemplate %s, seckeepalive %d, res 0x%04x, res2 0x%08x\n", - d->name, keep_alive, date_format, keep_alive, res, res2); + d->name, keep_alive, date_format, keep_alive, (unsigned)res, res2); } #endif @@ -3381,7 +3381,7 @@ static void transmit_backspace(struct skinny_device *d, int instance, unsigned c req->data.bkspmessage.instance = htolel(instance); req->data.bkspmessage.callreference = htolel(callid); - SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting BKSP_REQ_MESSAGE to %s, inst %d, callid %d \n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting BKSP_REQ_MESSAGE to %s, inst %d, callid %u \n", d->name, instance, callid); transmit_response(d, req); } @@ -3546,7 +3546,7 @@ static void update_connectedline(struct skinny_subchannel *sub, const void *data || ast_strlen_zero(ast_channel_connected(c)->id.number.str)) return; - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Updating\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Updating\n", sub->callid); send_callinfo(sub); } @@ -4845,13 +4845,13 @@ static void start_rtp(struct skinny_subchannel *sub) static void destroy_rtp(struct skinny_subchannel *sub) { if (sub->rtp) { - SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying RTP\n", sub->callid); + SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %u - Destroying RTP\n", sub->callid); ast_rtp_instance_stop(sub->rtp); ast_rtp_instance_destroy(sub->rtp); sub->rtp = NULL; } if (sub->vrtp) { - SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying VRTP\n", sub->callid); + SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %u - Destroying VRTP\n", sub->callid); ast_rtp_instance_stop(sub->vrtp); ast_rtp_instance_destroy(sub->vrtp); sub->vrtp = NULL; @@ -4884,7 +4884,7 @@ static void *skinny_newcall(void *data) if (!sub->rtp) { start_rtp(sub); } - ast_verb(3, "Sub %d - Calling %s@%s\n", sub->callid, ast_channel_exten(c), ast_channel_context(c)); + ast_verb(3, "Sub %u - Calling %s@%s\n", sub->callid, ast_channel_exten(c), ast_channel_context(c)); res = ast_pbx_run(c); if (res) { ast_log(LOG_WARNING, "PBX exited non-zero\n"); @@ -4900,7 +4900,7 @@ static void skinny_dialer(struct skinny_subchannel *sub, int timedout) struct skinny_device *d = l->device; if (timedout || !ast_matchmore_extension(c, ast_channel_context(c), sub->exten, 1, l->cid_num)) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Force dialing '%s' because of %s\n", sub->callid, sub->exten, (timedout ? "timeout" : "exactmatch")); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Force dialing '%s' because of %s\n", sub->callid, sub->exten, (timedout ? "timeout" : "exactmatch")); if (ast_exists_extension(c, ast_channel_context(c), sub->exten, 1, l->cid_num)) { if (sub->substate == SUBSTATE_OFFHOOK) { dialandactivatesub(sub, sub->exten); @@ -4913,7 +4913,7 @@ static void skinny_dialer(struct skinny_subchannel *sub, int timedout) dumpsub(sub, 0); } } else { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Wait for more digits\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Wait for more digits\n", sub->callid); if (ast_exists_extension(c, ast_channel_context(c), sub->exten, 1, l->cid_num)) { transmit_selectsoftkeys(d, l->instance, sub->callid, KEYDEF_DADFD, KEYMASK_ALL); sub->dialer_sched = skinny_sched_add(matchdigittimeout, skinny_dialer_cb, sub); @@ -4926,7 +4926,7 @@ static void skinny_dialer(struct skinny_subchannel *sub, int timedout) static int skinny_dialer_cb(const void *data) { struct skinny_subchannel *sub = (struct skinny_subchannel *)data; - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Dialer called from SCHED %d\n", sub->callid, sub->dialer_sched); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Dialer called from SCHED %d\n", sub->callid, sub->dialer_sched); sub->dialer_sched = 0; skinny_dialer(sub, 1); return 0; @@ -4947,7 +4947,7 @@ static int skinny_cfwd_cb(const void *data) struct skinny_subchannel *sub = (struct skinny_subchannel *)data; struct skinny_line *l = sub->line; sub->cfwd_sched = 0; - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - CFWDNOANS to %s.\n", sub->callid, l->call_forward_noanswer); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - CFWDNOANS to %s.\n", sub->callid, l->call_forward_noanswer); ast_channel_call_forward_set(sub->owner, l->call_forward_noanswer); ast_queue_control(sub->owner, AST_CONTROL_REDIRECTING); return 0; @@ -4972,7 +4972,7 @@ static int skinny_call(struct ast_channel *ast, const char *dest, int timeout) return -1; } - SKINNY_DEBUG(DEBUG_SUB, 3, "Skinny Call (%s) - Sub %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Skinny Call (%s) - Sub %u\n", ast_channel_name(ast), sub->callid); if (l->dnd) { @@ -5002,7 +5002,7 @@ static int skinny_call(struct ast_channel *ast, const char *dest, int timeout) sub->aa_mute = 1; } } - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - setting autoanswer time=%dms %s%s\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - setting autoanswer time=%dms %s%s\n", sub->callid, aatime, sub->aa_beep ? "BEEP " : "", sub->aa_mute ? "MUTE" : ""); if (aatime) { //sub->aa_sched = ast_sched_add(sched, aatime, skinny_autoanswer_cb, sub); @@ -5033,7 +5033,7 @@ static int skinny_hangup(struct ast_channel *ast) dumpsub(sub, 1); - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Destroying\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Destroying\n", sub->callid); skinny_set_owner(sub, NULL); ast_channel_tech_pvt_set(ast, NULL); @@ -5052,7 +5052,7 @@ static int skinny_answer(struct ast_channel *ast) sub->cxmode = SKINNY_CX_SENDRECV; - SKINNY_DEBUG(DEBUG_SUB, 3, "skinny_answer(%s) on %s@%s-%d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "skinny_answer(%s) on %s@%s-%u\n", ast_channel_name(ast), sub->line->name, sub->line->device->name, sub->callid); setsubstate(sub, SUBSTATE_CONNECTED); @@ -5126,7 +5126,7 @@ static int skinny_write(struct ast_channel *ast, struct ast_frame *frame) if (frame->frametype == AST_FRAME_IMAGE) { return 0; } else { - ast_log(LOG_WARNING, "Can't send %d type frames with skinny_write\n", frame->frametype); + ast_log(LOG_WARNING, "Can't send %u type frames with skinny_write\n", frame->frametype); return 0; } } else { @@ -5297,7 +5297,7 @@ static void skinny_transfer_attended(struct skinny_subchannel *sub) res = ast_bridge_transfer_attended(xferee->owner, xferor->owner); if (res != AST_BRIDGE_TRANSFER_SUCCESS) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d failed to transfer %d to '%s'@'%s' - %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u failed to transfer %u to '%s'@'%s' - %u\n", xferor->callid, xferee->callid, xferor->exten, xferor->line->context, res); send_displayprinotify(xferor->line->device, "Transfer failed", NULL, 10, 5); ast_queue_control(xferee->owner, AST_CONTROL_HOLD); @@ -5316,7 +5316,7 @@ static void skinny_transfer_blind(struct skinny_subchannel *sub) res = ast_bridge_transfer_blind(1, xferee->owner, sub->exten, sub->line->context, NULL, NULL); if (res != AST_BRIDGE_TRANSFER_SUCCESS) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d failed to blind transfer %d to '%s'@'%s' - %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u failed to blind transfer %u to '%s'@'%s' - %u\n", sub->callid, xferee->callid, sub->exten, sub->line->context, res); send_displayprinotify(sub->line->device, "Transfer failed", NULL, 10, 5); ast_queue_control(xferee->owner, AST_CONTROL_HOLD); @@ -5336,7 +5336,7 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s return -1; } - SKINNY_DEBUG(DEBUG_SUB, 3, "Asked to indicate '%s' condition on channel %s (Sub %d)\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Asked to indicate '%s' condition on channel %s (Sub %u)\n", control2str(ind), ast_channel_name(ast), sub->callid); switch(ind) { case AST_CONTROL_RINGING: @@ -5489,13 +5489,13 @@ static struct ast_channel *skinny_new(struct skinny_line *l, struct skinny_subli ast_channel_named_pickupgroups_set(tmp, l->named_pickupgroups); if (l->cfwdtype & SKINNY_CFWD_ALL) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - CFWDALL to %s.\n", sub->callid, l->call_forward_all); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - CFWDALL to %s.\n", sub->callid, l->call_forward_all); ast_channel_call_forward_set(tmp, l->call_forward_all); } else if ((l->cfwdtype & SKINNY_CFWD_BUSY) && (get_devicestate(l) != AST_DEVICE_NOT_INUSE)) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - CFWDBUSY to %s.\n", sub->callid, l->call_forward_busy); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - CFWDBUSY to %s.\n", sub->callid, l->call_forward_busy); ast_channel_call_forward_set(tmp, l->call_forward_busy); } else if (l->cfwdtype & SKINNY_CFWD_NOANSWER) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - CFWDNOANS Scheduling for %d seconds.\n", sub->callid, l->callfwdtimeout/1000); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - CFWDNOANS Scheduling for %d seconds.\n", sub->callid, l->callfwdtimeout/1000); sub->cfwd_sched = skinny_sched_add(l->callfwdtimeout, skinny_cfwd_cb, sub); } @@ -5604,7 +5604,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) if (sub->cfwd_sched) { if (state == SUBSTATE_CONNECTED) { if (skinny_sched_del(sub->cfwd_sched, sub)) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - trying to change state from %s to %s, but already forwarded because no answer.\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - trying to change state from %s to %s, but already forwarded because no answer.\n", sub->callid, substate2str(sub->substate), substate2str(actualstate)); skinny_unlocksub(sub); return; @@ -5710,7 +5710,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_HOLD: if (sub->substate != SUBSTATE_CONNECTED) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_HOLD from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_HOLD from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); return; } transmit_activatecallplane(d, l); @@ -5727,7 +5727,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; default: - ast_log(LOG_WARNING, "Substate handling under subline for state %d not implemented on Sub-%d\n", state, sub->callid); + ast_log(LOG_WARNING, "Substate handling under subline for state %d not implemented on Sub-%u\n", state, sub->callid); } skinny_unlocksub(sub); return; @@ -5740,7 +5740,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) transmit_speaker_mode(d, SKINNY_SPEAKERON); } - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - change state from %s to %s\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - change state from %s to %s\n", sub->callid, substate2str(sub->substate), substate2str(actualstate)); if (actualstate == sub->substate) { @@ -5750,7 +5750,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) switch (actualstate) { case SUBSTATE_OFFHOOK: - ast_verb(1, "Call-id: %d\n", sub->callid); + ast_verb(1, "Call-id: %u\n", sub->callid); l->activesub = sub; transmit_callstate(d, l->instance, sub->callid, SKINNY_OFFHOOK); transmit_activatecallplane(d, l); @@ -5805,7 +5805,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_DIALING: if (ast_strlen_zero(sub->exten) || !ast_exists_extension(c, ast_channel_context(c), sub->exten, 1, l->cid_num)) { - ast_log(LOG_WARNING, "Exten (%s)@(%s) does not exist, unable to set substate DIALING on sub %d\n", sub->exten, ast_channel_context(c), sub->callid); + ast_log(LOG_WARNING, "Exten (%s)@(%s) does not exist, unable to set substate DIALING on sub %u\n", sub->exten, ast_channel_context(c), sub->callid); break; } @@ -5848,7 +5848,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_RINGOUT: if (!(sub->substate == SUBSTATE_DIALING || sub->substate == SUBSTATE_PROGRESS)) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_RINGOUT from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_RINGOUT from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); break; } if (sub->substate != SUBSTATE_PROGRESS) { @@ -5946,7 +5946,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_BUSY: if (!(sub->substate == SUBSTATE_DIALING || sub->substate == SUBSTATE_PROGRESS || sub->substate == SUBSTATE_RINGOUT)) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_BUSY from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_BUSY from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); break; } @@ -5960,7 +5960,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_CONGESTION: if (!(sub->substate == SUBSTATE_DIALING || sub->substate == SUBSTATE_PROGRESS || sub->substate == SUBSTATE_RINGOUT)) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_CONGESTION from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_CONGESTION from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); break; } @@ -5974,7 +5974,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_PROGRESS: if (sub->substate != SUBSTATE_DIALING) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_PROGRESS from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_PROGRESS from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); break; } @@ -5988,7 +5988,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) break; case SUBSTATE_HOLD: if (sub->substate != SUBSTATE_CONNECTED) { - ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_HOLD from %s (on call-%d)\n", substate2str(sub->substate), sub->callid); + ast_log(LOG_WARNING, "Cannot set substate to SUBSTATE_HOLD from %s (on call-%u)\n", substate2str(sub->substate), sub->callid); break; } ast_queue_hold(sub->owner, l->mohsuggest); @@ -6003,7 +6003,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state) sub->substate = SUBSTATE_HOLD; break; default: - ast_log(LOG_WARNING, "Was asked to change to nonexistant substate %d on Sub-%d\n", state, sub->callid); + ast_log(LOG_WARNING, "Was asked to change to nonexistant substate %d on Sub-%u\n", state, sub->callid); } skinny_unlocksub(sub); } @@ -6015,7 +6015,7 @@ static void dumpsub(struct skinny_subchannel *sub, int forcehangup) struct skinny_subchannel *activate_sub = NULL; struct skinny_subchannel *tsub; - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Dumping\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Dumping\n", sub->callid); if (!forcehangup && sub->substate == SUBSTATE_HOLD) { l->activesub = NULL; @@ -6030,7 +6030,7 @@ static void dumpsub(struct skinny_subchannel *sub, int forcehangup) setsubstate(sub, SUBSTATE_ONHOOK); l->activesub = activate_sub; if (l->activesub->substate != SUBSTATE_HOLD) { - ast_log(LOG_WARNING, "Sub-%d was related but not at SUBSTATE_HOLD\n", sub->callid); + ast_log(LOG_WARNING, "Sub-%u was related but not at SUBSTATE_HOLD\n", sub->callid); return; } setsubstate(l->activesub, SUBSTATE_HOLD); @@ -6064,7 +6064,7 @@ static void activatesub(struct skinny_subchannel *sub, int state) { struct skinny_line *l = sub->line; - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Activating, and deactivating sub %d\n", + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Activating, and deactivating sub %u\n", sub->callid, l->activesub ? l->activesub->callid : 0); if (sub == l->activesub) { @@ -6088,11 +6088,11 @@ static void dialandactivatesub(struct skinny_subchannel *sub, char exten[AST_MAX struct skinny_device *d = l->device; if (sub->dialType == DIALTYPE_NORMAL) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Dial %s and Activate\n", sub->callid, exten); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Dial %s and Activate\n", sub->callid, exten); ast_copy_string(sub->exten, exten, sizeof(sub->exten)); activatesub(sub, SUBSTATE_DIALING); } else if (sub->dialType == DIALTYPE_CFWD) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Set callforward(%d) to %s\n", sub->callid, sub->getforward, exten); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Set callforward(%d) to %s\n", sub->callid, sub->getforward, exten); set_callforwards(l, sub->exten, sub->getforward); dumpsub(sub, 1); transmit_cfwdstate(d, l); @@ -6280,7 +6280,7 @@ static int handle_keypad_button_message(struct skinny_req *req, struct skinnyses if ((sub->owner && ast_channel_state(sub->owner) < AST_STATE_UP)) { if (sub->dialer_sched && !skinny_sched_del(sub->dialer_sched, sub)) { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Got a digit and not timed out, so try dialing\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Got a digit and not timed out, so try dialing\n", sub->callid); sub->dialer_sched = 0; len = strlen(sub->exten); if (len == 0) { @@ -6297,12 +6297,12 @@ static int handle_keypad_button_message(struct skinny_req *req, struct skinnyses skinny_dialer(sub, 0); } } else { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d Got a digit already timedout, ignore\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u Got a digit already timedout, ignore\n", sub->callid); /* Timed out so the call is being progressed elsewhere, to late for digits */ return 0; } } else { - SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %d - Got a digit and sending as DTMF\n", sub->callid); + SKINNY_DEBUG(DEBUG_SUB, 3, "Sub %u - Got a digit and sending as DTMF\n", sub->callid); f.subclass.integer = dgt; f.src = "skinny"; if (sub->owner) { @@ -7295,7 +7295,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s) struct skinny_device *d = s->device; if (!d && !(letohl(req->e) == REGISTER_MESSAGE || letohl(req->e) == ALARM_MESSAGE || letohl(req->e) == KEEP_ALIVE_MESSAGE)) { - ast_log(LOG_WARNING, "Client sent message #%d without first registering.\n", req->e); + ast_log(LOG_WARNING, "Client sent message #%u without first registering.\n", req->e); return 0; } @@ -7305,7 +7305,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s) handle_keepalive_message(req, s); break; case REGISTER_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received REGISTER_MESSAGE from %s, name %s, type %d, protovers %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received REGISTER_MESSAGE from %s, name %s, type %u, protovers %d\n", d->name, req->data.reg.name, letohl(req->data.reg.type), letohl(req->data.reg.protocolVersion)); res = skinny_register(req, s); if (!res) { @@ -7327,7 +7327,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s) res = handle_ip_port_message(req, s); break; case KEYPAD_BUTTON_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received KEYPAD_BUTTON_MESSAGE from %s, digit %d, inst %d, callref %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received KEYPAD_BUTTON_MESSAGE from %s, digit %u, inst %u, callref %u\n", d->name, letohl(req->data.keypad.button), letohl(req->data.keypad.lineInstance), letohl(req->data.keypad.callReference)); res = handle_keypad_button_message(req, s); break; @@ -7341,29 +7341,29 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s) res = handle_stimulus_message(req, s); break; case OFFHOOK_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received OFFHOOK_MESSAGE from %s, inst %d, ref %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received OFFHOOK_MESSAGE from %s, inst %u, ref %u\n", d->name, letohl(req->data.offhook.instance), letohl(req->data.offhook.reference)); res = handle_offhook_message(req, s); break; case ONHOOK_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received ONHOOK_MESSAGE from %s, inst %d, ref %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received ONHOOK_MESSAGE from %s, inst %u, ref %u\n", d->name, letohl(req->data.offhook.instance), letohl(req->data.offhook.reference)); res = handle_onhook_message(req, s); break; case CAPABILITIES_RES_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET | DEBUG_AUDIO, 3, "Received CAPABILITIES_RES_MESSAGE from %s, count %d, codec data\n", + SKINNY_DEBUG(DEBUG_PACKET | DEBUG_AUDIO, 3, "Received CAPABILITIES_RES_MESSAGE from %s, count %u, codec data\n", d->name, letohl(req->data.caps.count)); res = handle_capabilities_res_message(req, s); break; case SPEED_DIAL_STAT_REQ_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received SPEED_DIAL_STAT_REQ_MESSAGE from %s, sdNum %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received SPEED_DIAL_STAT_REQ_MESSAGE from %s, sdNum %u\n", d->name, letohl(req->data.speeddialreq.speedDialNumber)); if ( (sd = find_speeddial_by_instance(s->device, letohl(req->data.speeddialreq.speedDialNumber), 0)) ) { transmit_speeddialstatres(d, sd); } break; case LINE_STATE_REQ_MESSAGE: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received LINE_STATE_REQ_MESSAGE from %s, lineNum %d\n", + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received LINE_STATE_REQ_MESSAGE from %s, lineNum %u\n", d->name, letohl(req->data.line.lineNumber)); transmit_linestatres(d, letohl(req->data.line.lineNumber)); break; @@ -7422,7 +7422,7 @@ static int handle_message(struct skinny_req *req, struct skinnysession *s) transmit_serviceurlstat(d, letohl(req->data.serviceurlmessage.instance)); break; default: - SKINNY_DEBUG(DEBUG_PACKET, 3, "Received UNKNOWN_MESSAGE(%x) from %s\n", letohl(req->e), d->name); + SKINNY_DEBUG(DEBUG_PACKET, 3, "Received UNKNOWN_MESSAGE(%x) from %s\n", (unsigned)letohl(req->e), d->name); break; } return res; diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index ac77dbc1a..bdc353844 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -883,7 +883,7 @@ static const char *ustmtext(const char *str, struct unistimsession *pte) static void display_last_error(const char *sz_msg) { /* Display the error message */ - ast_log(LOG_WARNING, "%s : (%u) %s\n", sz_msg, errno, strerror(errno)); + ast_log(LOG_WARNING, "%s : (%d) %s\n", sz_msg, errno, strerror(errno)); } static unsigned int get_tick_count(void) @@ -973,7 +973,7 @@ static void send_client(int size, const unsigned char *data, struct unistimsessi /*#ifdef DUMP_PACKET */ if (unistimdebug) { - ast_verb(6, "Sending datas with seq #0x%.4x Using slot #%d :\n", pte->seq_server, buf_pos); + ast_verb(6, "Sending datas with seq #0x%.4x Using slot #%d :\n", (unsigned)pte->seq_server, buf_pos); } /*#endif */ send_raw_client(pte->wsabufsend[buf_pos].len, pte->wsabufsend[buf_pos].buf, &(pte->sin), @@ -1129,7 +1129,7 @@ static void send_icon(unsigned char pos, unsigned char status, struct unistimses { BUFFSEND; if (unistimdebug) { - ast_verb(0, "Sending icon pos %d with status 0x%.2x\n", pos, status); + ast_verb(0, "Sending icon pos %d with status 0x%.2x\n", pos, (unsigned)status); } memcpy(buffsend + SIZE_HEADER, packet_send_icon, sizeof(packet_send_icon)); buffsend[9] = pos; @@ -1149,7 +1149,7 @@ static void send_expansion_icon(unsigned char pos, unsigned char status, struct { BUFFSEND; if (unistimdebug) { - ast_verb(0, "Sending expansion icon pos %d with status 0x%.2x\n", pos, status); + ast_verb(0, "Sending expansion icon pos %d with status 0x%.2x\n", pos, (unsigned)status); } memcpy(buffsend + SIZE_HEADER, packet_send_expansion_icon, sizeof(packet_send_expansion_icon)); buffsend[10] = pos; @@ -1261,7 +1261,7 @@ send_favorite(unsigned char pos, unsigned char status, struct unistimsession *pt int i; if (unistimdebug) { - ast_verb(0, "Sending favorite pos %d with status 0x%.2x\n", pos, status); + ast_verb(0, "Sending favorite pos %d with status 0x%.2x\n", pos, (unsigned)status); } memcpy(buffsend + SIZE_HEADER, packet_send_favorite, sizeof(packet_send_favorite)); buffsend[10] = pos; @@ -1485,7 +1485,7 @@ static void close_client(struct unistimsession *s) ast_queue_hangup_with_cause(sub->owner, AST_CAUSE_NETWORK_OUT_OF_ORDER); } else { if (unistimdebug) { - ast_debug(1, "Released sub %d of channel %s@%s\n", sub->subtype, sub->parent->name, s->device->name); + ast_debug(1, "Released sub %u of channel %s@%s\n", sub->subtype, sub->parent->name, s->device->name); } AST_LIST_REMOVE_CURRENT(list); unistim_free_sub(sub); @@ -1539,7 +1539,7 @@ static int send_retransmit(struct unistimsession *pte) if (i < 0) { ast_log(LOG_WARNING, "Asked to retransmit an ACKed slot ! last_buf_available=%d, seq_server = #0x%.4x last_seq_ack = #0x%.4x\n", - pte->last_buf_available, pte->seq_server, pte->last_seq_ack); + pte->last_buf_available, (unsigned)pte->seq_server, (unsigned)pte->last_seq_ack); continue; } @@ -1549,7 +1549,7 @@ static int send_retransmit(struct unistimsession *pte) seq = ntohs(sbuf[1]); ast_verb(0, "Retransmit slot #%d (seq=#0x%.4x), last ack was #0x%.4x\n", i, - seq, pte->last_seq_ack); + (unsigned)seq, (unsigned)pte->last_seq_ack); } send_raw_client(pte->wsabufsend[i].len, pte->wsabufsend[i].buf, &pte->sin, &pte->sout); @@ -1624,7 +1624,7 @@ static void send_led_update(struct unistimsession *pte, unsigned char led) { BUFFSEND; if (unistimdebug) { - ast_verb(0, "Sending led_update (%x)\n", led); + ast_verb(0, "Sending led_update (%x)\n", (unsigned)led); } memcpy(buffsend + SIZE_HEADER, packet_send_led_update, sizeof(packet_send_led_update)); buffsend[9] = led; @@ -1639,7 +1639,7 @@ static void send_mute(struct unistimsession *pte, unsigned char mute) */ BUFFSEND; if (unistimdebug) { - ast_verb(0, "Sending mute packet (%x)\n", mute); + ast_verb(0, "Sending mute packet (%x)\n", (unsigned)mute); } memcpy(buffsend + SIZE_HEADER, packet_send_mute, sizeof(packet_send_mute)); buffsend[9] = mute; @@ -1657,8 +1657,8 @@ send_select_output(struct unistimsession *pte, unsigned char output, unsigned ch BUFFSEND; int mute_icon = -1; if (unistimdebug) { - ast_verb(0, "Sending select output packet output=%x volume=%x mute=%x\n", output, - volume, mute); + ast_verb(0, "Sending select output packet output=%x volume=%x mute=%x\n", + (unsigned)output, (unsigned)volume, (unsigned)mute); } memcpy(buffsend + SIZE_HEADER, packet_send_select_output, sizeof(packet_send_select_output)); @@ -1962,7 +1962,7 @@ static struct unistim_line *unistim_line_alloc(void) static int unistim_free_sub(struct unistim_subchannel *sub) { if (unistimdebug) { - ast_debug(1, "Released sub %d of channel %s@%s\n", sub->subtype, sub->parent->name, sub->parent->parent->name); + ast_debug(1, "Released sub %u of channel %s@%s\n", sub->subtype, sub->parent->name, sub->parent->parent->name); } ast_mutex_destroy(&sub->lock); ast_free(sub); @@ -2061,7 +2061,7 @@ static void rcv_mac_addr(struct unistimsession *pte, const unsigned char *buf) char addrmac[19]; int res = 0; for (tmp = 15; tmp < 15 + SIZE_HEADER; tmp++) { - sprintf(&addrmac[i], "%.2x", (unsigned char) buf[tmp]); + sprintf(&addrmac[i], "%.2x", (unsigned) buf[tmp]); i += 2; } if (unistimdebug) { @@ -2154,7 +2154,7 @@ static void rcv_mac_addr(struct unistimsession *pte, const unsigned char *buf) pte->state = STATE_AUTHDENY; break; default: - ast_log(LOG_WARNING, "Internal error : unknown autoprovisioning value = %d\n", + ast_log(LOG_WARNING, "Internal error : unknown autoprovisioning value = %u\n", autoprovisioning); } } @@ -2207,7 +2207,7 @@ static void rcv_mac_addr(struct unistimsession *pte, const unsigned char *buf) pte->state = STATE_MAINPAGE; break; default: - ast_log(LOG_WARNING, "Internal error, extension value unknown : %d\n", + ast_log(LOG_WARNING, "Internal error, extension value unknown : %u\n", pte->device->extension); pte->state = STATE_AUTHDENY; break; @@ -2913,7 +2913,7 @@ static void send_dial_tone(struct unistimsession *pte) ast_tone_zone_part_parse(s, &tone_data); send_tone(pte, tone_data.freq1, tone_data.freq2); if (unistimdebug) { - ast_verb(0, "Country code found (%s), freq1=%d freq2=%d\n", + ast_verb(0, "Country code found (%s), freq1=%u freq2=%u\n", pte->device->tz->country, tone_data.freq1, tone_data.freq2); } ts = ast_tone_zone_sound_unref(ts); @@ -3144,7 +3144,7 @@ static void handle_call_outgoing(struct unistimsession *s) return; } if (unistimdebug) { - ast_verb(0, "Started three way call on channel %p (%s) subchan %d\n", + ast_verb(0, "Started three way call on channel %p (%s) subchan %u\n", sub_trans->owner, ast_channel_name(sub_trans->owner), sub_trans->subtype); } return; @@ -4475,7 +4475,7 @@ static void process_request(int size, unsigned char *buf, struct unistimsession char keycode = buf[13]; if (unistimdebug) { - ast_verb(0, "Expansion key pressed: keycode = 0x%.2x - current state: %s\n", keycode, + ast_verb(0, "Expansion key pressed: keycode = 0x%.2x - current state: %s\n", (unsigned)keycode, ptestate_tostr(pte->state)); } } @@ -4483,7 +4483,7 @@ static void process_request(int size, unsigned char *buf, struct unistimsession char keycode = buf[13]; if (unistimdebug) { - ast_verb(0, "Key pressed: keycode = 0x%.2x - current state: %s\n", keycode, + ast_verb(0, "Key pressed: keycode = 0x%.2x - current state: %s\n", (unsigned)keycode, ptestate_tostr(pte->state)); } if (keycode == KEY_MUTE) { @@ -4652,14 +4652,14 @@ static void parsing(int size, unsigned char *buf, struct unistimsession *pte, } if (buf[5] != 2) { ast_log(LOG_NOTICE, "%s Wrong direction : got 0x%.2x expected 0x02\n", tmpbuf, - buf[5]); + (unsigned)buf[5]); return; } seq = ntohs(sbuf[1]); if (buf[4] == 1) { ast_mutex_lock(&pte->lock); if (unistimdebug) { - ast_verb(6, "ACK received for packet #0x%.4x\n", seq); + ast_verb(6, "ACK received for packet #0x%.4x\n", (unsigned)seq); } pte->nb_retransmit = 0; @@ -4676,7 +4676,7 @@ static void parsing(int size, unsigned char *buf, struct unistimsession *pte, } else { ast_log(LOG_NOTICE, "%s Warning : ACK received for an already ACKed packet : #0x%.4x we are at #0x%.4x\n", - tmpbuf, seq, pte->last_seq_ack); + tmpbuf, (unsigned)seq, (unsigned)pte->last_seq_ack); } ast_mutex_unlock(&pte->lock); return; @@ -4684,13 +4684,13 @@ static void parsing(int size, unsigned char *buf, struct unistimsession *pte, if (pte->seq_server < seq) { ast_log(LOG_NOTICE, "%s Error : ACK received for a non-existent packet : #0x%.4x\n", - tmpbuf, pte->seq_server); + tmpbuf, (unsigned)pte->seq_server); ast_mutex_unlock(&pte->lock); return; } if (unistimdebug) { ast_verb(0, "%s ACK gap : Received ACK #0x%.4x, previous was #0x%.4x\n", - tmpbuf, seq, pte->last_seq_ack); + tmpbuf, (unsigned)seq, (unsigned)pte->last_seq_ack); } pte->last_seq_ack = seq; check_send_queue(pte); @@ -4714,7 +4714,7 @@ static void parsing(int size, unsigned char *buf, struct unistimsession *pte, if (pte->seq_phone > seq) { ast_log(LOG_NOTICE, "%s Warning : received a retransmitted packet : #0x%.4x (we are at #0x%.4x)\n", - tmpbuf, seq, pte->seq_phone); + tmpbuf, (unsigned)seq, (unsigned)pte->seq_phone); /* BUG ? pte->device->seq_phone = seq; */ /* Send ACK */ buf[4] = 1; @@ -4724,28 +4724,28 @@ static void parsing(int size, unsigned char *buf, struct unistimsession *pte, } ast_log(LOG_NOTICE, "%s Warning : we lost a packet : received #0x%.4x (we are at #0x%.4x)\n", - tmpbuf, seq, pte->seq_phone); + tmpbuf, (unsigned)seq, (unsigned)pte->seq_phone); return; } if (buf[4] == 0) { - ast_log(LOG_NOTICE, "%s Retransmit request for packet #0x%.4x\n", tmpbuf, seq); + ast_log(LOG_NOTICE, "%s Retransmit request for packet #0x%.4x\n", tmpbuf, (unsigned)seq); if (pte->last_seq_ack > seq) { ast_log(LOG_NOTICE, "%s Error : received a request for an already ACKed packet : #0x%.4x\n", - tmpbuf, pte->last_seq_ack); + tmpbuf, (unsigned)pte->last_seq_ack); return; } if (pte->seq_server < seq) { ast_log(LOG_NOTICE, "%s Error : received a request for a non-existent packet : #0x%.4x\n", - tmpbuf, pte->seq_server); + tmpbuf, (unsigned)pte->seq_server); return; } send_retransmit(pte); return; } ast_log(LOG_NOTICE, "%s Unknown request : got 0x%.2x expected 0x00,0x01 or 0x02\n", - tmpbuf, buf[4]); + tmpbuf, (unsigned)buf[4]); return; } @@ -5113,7 +5113,7 @@ static struct ast_frame *unistim_rtp_read(const struct ast_channel *ast, } if (!sub->rtp) { - ast_log(LOG_WARNING, "RTP handle NULL while reading on subchannel %d\n", + ast_log(LOG_WARNING, "RTP handle NULL while reading on subchannel %u\n", sub->subtype); return &ast_null_frame; } @@ -5170,7 +5170,7 @@ static int unistim_write(struct ast_channel *ast, struct ast_frame *frame) if (frame->frametype == AST_FRAME_IMAGE) { return 0; } else { - ast_log(LOG_WARNING, "Can't send %d type frames with unistim_write\n", + ast_log(LOG_WARNING, "Can't send %u type frames with unistim_write\n", frame->frametype); return 0; } @@ -5205,7 +5205,7 @@ static int unistim_fixup(struct ast_channel *oldchan, struct ast_channel *newcha ast_mutex_lock(&p->lock); - ast_debug(1, "New owner for channel USTM/%s@%s-%d is %s\n", l->name, + ast_debug(1, "New owner for channel USTM/%s@%s-%u is %s\n", l->name, l->parent->name, p->subtype, ast_channel_name(newchan)); if (p->owner != oldchan) { @@ -5677,7 +5677,7 @@ static struct ast_channel *unistim_new(struct unistim_subchannel *sub, int state tmp = ast_channel_alloc(1, state, l->cid_num, NULL, l->accountcode, l->exten, l->parent->context, assignedids, requestor, l->amaflags, "USTM/%s@%s-%p", l->name, l->parent->name, sub); if (unistimdebug) { - ast_verb(0, "unistim_new sub=%d (%p) chan=%p line=%s\n", sub->subtype, sub, tmp, l->name); + ast_verb(0, "unistim_new sub=%u (%p) chan=%p line=%s\n", sub->subtype, sub, tmp, l->name); } if (!tmp) { ast_log(LOG_WARNING, "Unable to allocate channel structure\n"); @@ -6030,7 +6030,7 @@ static char *unistim_show_info(struct ast_cli_entry *e, int cmd, struct ast_cli_ continue; } ast_cli(a->fd, "==> %d. dev=%s icon=%#-4x label=%-10s number=%-5s sub=%p line=%p\n", - i, device->softkeydevice[i], device->softkeyicon[i], device->softkeylabel[i], device->softkeynumber[i], + i, device->softkeydevice[i], (unsigned)device->softkeyicon[i], device->softkeylabel[i], device->softkeynumber[i], device->ssub[i], device->sline[i]); } device = device->next; @@ -6041,7 +6041,7 @@ static char *unistim_show_info(struct ast_cli_entry *e, int cmd, struct ast_cli_ s = sessions; while (s) { ast_cli(a->fd, - "sin=%s timeout=%u state=%s macaddr=%s device=%p session=%p\n", + "sin=%s timeout=%d state=%s macaddr=%s device=%p session=%p\n", ast_inet_ntoa(s->sin.sin_addr), s->timeout, ptestate_tostr(s->state), s->macaddr, s->device, s); s = s->next; @@ -6308,7 +6308,7 @@ static int parse_bookmark(const char *text, struct unistim_device *d) ast_copy_string(d->softkeynumber[p], number, sizeof(d->softkeynumber[p])); if (unistimdebug) { ast_verb(0, "New bookmark at pos %d label='%s' number='%s' icon=%#x\n", - p, d->softkeylabel[p], d->softkeynumber[p], d->softkeyicon[p]); + p, d->softkeylabel[p], d->softkeynumber[p], (unsigned)d->softkeyicon[p]); } return 1; } diff --git a/channels/iax2/firmware.c b/channels/iax2/firmware.c index 57262b724..a1ee43550 100644 --- a/channels/iax2/firmware.c +++ b/channels/iax2/firmware.c @@ -75,7 +75,7 @@ static int try_firmware(char *s) else last = s; - snprintf(s2, strlen(s) + 100, "/var/tmp/%s-%ld", last, (unsigned long)ast_random()); + snprintf(s2, strlen(s) + 100, "/var/tmp/%s-%ld", last, ast_random()); if (stat(s, &stbuf) < 0) { ast_log(LOG_WARNING, "Failed to stat '%s': %s\n", s, strerror(errno)); diff --git a/channels/iax2/parser.c b/channels/iax2/parser.c index ee4a6c3be..f5c7ba05d 100644 --- a/channels/iax2/parser.c +++ b/channels/iax2/parser.c @@ -108,7 +108,7 @@ static void dump_string_hex(char *output, int maxlen, void *value, int len) int i = 0; while (len-- && (i + 1) * 4 < maxlen) { - sprintf(output + (4 * i), "\\x%2.2x", *((unsigned char *)value + i)); + sprintf(output + (4 * i), "\\x%2.2x", (unsigned)*((unsigned char *)value + i)); i++; } } @@ -1149,7 +1149,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->osptokenblock[count] = (char *)data + 2 + 1; ies->ospblocklength[count] = len - 1; } else { - snprintf(tmp, (int)sizeof(tmp), "Expected OSP token block index to be 0~%d but was %d\n", IAX_MAX_OSPBLOCK_NUM - 1, count); + snprintf(tmp, (int)sizeof(tmp), "Expected OSP token block index to be 0~%d but was %u\n", IAX_MAX_OSPBLOCK_NUM - 1, count); errorf(tmp); } break; diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index 86148259a..c50dbf3fc 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -432,9 +432,9 @@ static int channel_read_rtp(struct ast_channel *chan, const char *type, const ch } else if (!strcmp(type, "direct")) { ast_copy_string(buf, ast_sockaddr_stringify(&media->direct_media_addr), buflen); } else if (!strcmp(type, "secure")) { - snprintf(buf, buflen, "%u", media->srtp ? 1 : 0); + snprintf(buf, buflen, "%d", media->srtp ? 1 : 0); } else if (!strcmp(type, "hold")) { - snprintf(buf, buflen, "%u", media->held ? 1 : 0); + snprintf(buf, buflen, "%d", media->held ? 1 : 0); } else { ast_log(AST_LOG_WARNING, "Unknown type field '%s' specified for 'rtp' information\n", type); return -1; @@ -580,7 +580,7 @@ static int channel_read_pjsip(struct ast_channel *chan, const char *type, const dlg = channel->session->inv_session->dlg; if (!strcmp(type, "secure")) { - snprintf(buf, buflen, "%u", dlg->secure ? 1 : 0); + snprintf(buf, buflen, "%d", dlg->secure ? 1 : 0); } else if (!strcmp(type, "target_uri")) { pjsip_uri_print(PJSIP_URI_IN_REQ_URI, dlg->target, buf, buflen); buf_copy = ast_strdupa(buf); diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 51d3f1495..21b832164 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -338,7 +338,7 @@ static void analog_swap_subs(struct analog_pvt *p, enum analog_sub a, enum analo int tinthreeway; struct ast_channel *towner; - ast_debug(1, "Swapping %d and %d\n", a, b); + ast_debug(1, "Swapping %u and %u\n", a, b); towner = p->subs[a].owner; p->subs[a].owner = p->subs[b].owner; @@ -1555,7 +1555,7 @@ void analog_handle_dtmf(struct analog_pvt *p, struct ast_channel *ast, enum anal ast_debug(1, "%s DTMF digit: 0x%02X '%c' on %s\n", f->frametype == AST_FRAME_DTMF_BEGIN ? "Begin" : "End", - f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); + (unsigned)f->subclass.integer, f->subclass.integer, ast_channel_name(ast)); if (analog_check_confirmanswer(p)) { if (f->frametype == AST_FRAME_DTMF_END) { @@ -2705,7 +2705,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ res = analog_get_event(p); - ast_debug(1, "Got event %s(%d) on channel %d (index %d)\n", analog_event2str(res), res, p->channel, idx); + ast_debug(1, "Got event %s(%d) on channel %d (index %u)\n", analog_event2str(res), res, p->channel, idx); if (res & (ANALOG_EVENT_PULSEDIGIT | ANALOG_EVENT_DTMFUP)) { analog_set_pulsedial(p, (res & ANALOG_EVENT_PULSEDIGIT) ? 1 : 0); @@ -2884,7 +2884,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } mssinceflash = ast_tvdiff_ms(ast_tvnow(), p->flashtime); - ast_debug(1, "Last flash was %d ms ago\n", mssinceflash); + ast_debug(1, "Last flash was %u ms ago\n", mssinceflash); if (mssinceflash < MIN_MS_SINCE_FLASH) { /* It hasn't been long enough since the last flashook. This is probably a bounce on hanging up. Hangup both channels now */ @@ -2930,7 +2930,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } } } else { - ast_log(LOG_WARNING, "Got a hangup and my index is %d?\n", idx); + ast_log(LOG_WARNING, "Got a hangup and my index is %u?\n", idx); } /* Fall through */ default: @@ -3038,7 +3038,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } break; default: - ast_log(LOG_WARNING, "FXO phone off hook in weird state %d??\n", ast_channel_state(ast)); + ast_log(LOG_WARNING, "FXO phone off hook in weird state %u??\n", ast_channel_state(ast)); } break; case ANALOG_SIG_FXSLS: @@ -3090,7 +3090,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } /* Fall through */ default: - ast_log(LOG_WARNING, "Ring/Off-hook in strange state %d on channel %d\n", ast_channel_state(ast), p->channel); + ast_log(LOG_WARNING, "Ring/Off-hook in strange state %u on channel %d\n", ast_channel_state(ast), p->channel); break; } break; @@ -3142,7 +3142,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ case ANALOG_SIG_FXOLS: case ANALOG_SIG_FXOGS: case ANALOG_SIG_FXOKS: - ast_debug(1, "Winkflash, index: %d, normal: %d, callwait: %d, thirdcall: %d\n", + ast_debug(1, "Winkflash, index: %u, normal: %d, callwait: %d, thirdcall: %d\n", idx, analog_get_sub_fd(p, ANALOG_SUB_REAL), analog_get_sub_fd(p, ANALOG_SUB_CALLWAIT), analog_get_sub_fd(p, ANALOG_SUB_THREEWAY)); /* Cancel any running CallerID spill */ @@ -3150,7 +3150,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ p->callwaitcas = 0; if (idx != ANALOG_SUB_REAL) { - ast_log(LOG_WARNING, "Got flash hook with index %d on channel %d?!?\n", idx, p->channel); + ast_log(LOG_WARNING, "Got flash hook with index %u on channel %d?!?\n", idx, p->channel); goto winkflashdone; } @@ -3352,7 +3352,7 @@ winkflashdone: if (p->dialing) { ast_debug(1, "Ignoring wink on channel %d\n", p->channel); } else { - ast_debug(1, "Got wink in weird state %d on channel %d\n", ast_channel_state(ast), p->channel); + ast_debug(1, "Got wink in weird state %u on channel %d\n", ast_channel_state(ast), p->channel); } break; case ANALOG_SIG_FEATDMF_TA: @@ -3490,7 +3490,7 @@ winkflashdone: case AST_STATE_PRERING: /*!< Channel has detected an incoming call and is waiting for ring */ default: if (p->answeronpolarityswitch || p->hanguponpolarityswitch) { - ast_debug(1, "Ignoring Polarity switch on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Ignoring Polarity switch on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } break; } @@ -3501,20 +3501,20 @@ winkflashdone: case AST_STATE_DIALING: /*!< Digits (or equivalent) have been dialed */ case AST_STATE_RINGING: /*!< Remote end is ringing */ if (p->answeronpolarityswitch) { - ast_debug(1, "Polarity switch detected but NOT answering (too close to OffHook event) on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Polarity switch detected but NOT answering (too close to OffHook event) on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } break; case AST_STATE_UP: /*!< Line is up */ case AST_STATE_RING: /*!< Line is ringing */ if (p->hanguponpolarityswitch) { - ast_debug(1, "Polarity switch detected but NOT hanging up (too close to Answer event) on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Polarity switch detected but NOT hanging up (too close to Answer event) on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } break; default: if (p->answeronpolarityswitch || p->hanguponpolarityswitch) { - ast_debug(1, "Polarity switch detected (too close to previous event) on channel %d, state %d\n", p->channel, ast_channel_state(ast)); + ast_debug(1, "Polarity switch detected (too close to previous event) on channel %d, state %u\n", p->channel, ast_channel_state(ast)); } break; } @@ -3522,7 +3522,7 @@ winkflashdone: } /* Added more log_debug information below to provide a better indication of what is going on */ - ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %d, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); + ast_debug(1, "Polarity Reversal event occured - DEBUG 2: channel %d, state %u, pol= %d, aonp= %d, honp= %d, pdelay= %d, tv= %" PRIi64 "\n", p->channel, ast_channel_state(ast), p->polarity, p->answeronpolarityswitch, p->hanguponpolarityswitch, p->polarityonanswerdelay, ast_tvdiff_ms(ast_tvnow(), p->polaritydelaytv) ); break; default: ast_debug(1, "Dunno what to do with event %d on channel %d\n", res, p->channel); diff --git a/channels/sig_pri.c b/channels/sig_pri.c index def6555a9..33bbd9144 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -754,15 +754,15 @@ static void sig_pri_set_subaddress(struct ast_party_subaddress *ast_subaddress, ptr = cnum; len = pri_subaddress->length - 1; /* -1 account for zero based indexing */ for (x = 0; x < len; ++x) { - ptr += sprintf(ptr, "%02x", pri_subaddress->data[x]); + ptr += sprintf(ptr, "%02x", (unsigned)pri_subaddress->data[x]); } if (pri_subaddress->odd_even_indicator) { /* ODD */ - sprintf(ptr, "%01x", (pri_subaddress->data[len]) >> 4); + sprintf(ptr, "%01x", (unsigned)((pri_subaddress->data[len]) >> 4)); } else { /* EVEN */ - sprintf(ptr, "%02x", pri_subaddress->data[len]); + sprintf(ptr, "%02x", (unsigned)pri_subaddress->data[len]); } ast_subaddress->str = cnum; } @@ -2427,8 +2427,8 @@ static void party_json_to_ami(struct ast_str **msg, const char *prefix, struct a struct ast_json *subaddress = ast_json_object_get(party, "subaddress"); /* Combined party presentation */ - ast_str_append(msg, 0, "%sPres: %d (%s)\r\n", prefix, - (uint32_t)ast_json_integer_get(presentation), + ast_str_append(msg, 0, "%sPres: %zd (%s)\r\n", prefix, + ast_json_integer_get(presentation), ast_json_string_get(presentation_txt)); /* Party number */ @@ -5328,7 +5328,7 @@ static void sig_pri_moh_fsm_event(struct ast_channel *chan, struct sig_pri_chan if (orig_state < SIG_PRI_MOH_STATE_IDLE || SIG_PRI_MOH_STATE_NUM <= orig_state || !sig_pri_moh_fsm[orig_state]) { /* Programming error: State not implemented. */ - ast_log(LOG_ERROR, "MOH state not implemented: %s(%d)\n", + ast_log(LOG_ERROR, "MOH state not implemented: %s(%u)\n", sig_pri_moh_state_str(orig_state), orig_state); return; } @@ -8041,7 +8041,7 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, const char *rd if (p->pri->facilityenable) pri_facility_enable(p->pri->pri); - ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", ast_channel_transfercapability(ast), ast_transfercapability2str(ast_channel_transfercapability(ast))); + ast_verb(3, "Requested transfer capability: 0x%.2x - %s\n", (unsigned)ast_channel_transfercapability(ast), ast_transfercapability2str(ast_channel_transfercapability(ast))); dp_strip = 0; pridialplan = p->pri->dialplan - 1; if (pridialplan == -2 || pridialplan == -3) { /* compute dynamically */ @@ -8801,7 +8801,7 @@ int sig_pri_digit_begin(struct sig_pri_chan *pvt, struct ast_channel *ast, char } if (pvt->call_level < SIG_PRI_CALL_LEVEL_CONNECT) { ast_log(LOG_WARNING, - "Span %d: Digit '%c' may be ignored by peer. (Call level:%d(%s))\n", + "Span %d: Digit '%c' may be ignored by peer. (Call level:%u(%s))\n", pvt->pri->span, digit, pvt->call_level, sig_pri_call_level2str(pvt->call_level)); } diff --git a/channels/sip/config_parser.c b/channels/sip/config_parser.c index 6fc83248d..27ded99b8 100644 --- a/channels/sip/config_parser.c +++ b/channels/sip/config_parser.c @@ -684,7 +684,7 @@ int sip_parse_host(char *line, int lineno, char **hostname, int *portnum, enum a } if (port) { - if (!sscanf(port, "%5u", portnum)) { + if (!sscanf(port, "%5d", portnum)) { if (lineno) { ast_log(LOG_NOTICE, "'%s' is not a valid port number on line %d of sip.conf. using default.\n", port, lineno); } else { diff --git a/channels/sip/include/sip.h b/channels/sip/include/sip.h index 2659b91f9..e2ab6e19a 100644 --- a/channels/sip/include/sip.h +++ b/channels/sip/include/sip.h @@ -1304,7 +1304,7 @@ struct sip_peer { int ringing; /*!< Number of calls ringing */ int onhold; /*!< Peer has someone on hold */ int call_limit; /*!< Limit of concurrent calls */ - int t38_maxdatagram; /*!< T.38 FaxMaxDatagram override */ + unsigned int t38_maxdatagram; /*!< T.38 FaxMaxDatagram override */ int busy_level; /*!< Level of active channels where we signal busy */ int maxforwards; /*!< SIP Loop prevention */ enum transfermodes allowtransfer; /*! SIP Refer restriction scheme */ |