[Freeswitch-trunk] [commit] r6845 - freeswitch/trunk/src
Freeswitch SVN
mikej at freeswitch.org
Mon Dec 17 18:19:10 EST 2007
Author: mikej
Date: Mon Dec 17 18:19:10 2007
New Revision: 6845
Modified:
freeswitch/trunk/src/switch_ivr.c
freeswitch/trunk/src/switch_rtp.c
Log:
varname scope un-masking and fix a check
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Mon Dec 17 18:19:10 2007
@@ -1063,7 +1063,7 @@
{
switch_status_t status = SWITCH_STATUS_FALSE;
- if (stream == NULL && stream->digits != NULL) {
+ if (stream && stream->digits != NULL) {
free(stream->digits);
stream->digits = NULL;
status = SWITCH_STATUS_SUCCESS;
@@ -1379,8 +1379,7 @@
switch_caller_profile_t *cp = NULL;
int i_off = 0;
for (cp = caller_profile->caller_extension->children; cp; cp = cp->next) {
- switch_caller_application_t *ap;
- int app_off = 0;
+ app_off = 0;
if (!cp->caller_extension) {
continue;
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Mon Dec 17 18:19:10 2007
@@ -240,14 +240,14 @@
} while (switch_stun_packet_next_attribute(attr));
if ((packet->header.type == SWITCH_STUN_BINDING_REQUEST) && !strcmp(rtp_session->user_ice, username)) {
- uint8_t buf[512];
+ uint8_t stunbuf[512];
switch_stun_packet_t *rpacket;
const char *remote_ip;
switch_size_t bytes;
char ipbuf[25];
- memset(buf, 0, sizeof(buf));
- rpacket = switch_stun_packet_build_header(SWITCH_STUN_BINDING_RESPONSE, packet->header.id, buf);
+ memset(stunbuf, 0, sizeof(stunbuf));
+ rpacket = switch_stun_packet_build_header(SWITCH_STUN_BINDING_RESPONSE, packet->header.id, stunbuf);
switch_stun_packet_attribute_add_username(rpacket, username, 32);
remote_ip = switch_get_addr(ipbuf, sizeof(ipbuf), rtp_session->from_addr);
switch_stun_packet_attribute_add_binded_address(rpacket, (char *)remote_ip, switch_sockaddr_get_port(rtp_session->from_addr));
@@ -931,10 +931,10 @@
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTO_CNG) &&
rtp_session->timer.samplecount >= (rtp_session->last_write_samplecount + (rtp_session->samples_per_interval * 50))) {
uint8_t data[2] = { 0 };
- switch_frame_flag_t flags = SFF_NONE;
+ switch_frame_flag_t frame_flags = SFF_NONE;
data[0] = 65;
rtp_session->cn++;
- rtp_common_write(rtp_session, (void *) data, sizeof(data), rtp_session->cng_pt, &flags);
+ rtp_common_write(rtp_session, (void *) data, sizeof(data), rtp_session->cng_pt, &frame_flags);
}
}
@@ -1315,7 +1315,7 @@
if (fwd) {
bytes = datalen;
send_msg = (rtp_msg_t *) data;
- if (*flags & SFF_RFC2833) {
+ if (flags && *flags & SFF_RFC2833) {
send_msg->header.pt = rtp_session->te;
}
} else {
@@ -1367,7 +1367,7 @@
int16_t decoded[SWITCH_RECOMMENDED_BUFFER_SIZE / sizeof(int16_t)] = {0};
uint32_t rate = 0;
- uint32_t flags = 0;
+ uint32_t codec_flags = 0;
uint32_t len = sizeof(decoded);
time_t now = time(NULL);
send = 0;
@@ -1383,7 +1383,7 @@
data,
datalen,
rtp_session->vad_data.read_codec->implementation->actual_samples_per_second,
- decoded, &len, &rate, &flags) == SWITCH_STATUS_SUCCESS) {
+ decoded, &len, &rate, &codec_flags) == SWITCH_STATUS_SUCCESS) {
uint32_t energy = 0;
More information about the Freeswitch-trunk
mailing list