From f4d89e410ae1f1df4247b72ed19a97222113e8e7 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 1 Dec 2009 20:27:37 +0000 Subject: 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: http://svn.digium.com/svn/asterisk/trunk@231850 f38db490-d61c-443f-a65b-d21fe96a405b --- addons/chan_ooh323.c | 11 ++++++----- addons/chan_ooh323.h | 4 ++-- addons/ooh323cDriver.c | 6 +++--- addons/ooh323cDriver.h | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) (limited to 'addons') diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index a23eafb80..5fa3ae566 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -169,9 +169,9 @@ static struct ooh323_pvt { 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_update_capPrefsOrderForCall } -int ooh323_convertAsteriskCapToH323Cap(int cap) +int ooh323_convertAsteriskCapToH323Cap(format_t cap) { char formats[FORMAT_STRING_SIZE]; switch (cap) { @@ -3744,7 +3744,8 @@ int configure_local_rtp(struct ooh323_pvt *p, ooCallData *call) { struct sockaddr_in us; ooMediaInfo mediaInfo; - int x, format = 0; + int x; + format_t format = 0; if (gH323Debug) ast_verbose("--- configure_local_rtp\n"); diff --git a/addons/chan_ooh323.h b/addons/chan_ooh323.h index 5d0312910..79d0e248e 100644 --- a/addons/chan_ooh323.h +++ b/addons/chan_ooh323.h @@ -60,7 +60,7 @@ #include #include #include - +#include #include #include "ootypes.h" @@ -104,7 +104,7 @@ void ooh323_set_read_format(ooCallData *call, int fmt); 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); diff --git a/addons/ooh323cDriver.c b/addons/ooh323cDriver.c index 170132690..e912f1f16 100644 --- a/addons/ooh323cDriver.c +++ b/addons/ooh323cDriver.c @@ -594,7 +594,7 @@ int ooh323c_set_aliases(ooAliases * aliases) 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_receive_channel(ooCallData *call, ooLogicalChannel *pChannel) 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 @@ int ooh323c_stop_transmit_datachannel(ooCallData *call, ooLogicalChannel *pChann return 1; } -int convertH323CapToAsteriskCap(int cap) +format_t convertH323CapToAsteriskCap(int cap) { switch(cap) diff --git a/addons/ooh323cDriver.h b/addons/ooh323cDriver.h index 96640c205..d29520646 100644 --- a/addons/ooh323cDriver.h +++ b/addons/ooh323cDriver.h @@ -22,6 +22,7 @@ #include "ooCalls.h" #include "ooCapability.h" #include "ooStackCmds.h" +#include #define H323_DTMF_RFC2833 (1 << 0) #define H323_DTMF_Q931 (1 << 1) #define H323_DTMF_H245ALPHANUMERIC (1 << 2) @@ -37,7 +38,7 @@ int ooh323c_start_call_thread(ooCallData *call); 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); -- cgit v1.2.3