[asterisk-commits] tilghman: trunk r231850 - in /trunk: addons/ channels/ include/asterisk/ main...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 1 14:27:42 CST 2009


Author: tilghman
Date: Tue Dec  1 14:27:37 2009
New Revision: 231850

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=231850
Log:
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)

Modified:
    trunk/addons/chan_ooh323.c
    trunk/addons/chan_ooh323.h
    trunk/addons/ooh323cDriver.c
    trunk/addons/ooh323cDriver.h
    trunk/channels/chan_dahdi.c
    trunk/channels/chan_h323.c
    trunk/channels/chan_phone.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_skinny.c
    trunk/channels/chan_unistim.c
    trunk/include/asterisk/callerid.h
    trunk/include/asterisk/rtp_engine.h
    trunk/main/callerid.c
    trunk/main/rtp_engine.c
    trunk/res/res_adsi.c
    trunk/res/res_rtp_asterisk.c

Modified: trunk/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/addons/chan_ooh323.c (original)
+++ trunk/addons/chan_ooh323.c Tue Dec  1 14:27:37 2009
@@ -169,9 +169,9 @@
 	char callee_url[AST_MAX_EXTENSION];
  
 	int port;
-	int readformat;   /* negotiated read format */
-	int writeformat;  /* negotiated write format */
-	int capability;
+	format_t readformat;   /* negotiated read format */
+	format_t writeformat;  /* negotiated write format */
+	format_t capability;
 	struct ast_codec_pref prefs;
 	int dtmfmode;
 	int dtmfcodec;
@@ -3673,7 +3673,7 @@
 }
 
 
-int ooh323_convertAsteriskCapToH323Cap(int cap)
+int ooh323_convertAsteriskCapToH323Cap(format_t cap)
 {
 	char formats[FORMAT_STRING_SIZE];
 	switch (cap) {
@@ -3744,7 +3744,8 @@
 {
 	struct sockaddr_in us;
 	ooMediaInfo mediaInfo;
-	int x, format = 0;	  
+	int x;
+	format_t format = 0;
 
 	if (gH323Debug)
 		ast_verbose("---   configure_local_rtp\n");

Modified: trunk/addons/chan_ooh323.h
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_ooh323.h?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/addons/chan_ooh323.h (original)
+++ trunk/addons/chan_ooh323.h Tue Dec  1 14:27:37 2009
@@ -60,7 +60,7 @@
 #include <asterisk/manager.h>
 #include <asterisk/dsp.h>
 #include <asterisk/stringfields.h>
-
+#include <asterisk/frame_defs.h>
 #include <asterisk/udptl.h>
 
 #include "ootypes.h"
@@ -104,7 +104,7 @@
 int ooh323_update_capPrefsOrderForCall
    (ooCallData *call, struct ast_codec_pref *prefs);
 
-int ooh323_convertAsteriskCapToH323Cap(int cap);
+int ooh323_convertAsteriskCapToH323Cap(format_t cap);
 
 int ooh323_convert_hangupcause_asteriskToH323(int cause);
 int ooh323_convert_hangupcause_h323ToAsterisk(int cause);

Modified: trunk/addons/ooh323cDriver.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323cDriver.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/addons/ooh323cDriver.c (original)
+++ trunk/addons/ooh323cDriver.c Tue Dec  1 14:27:37 2009
@@ -594,7 +594,7 @@
    
 int ooh323c_start_receive_channel(ooCallData *call, ooLogicalChannel *pChannel)
 {
-   int fmt=-1;
+   format_t fmt=-1;
    fmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap);
    if(fmt>0) {
       /* ooh323_set_read_format(call, fmt); */
@@ -608,7 +608,7 @@
 
 int ooh323c_start_transmit_channel(ooCallData *call, ooLogicalChannel *pChannel)
 {
-   int fmt=-1;
+   format_t fmt;
    fmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap);
    if(fmt>0) {
       switch (fmt) {
@@ -665,7 +665,7 @@
    return 1;
 }
 
-int convertH323CapToAsteriskCap(int cap)
+format_t convertH323CapToAsteriskCap(int cap)
 {
 
    switch(cap)

Modified: trunk/addons/ooh323cDriver.h
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/ooh323cDriver.h?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/addons/ooh323cDriver.h (original)
+++ trunk/addons/ooh323cDriver.h Tue Dec  1 14:27:37 2009
@@ -22,6 +22,7 @@
 #include "ooCalls.h"
 #include "ooCapability.h"
 #include "ooStackCmds.h"
+#include <asterisk/frame_defs.h>
 #define H323_DTMF_RFC2833          (1 << 0)
 #define H323_DTMF_Q931             (1 << 1)
 #define H323_DTMF_H245ALPHANUMERIC (1 << 2)
@@ -37,7 +38,7 @@
 int ooh323c_stop_call_thread(ooCallData *call);
 int ooh323c_set_capability
    (struct ast_codec_pref *prefs, int capability, int dtmf, int dtmfcodec);
-int convertH323CapToAsteriskCap(int cap);
+format_t convertH323CapToAsteriskCap(int cap);
 int ooh323c_set_capability_for_call
    (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf, int dtmfcodec,
 	int t38support);

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Dec  1 14:27:37 2009
@@ -8527,7 +8527,7 @@
 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 @@
 	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;

Modified: trunk/channels/chan_h323.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_h323.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Tue Dec  1 14:27:37 2009
@@ -3154,7 +3154,7 @@
 	return res;
 }
 
-static char *convertcap(int cap)
+static char *convertcap(format_t cap)
 {
 	switch (cap) {
 	case AST_FORMAT_G723_1:
@@ -3176,7 +3176,7 @@
 	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;
 	}
 }

Modified: trunk/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_phone.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_phone.c (original)
+++ trunk/channels/chan_phone.c Tue Dec  1 14:27:37 2009
@@ -94,7 +94,7 @@
 
 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);

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Dec  1 14:27:37 2009
@@ -212,6 +212,7 @@
 #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 @@
 
 
 	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 @@
 
 /*! \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 @@
 		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 @@
 		}
 
 		/* 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;
 

Modified: trunk/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Tue Dec  1 14:27:37 2009
@@ -1715,7 +1715,7 @@
 	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_ast2skinny(int astcodec)
+static int codec_ast2skinny(format_t astcodec)
 {
 	switch (astcodec) {
 	case AST_FORMAT_ALAW:
@@ -5307,7 +5307,7 @@
 	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 @@
 	}
 
 	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;
 	}
 

Modified: trunk/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Tue Dec  1 14:27:37 2009
@@ -407,7 +407,7 @@
 	/*! 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 @@
 		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++) {

Modified: trunk/include/asterisk/callerid.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/callerid.h?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/include/asterisk/callerid.h (original)
+++ trunk/include/asterisk/callerid.h Tue Dec  1 14:27:37 2009
@@ -44,6 +44,8 @@
 
 #ifndef _ASTERISK_CALLERID_H
 #define _ASTERISK_CALLERID_H
+
+#include "asterisk/frame_defs.h"
 
 #define MAX_CALLERID_SIZE 32000
 
@@ -99,7 +101,7 @@
  * \return It returns the size
  * (in bytes) of the data (if it returns a size of 0, there is probably an error)
  */
-int callerid_generate(unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, int codec);
+int callerid_generate(unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, format_t codec);
 
 /*! \brief Create a callerID state machine
  * \param cid_signalling Type of signalling in use
@@ -122,7 +124,7 @@
  * \retval 0 for "needs more samples"
  * \retval 1 if the CallerID spill reception is complete.
  */
-int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int samples, int codec);
+int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int samples, format_t codec);
 
 /*! \brief Read samples into the state machine.
  * \param cid Which state machine to act upon
@@ -136,7 +138,7 @@
  * \retval 0 for "needs more samples"
  * \retval 1 if the CallerID spill reception is complete.
  */
-int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int samples, int codec);
+int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int samples, format_t codec);
 
 /*! \brief Extract info out of callerID state machine.  Flags are listed above
  * \param cid Callerid state machine to act upon
@@ -175,7 +177,7 @@
  * \details
  * Acts like callerid_generate except uses an asterisk format callerid string.
  */
-int ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int codec);
+int ast_callerid_generate(unsigned char *buf, const char *name, const char *number, format_t codec);
 
 /*!
  * \brief Generate message waiting indicator
@@ -185,13 +187,13 @@
  * \see callerid_generate() for more info as it uses the same encoding
  * \version 1.6.1 changed mdmf parameter to type, added name, number and flags for caller id message generation
  */
-int ast_callerid_vmwi_generate(unsigned char *buf, int active, int type, int codec, const char *name,
+int ast_callerid_vmwi_generate(unsigned char *buf, int active, int type, format_t codec, const char *name,
 	const char *number, int flags);
 
 /*! \brief Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
  * \see ast_callerid_generate() for other details
  */
-int ast_callerid_callwaiting_generate(unsigned char *buf, const char *name, const char *number, int codec);
+int ast_callerid_callwaiting_generate(unsigned char *buf, const char *name, const char *number, format_t codec);
 
 /*! \brief Destructively parse inbuf into name and location (or number)
  * \details
@@ -216,7 +218,7 @@
  * \param codec Which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW)
  * \return Returns -1 on error (if len is less than 2400), 0 on success.
  */
-int ast_gen_cas(unsigned char *outbuf, int sas, int len, int codec);
+int ast_gen_cas(unsigned char *outbuf, int sas, int len, format_t codec);
 
 /*!
  * \brief Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s...

Modified: trunk/include/asterisk/rtp_engine.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/rtp_engine.h?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/include/asterisk/rtp_engine.h (original)
+++ trunk/include/asterisk/rtp_engine.h Tue Dec  1 14:27:37 2009
@@ -364,7 +364,7 @@
 	/*! Callback to request that the RTP engine send a STUN BIND request */
 	void (*stun_request)(struct ast_rtp_instance *instance, struct sockaddr_in *suggestion, const char *username);
 	/*! Callback to get the transcodeable formats supported */
-	int (*available_formats)(struct ast_rtp_instance *instance, int to_endpoint, int to_asterisk);
+	int (*available_formats)(struct ast_rtp_instance *instance, format_t to_endpoint, format_t to_asterisk);
 	/*! Linked list information */
 	AST_RWLIST_ENTRY(ast_rtp_engine) entry;
 };
@@ -1527,7 +1527,7 @@
  *
  * \since 1.6.3
  */
-format_t ast_rtp_instance_available_formats(struct ast_rtp_instance *instance, int to_endpoint, int to_asterisk);
+format_t ast_rtp_instance_available_formats(struct ast_rtp_instance *instance, format_t to_endpoint, format_t to_asterisk);
 
 /*!
  * \brief Indicate to the RTP engine that packets are now expected to be sent/received on the RTP instance

Modified: trunk/main/callerid.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/callerid.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/main/callerid.c (original)
+++ trunk/main/callerid.c Tue Dec  1 14:27:37 2009
@@ -71,7 +71,7 @@
 
 #define AST_CALLERID_UNKNOWN	"<unknown>"
 
-static inline void gen_tones(unsigned char *buf, int len, int codec, float ddr1, float ddi1, float ddr2, float ddi2, float *cr1, float *ci1, float *cr2, float *ci2)
+static inline void gen_tones(unsigned char *buf, int len, format_t codec, float ddr1, float ddi1, float ddr2, float ddi2, float *cr1, float *ci1, float *cr2, float *ci2)
 {
 	int x;
 	float t;
@@ -93,7 +93,7 @@
 	}
 }
 
-static inline void gen_tone(unsigned char *buf, int len, int codec, float ddr1, float ddi1, float *cr1, float *ci1)
+static inline void gen_tone(unsigned char *buf, int len, format_t codec, float ddr1, float ddi1, float *cr1, float *ci1)
 {
 	int x;
 	float t;
@@ -255,7 +255,7 @@
 	}
 }
 
-int ast_gen_cas(unsigned char *outbuf, int sendsas, int len, int codec)
+int ast_gen_cas(unsigned char *outbuf, int sendsas, int len, format_t codec)
 {
 	int pos = 0;
 	int saslen = 2400;
@@ -300,7 +300,7 @@
    	return crc;
 }
 
-int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, int codec)
+int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, format_t codec)
 {
 	int mylen = len;
 	int olen;
@@ -539,7 +539,7 @@
 }
 
 
-int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int codec)
+int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, format_t codec)
 {
 	int mylen = len;
 	int olen;
@@ -791,7 +791,7 @@
 	
 }
 
-int ast_callerid_vmwi_generate(unsigned char *buf, int active, int type, int codec,
+int ast_callerid_vmwi_generate(unsigned char *buf, int active, int type, format_t codec,
 			       const char* name, const char* number, int flags)
 {
 	char msg[256];
@@ -879,7 +879,7 @@
 	return bytes;
 }
 
-int callerid_generate(unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, int codec)
+int callerid_generate(unsigned char *buf, const char *number, const char *name, int flags, int callwaiting, format_t codec)
 {
 	int bytes = 0;
 	int x, sum;
@@ -1036,7 +1036,7 @@
 	return 0;
 }
 
-static int __ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int callwaiting, int codec)
+static int __ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int callwaiting, format_t codec)
 {
 	if (ast_strlen_zero(name))
 		name = NULL;
@@ -1045,12 +1045,12 @@
 	return callerid_generate(buf, number, name, 0, callwaiting, codec);
 }
 
-int ast_callerid_generate(unsigned char *buf, const char *name, const char *number, int codec)
+int ast_callerid_generate(unsigned char *buf, const char *name, const char *number, format_t codec)
 {
 	return __ast_callerid_generate(buf, name, number, 0, codec);
 }
 
-int ast_callerid_callwaiting_generate(unsigned char *buf, const char *name, const char *number, int codec)
+int ast_callerid_callwaiting_generate(unsigned char *buf, const char *name, const char *number, format_t codec)
 {
 	return __ast_callerid_generate(buf, name, number, 1, codec);
 }

Modified: trunk/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/rtp_engine.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Tue Dec  1 14:27:37 2009
@@ -1585,7 +1585,7 @@
 	return res;
 }
 
-format_t ast_rtp_instance_available_formats(struct ast_rtp_instance *instance, int to_endpoint, int to_asterisk)
+format_t ast_rtp_instance_available_formats(struct ast_rtp_instance *instance, format_t to_endpoint, format_t to_asterisk)
 {
 	format_t formats;
 

Modified: trunk/res/res_adsi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_adsi.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/res/res_adsi.c (original)
+++ trunk/res/res_adsi.c Tue Dec  1 14:27:37 2009
@@ -67,7 +67,7 @@
 
 static int alignment = 0;
 
-static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, int codec)
+static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, format_t codec)
 {
 	int sum, x, bytes = 0;
 	/* Initial carrier (imaginary) */

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=231850&r1=231849&r2=231850
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Tue Dec  1 14:27:37 2009
@@ -131,8 +131,8 @@
 	unsigned int cycles;            /*!< Shifted count of sequence number cycles */
 	double rxjitter;                /*!< Interarrival jitter at the moment */
 	double rxtransit;               /*!< Relative transit time for previous packet */
-	int lasttxformat;
-	int lastrxformat;
+	format_t lasttxformat;
+	format_t lastrxformat;
 
 	int rtptimeout;			/*!< RTP timeout time (negative or zero means disabled, negative value means temporarily disabled) */
 	int rtpholdtimeout;		/*!< RTP timeout when on hold (negative or zero means disabled, negative value means temporarily disabled). */
@@ -1137,7 +1137,7 @@
 	/* Grab the subclass and look up the payload we are going to use */
 	subclass = frame->subclass.codec;
 	if (frame->frametype == AST_FRAME_VIDEO) {
-		subclass &= ~0x1;
+		subclass &= ~0x1LL;
 	}
 	if ((codec = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance), 1, subclass)) < 0) {
 		ast_log(LOG_WARNING, "Don't know how to send format %s packets with RTP\n", ast_getformatname(frame->subclass.codec));
@@ -1503,7 +1503,7 @@
 	   totally help us out becuase we don't have an engine to keep it going and we are not
 	   guaranteed to have it every 20ms or anything */
 	if (rtpdebug)
-		ast_debug(0, "- RTP 3389 Comfort noise event: Level %d (len = %d)\n", rtp->lastrxformat, len);
+		ast_debug(0, "- RTP 3389 Comfort noise event: Level %" PRId64 " (len = %d)\n", rtp->lastrxformat, len);
 
 	if (ast_test_flag(rtp, FLAG_3389_WARNING)) {
 		struct sockaddr_in remote_address = { 0, };




More information about the asterisk-commits mailing list