summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-12-01 20:27:37 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-12-01 20:27:37 +0000
commitf59fe83c56f6539c09eb068a94d2db60bfb18f17 (patch)
tree72344fb3a18484772df8f496cc1f9be6e902c64f /channels
parentb2d115bce95e02589972ad4f07cb9a959ea02139 (diff)
More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we found several unhandled cases, where a 32-bit integer was still being used to handle a codec field. Most of these have been fixed with this commit, although there is at least one case (codec_dahdi) which depends upon outside headers to be altered before a conversion can be made. (Fixes AST-278, SWP-459) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c4
-rw-r--r--channels/chan_h323.c4
-rw-r--r--channels/chan_phone.c2
-rw-r--r--channels/chan_sip.c9
-rw-r--r--channels/chan_skinny.c10
-rw-r--r--channels/chan_unistim.c4
6 files changed, 17 insertions, 16 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 0da2ded8c..40e7de230 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8527,7 +8527,7 @@ static int dahdi_indicate(struct ast_channel *chan, int condition, const void *d
static struct ast_channel *dahdi_new(struct dahdi_pvt *i, int state, int startpbx, int idx, int law, int transfercapability, const char *linkedid)
{
struct ast_channel *tmp;
- int deflaw;
+ format_t deflaw;
int res;
int x,y;
int features;
@@ -9909,7 +9909,7 @@ struct mwi_thread_data {
size_t len;
};
-static int calc_energy(const unsigned char *buf, int len, int law)
+static int calc_energy(const unsigned char *buf, int len, format_t law)
{
int x;
int sum = 0;
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 3ccfde2d3..32d9443d4 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -3154,7 +3154,7 @@ static enum ast_rtp_glue_result oh323_get_rtp_peer(struct ast_channel *chan, str
return res;
}
-static char *convertcap(int cap)
+static char *convertcap(format_t cap)
{
switch (cap) {
case AST_FORMAT_G723_1:
@@ -3176,7 +3176,7 @@ static char *convertcap(int cap)
case AST_FORMAT_ILBC:
return "ILBC";
default:
- ast_log(LOG_NOTICE, "Don't know how to deal with mode %d\n", cap);
+ ast_log(LOG_NOTICE, "Don't know how to deal with mode %" PRId64 "\n", cap);
return NULL;
}
}
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index b84c39c9f..389f30401 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -94,7 +94,7 @@ static int echocancel = AEC_OFF;
static int silencesupression = 0;
-static int prefformat = AST_FORMAT_G729A | AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW;
+static format_t prefformat = AST_FORMAT_G729A | AST_FORMAT_G723_1 | AST_FORMAT_SLINEAR | AST_FORMAT_ULAW;
/* Protect the interface list (of phone_pvt's) */
AST_MUTEX_DEFINE_STATIC(iflock);
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b47e33084..eab73f7b8 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -212,6 +212,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <signal.h>
#include <sys/signal.h>
#include <regex.h>
+#include <inttypes.h>
#include "asterisk/network.h"
#include "asterisk/paths.h" /* need ast_config_AST_SYSTEM_NAME */
@@ -10353,7 +10354,7 @@ static void add_codec_to_sdp(const struct sip_pvt *p, format_t codec,
if (debug)
- ast_verbose("Adding codec 0x%Lx (%s) to SDP\n", (long long) codec, ast_getformatname(codec));
+ ast_verbose("Adding codec 0x%" PRIx64 " (%s) to SDP\n", codec, ast_getformatname(codec));
if ((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->rtp), 1, codec)) == -1)
return;
@@ -10401,7 +10402,7 @@ static void add_codec_to_sdp(const struct sip_pvt *p, format_t codec,
/*! \brief Add video codec offer to SDP offer/answer body in INVITE or 200 OK */
/* This is different to the audio one now so we can add more caps later */
-static void add_vcodec_to_sdp(const struct sip_pvt *p, int codec,
+static void add_vcodec_to_sdp(const struct sip_pvt *p, format_t codec,
struct ast_str **m_buf, struct ast_str **a_buf,
int debug, int *min_packet_size)
{
@@ -10411,7 +10412,7 @@ static void add_vcodec_to_sdp(const struct sip_pvt *p, int codec,
return;
if (debug)
- ast_verbose("Adding video codec 0x%x (%s) to SDP\n", codec, ast_getformatname(codec));
+ ast_verbose("Adding video codec 0x%" PRIx64 " (%s) to SDP\n", codec, ast_getformatname(codec));
if ((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->vrtp), 1, codec)) == -1)
return;
@@ -10726,7 +10727,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
}
/* Now send any other common audio and video codecs, and non-codec formats: */
- for (x = 1LL; x <= (needtext ? AST_FORMAT_TEXT_MASK : (needvideo ? AST_FORMAT_VIDEO_MASK : AST_FORMAT_AUDIO_MASK)); x <<= 1) {
+ for (x = 1ULL; x <= (needtext ? AST_FORMAT_TEXT_MASK : (needvideo ? AST_FORMAT_VIDEO_MASK : AST_FORMAT_AUDIO_MASK)); x <<= 1) {
if (!(capability & x)) /* Codec not requested */
continue;
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 354414e23..79eb2fb2b 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1715,7 +1715,7 @@ static struct skinny_speeddial *find_speeddial_by_instance(struct skinny_device
return sd;
}
-static int codec_skinny2ast(enum skinny_codecs skinnycodec)
+static format_t codec_skinny2ast(enum skinny_codecs skinnycodec)
{
switch (skinnycodec) {
case SKINNY_CODEC_ALAW:
@@ -1737,7 +1737,7 @@ static int codec_skinny2ast(enum skinny_codecs skinnycodec)
}
}
-static int codec_ast2skinny(int astcodec)
+static int codec_ast2skinny(format_t astcodec)
{
switch (astcodec) {
case AST_FORMAT_ALAW:
@@ -5307,7 +5307,7 @@ static int handle_capabilities_res_message(struct skinny_req *req, struct skinny
struct skinny_device *d = s->device;
struct skinny_line *l;
uint32_t count = 0;
- int codecs = 0;
+ format_t codecs = 0;
int i;
char buf[256];
@@ -5318,12 +5318,12 @@ static int handle_capabilities_res_message(struct skinny_req *req, struct skinny
}
for (i = 0; i < count; i++) {
- int acodec = 0;
+ format_t acodec = 0;
int scodec = 0;
scodec = letohl(req->data.caps.caps[i].codec);
acodec = codec_skinny2ast(scodec);
if (skinnydebug)
- ast_verb(1, "Adding codec capability '%d (%d)'\n", acodec, scodec);
+ ast_verb(1, "Adding codec capability '%" PRId64 " (%d)'\n", acodec, scodec);
codecs |= acodec;
}
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index 53ac9f94e..79df46650 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -407,7 +407,7 @@ struct unistim_line {
/*! AMA flags (for billing) */
int amaflags;
/*! Codec supported */
- int capability;
+ format_t capability;
/*! Parkinglot */
char parkinglot[AST_MAX_CONTEXT];
struct unistim_line *next;
@@ -4710,7 +4710,7 @@ static char *unistim_info(struct ast_cli_entry *e, int cmd, struct ast_cli_args
line = device->lines;
while (line) {
ast_cli(a->fd,
- "->name=%s fullname=%s exten=%s callid=%s cap=%d device=%p line=%p\n",
+ "->name=%s fullname=%s exten=%s callid=%s cap=%" PRId64 " device=%p line=%p\n",
line->name, line->fullname, line->exten, line->cid_num,
line->capability, line->parent, line);
for (i = 0; i < MAX_SUBS; i++) {