use new libosmo-mgcp-client sdp/fmtp.h where possible
Change-Id: I261679118e5fd669fa0f74e3d2220a82ba7d8835
This commit is contained in:
parent
083cc7ddb9
commit
4a9ea4f311
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
#include <osmocom/gsm/mncc.h>
|
#include <osmocom/gsm/mncc.h>
|
||||||
|
|
||||||
|
#include <osmocom/sdp/fmtp.h>
|
||||||
|
#include <osmocom/sdp/sdp_strings.h>
|
||||||
|
|
||||||
#include <osmocom/msc/sdp_msg.h>
|
#include <osmocom/msc/sdp_msg.h>
|
||||||
#include <osmocom/msc/codec_mapping.h>
|
#include <osmocom/msc/codec_mapping.h>
|
||||||
#include <osmocom/msc/mncc.h>
|
#include <osmocom/msc/mncc.h>
|
||||||
|
@ -118,7 +121,7 @@ const struct codec_mapping codec_map[] = {
|
||||||
/* AMR is always octet-aligned in 2G and 3G RAN, so this fmtp is signalled to remote call legs.
|
/* AMR is always octet-aligned in 2G and 3G RAN, so this fmtp is signalled to remote call legs.
|
||||||
* So far, fmtp is ignored in incoming SIP SDP, so an incoming SDP without 'octet-align=1' will
|
* So far, fmtp is ignored in incoming SIP SDP, so an incoming SDP without 'octet-align=1' will
|
||||||
* match with this entry; we will still reply with 'octet-align=1', which often works out. */
|
* match with this entry; we will still reply with 'octet-align=1', which often works out. */
|
||||||
.fmtp = "octet-align=1",
|
.fmtp = OSMO_SDP_VAL_AMR_OCTET_ALIGN_1,
|
||||||
},
|
},
|
||||||
.mgcp = CODEC_AMR_8000_1,
|
.mgcp = CODEC_AMR_8000_1,
|
||||||
.speech_ver_count = 1,
|
.speech_ver_count = 1,
|
||||||
|
@ -139,7 +142,7 @@ const struct codec_mapping codec_map[] = {
|
||||||
.payload_type = 112,
|
.payload_type = 112,
|
||||||
.subtype_name = "AMR",
|
.subtype_name = "AMR",
|
||||||
.rate = 8000,
|
.rate = 8000,
|
||||||
.fmtp = "octet-align=1",
|
.fmtp = OSMO_SDP_VAL_AMR_OCTET_ALIGN_1,
|
||||||
},
|
},
|
||||||
.mgcp = CODEC_AMR_8000_1,
|
.mgcp = CODEC_AMR_8000_1,
|
||||||
.speech_ver_count = 1,
|
.speech_ver_count = 1,
|
||||||
|
@ -159,7 +162,7 @@ const struct codec_mapping codec_map[] = {
|
||||||
.payload_type = 113,
|
.payload_type = 113,
|
||||||
.subtype_name = "AMR-WB",
|
.subtype_name = "AMR-WB",
|
||||||
.rate = 16000,
|
.rate = 16000,
|
||||||
.fmtp = "octet-align=1",
|
.fmtp = OSMO_SDP_STR_AMR_OCTET_ALIGN_1,
|
||||||
},
|
},
|
||||||
.mgcp = CODEC_AMRWB_16000_1,
|
.mgcp = CODEC_AMRWB_16000_1,
|
||||||
.speech_ver_count = 2,
|
.speech_ver_count = 2,
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include <osmocom/core/utils.h>
|
#include <osmocom/core/utils.h>
|
||||||
#include <osmocom/core/logging.h>
|
#include <osmocom/core/logging.h>
|
||||||
|
|
||||||
|
#include <osmocom/mgcp_client/fmtp.h>
|
||||||
|
|
||||||
#include <osmocom/msc/debug.h>
|
#include <osmocom/msc/debug.h>
|
||||||
#include <osmocom/msc/sdp_msg.h>
|
#include <osmocom/msc/sdp_msg.h>
|
||||||
|
|
||||||
|
@ -272,7 +274,7 @@ int sdp_msg_to_sdp_str_buf(char *dst, size_t dst_size, const struct sdp_msg *sdp
|
||||||
OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
|
OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
|
||||||
codec->rate > 0 ? codec->rate : 8000);
|
codec->rate > 0 ? codec->rate : 8000);
|
||||||
if (codec->fmtp[0])
|
if (codec->fmtp[0])
|
||||||
OSMO_STRBUF_PRINTF(sb, "a=fmtp:%d %s\r\n", codec->payload_type, codec->fmtp);
|
OSMO_STRBUF_PRINTF(sb, OSMO_SDP_PREFIX_A_FMTP "%d %s\r\n", codec->payload_type, codec->fmtp);
|
||||||
}
|
}
|
||||||
|
|
||||||
OSMO_STRBUF_PRINTF(sb, "a=ptime:%d\r\n", sdp->ptime > 0? sdp->ptime : 20);
|
OSMO_STRBUF_PRINTF(sb, "a=ptime:%d\r\n", sdp->ptime > 0? sdp->ptime : 20);
|
||||||
|
@ -302,7 +304,6 @@ int sdp_parse_attrib(struct sdp_msg *sdp, const char *src)
|
||||||
unsigned int payload_type;
|
unsigned int payload_type;
|
||||||
struct sdp_audio_codec *codec;
|
struct sdp_audio_codec *codec;
|
||||||
#define A_RTPMAP "rtpmap:"
|
#define A_RTPMAP "rtpmap:"
|
||||||
#define A_FMTP "fmtp:"
|
|
||||||
#define A_PTIME "ptime:"
|
#define A_PTIME "ptime:"
|
||||||
#define A_RTCP "rtcp:"
|
#define A_RTCP "rtcp:"
|
||||||
|
|
||||||
|
@ -328,11 +329,11 @@ int sdp_parse_attrib(struct sdp_msg *sdp, const char *src)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (osmo_str_startswith(src, A_FMTP)) {
|
else if (osmo_str_startswith(src, OSMO_SDP_PREFIX_FMTP)) {
|
||||||
/* "a=fmtp:112 octet-align=1;mode-set=0,1,2,3" */
|
/* "a=fmtp:112 octet-align=1;mode-set=0,1,2,3" */
|
||||||
char *fmtp_str;
|
char *fmtp_str;
|
||||||
const char *line_end = sdp_msg_line_end(src);
|
const char *line_end = sdp_msg_line_end(src);
|
||||||
if (sscanf(src, A_FMTP "%u", &payload_type) != 1)
|
if (sscanf(src, OSMO_SDP_PREFIX_FMTP "%u", &payload_type) != 1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
fmtp_str = strchr(src, ' ');
|
fmtp_str = strchr(src, ' ');
|
||||||
|
|
Loading…
Reference in New Issue