From abd3e4040bd76058d0148884879858894258fb9f Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Fri, 9 May 2014 22:49:26 +0000 Subject: Allow Asterisk to compile under GCC 4.10 This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_skinny.c | 134 ++++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'channels/chan_skinny.c') 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; -- cgit v1.2.3