parent
9e63d47df4
commit
757f793a9a
|
@ -47,11 +47,11 @@ struct codec_filter {
|
|||
void codec_filter_set_ran(struct codec_filter *codec_filter, const struct sdp_audio_codecs *codecs);
|
||||
void codec_filter_set_bss(struct codec_filter *codec_filter,
|
||||
const struct gsm0808_speech_codec_list *codec_list_bss_supported);
|
||||
int codec_filter_run(struct codec_filter *codec_filter, struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
int codec_filter_run(struct codec_filter *codec_filter, struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
|
||||
int codec_filter_to_str_buf(char *buf, size_t buflen, const struct codec_filter *codec_filter,
|
||||
const struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
char *codec_filter_to_str_c(void *ctx, const struct codec_filter *codec_filter, const struct sdp_msg *result,
|
||||
const struct sdp_msg *remote);
|
||||
const char *codec_filter_to_str(const struct codec_filter *codec_filter, const struct sdp_msg *result,
|
||||
const struct sdp_msg *remote);
|
||||
const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
char *codec_filter_to_str_c(void *ctx, const struct codec_filter *codec_filter, const struct osmo_sdp_msg *result,
|
||||
const struct osmo_sdp_msg *remote);
|
||||
const char *codec_filter_to_str(const struct codec_filter *codec_filter, const struct osmo_sdp_msg *result,
|
||||
const struct osmo_sdp_msg *remote);
|
||||
|
|
|
@ -45,9 +45,9 @@ struct csd_filter {
|
|||
};
|
||||
|
||||
void csd_filter_set_ran(struct csd_filter *filter, enum osmo_rat_type ran_type);
|
||||
int csd_filter_run(struct csd_filter *filter, struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
int csd_filter_run(struct csd_filter *filter, struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
|
||||
int csd_filter_to_str_buf(char *buf, size_t buflen, const struct csd_filter *filter,
|
||||
const struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
char *csd_filter_to_str_c(void *ctx, const struct csd_filter *filter, const struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
const char *csd_filter_to_str(const struct csd_filter *filter, const struct sdp_msg *result, const struct sdp_msg *remote);
|
||||
const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
char *csd_filter_to_str_c(void *ctx, const struct csd_filter *filter, const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
const char *csd_filter_to_str(const struct csd_filter *filter, const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote);
|
||||
|
|
|
@ -73,7 +73,7 @@ void rtp_stream_set_one_codec(struct rtp_stream *rtps, const struct sdp_audio_co
|
|||
void rtp_stream_set_codecs(struct rtp_stream *rtps, const struct sdp_audio_codecs *codecs);
|
||||
void rtp_stream_set_mode(struct rtp_stream *rtps, enum mgcp_connection_mode mode);
|
||||
void rtp_stream_set_remote_addr(struct rtp_stream *rtps, const struct osmo_sockaddr_str *r);
|
||||
void rtp_stream_set_remote_addr_and_codecs(struct rtp_stream *rtps, const struct sdp_msg *sdp);
|
||||
void rtp_stream_set_remote_addr_and_codecs(struct rtp_stream *rtps, const struct osmo_sdp_msg *sdp);
|
||||
void rtp_stream_set_remote_osmux_cid(struct rtp_stream *rtps, uint8_t osmux_cid);
|
||||
int rtp_stream_commit(struct rtp_stream *rtps);
|
||||
|
||||
|
|
|
@ -131,13 +131,13 @@ struct gsm_trans {
|
|||
bool mncc_initiated; /* Whether an MNCC Release is necessary on failure */
|
||||
struct osmo_lcls *lcls;
|
||||
/* SDP as last received from the remote call leg. */
|
||||
struct sdp_msg remote;
|
||||
struct osmo_sdp_msg remote;
|
||||
/* Track codec/CSD choices from BSS and remote call leg */
|
||||
struct codec_filter codecs;
|
||||
struct csd_filter csd;
|
||||
/* Resulting choice from codecs/bearer services and the
|
||||
* local RTP address to be sent to the remote call leg. */
|
||||
struct sdp_msg local;
|
||||
struct osmo_sdp_msg local;
|
||||
} cc;
|
||||
struct {
|
||||
struct gsm411_smc_inst smc_inst;
|
||||
|
|
|
@ -47,7 +47,7 @@ void codec_filter_set_bss(struct codec_filter *codec_filter,
|
|||
|
||||
/* Render intersections of all known audio codec constraints to reach a resulting choice of favorite audio codec, plus
|
||||
* possible set of alternative audio codecs, in codec_filter->result. (The result.rtp address remains unchanged.) */
|
||||
int codec_filter_run(struct codec_filter *codec_filter, struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
int codec_filter_run(struct codec_filter *codec_filter, struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
struct sdp_audio_codecs *r = &result->audio_codecs;
|
||||
struct sdp_audio_codec *a = &codec_filter->assignment;
|
||||
|
@ -76,7 +76,7 @@ int codec_filter_run(struct codec_filter *codec_filter, struct sdp_msg *result,
|
|||
}
|
||||
|
||||
int codec_filter_to_str_buf(char *buf, size_t buflen, const struct codec_filter *codec_filter,
|
||||
const struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
struct osmo_strbuf sb = { .buf = buf, .len = buflen };
|
||||
OSMO_STRBUF_APPEND(sb, sdp_msg_to_str_buf, result);
|
||||
|
@ -114,14 +114,14 @@ int codec_filter_to_str_buf(char *buf, size_t buflen, const struct codec_filter
|
|||
return sb.chars_needed;
|
||||
}
|
||||
|
||||
char *codec_filter_to_str_c(void *ctx, const struct codec_filter *codec_filter, const struct sdp_msg *result,
|
||||
const struct sdp_msg *remote)
|
||||
char *codec_filter_to_str_c(void *ctx, const struct codec_filter *codec_filter, const struct osmo_sdp_msg *result,
|
||||
const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
OSMO_NAME_C_IMPL(ctx, 128, "codec_filter_to_str_c-ERROR", codec_filter_to_str_buf, codec_filter, result, remote)
|
||||
}
|
||||
|
||||
const char *codec_filter_to_str(const struct codec_filter *codec_filter, const struct sdp_msg *result,
|
||||
const struct sdp_msg *remote)
|
||||
const char *codec_filter_to_str(const struct codec_filter *codec_filter, const struct osmo_sdp_msg *result,
|
||||
const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
return codec_filter_to_str_c(OTC_SELECT, codec_filter, result, remote);
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ void csd_filter_set_ran(struct csd_filter *filter, enum osmo_rat_type ran_type)
|
|||
}
|
||||
}
|
||||
|
||||
int csd_filter_run(struct csd_filter *filter, struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
int csd_filter_run(struct csd_filter *filter, struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
struct csd_bs_list *r = &result->bearer_services;
|
||||
enum csd_bs a = filter->assignment;
|
||||
|
@ -109,7 +109,7 @@ int csd_filter_run(struct csd_filter *filter, struct sdp_msg *result, const stru
|
|||
|
||||
|
||||
int csd_filter_to_str_buf(char *buf, size_t buflen, const struct csd_filter *filter,
|
||||
const struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
struct osmo_strbuf sb = { .buf = buf, .len = buflen };
|
||||
OSMO_STRBUF_APPEND(sb, sdp_msg_to_str_buf, result);
|
||||
|
@ -146,12 +146,12 @@ int csd_filter_to_str_buf(char *buf, size_t buflen, const struct csd_filter *fil
|
|||
return sb.chars_needed;
|
||||
}
|
||||
|
||||
char *csd_filter_to_str_c(void *ctx, const struct csd_filter *filter, const struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
char *csd_filter_to_str_c(void *ctx, const struct csd_filter *filter, const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
OSMO_NAME_C_IMPL(ctx, 128, "csd_filter_to_str_c-ERROR", csd_filter_to_str_buf, filter, result, remote)
|
||||
}
|
||||
|
||||
const char *csd_filter_to_str(const struct csd_filter *filter, const struct sdp_msg *result, const struct sdp_msg *remote)
|
||||
const char *csd_filter_to_str(const struct csd_filter *filter, const struct osmo_sdp_msg *result, const struct osmo_sdp_msg *remote)
|
||||
{
|
||||
return csd_filter_to_str_c(OTC_SELECT, filter, result, remote);
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ static void _log_mncc_rx_tx(const char *file, int line,
|
|||
struct gsm_trans *trans, const char *rx_tx, const union mncc_msg *mncc)
|
||||
{
|
||||
const char *sdp = NULL;
|
||||
struct sdp_msg sdp_msg = {};
|
||||
struct osmo_sdp_msg sdp_msg = {};
|
||||
struct osmo_sockaddr addr = {};
|
||||
|
||||
if (!log_check_level(DMNCC, LOGL_DEBUG))
|
||||
|
@ -723,7 +723,7 @@ void gsm48_cc_rx_setup_cn_local_rtp_port_known(struct gsm_trans *trans)
|
|||
struct msc_a *msc_a = trans->msc_a;
|
||||
struct gsm_mncc setup = trans->cc.msg;
|
||||
struct osmo_sockaddr_str *rtp_cn_local;
|
||||
struct sdp_msg *sdp;
|
||||
struct osmo_sdp_msg *sdp;
|
||||
int rc;
|
||||
|
||||
if (trans->cc.state != GSM_CSTATE_INITIATED
|
||||
|
@ -797,7 +797,7 @@ static void rx_mncc_sdp(struct gsm_trans *trans, uint32_t mncc_msg_type, const c
|
|||
|
||||
/* if there is no SDP information or we failed to parse it, try using the Bearer Cap from MNCC, if any. */
|
||||
if (!trans->cc.remote.audio_codecs.count && bcap) {
|
||||
trans->cc.remote = (struct sdp_msg){};
|
||||
trans->cc.remote = (struct osmo_sdp_msg){};
|
||||
trans_cc_set_remote_from_bc(trans, bcap);
|
||||
LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s Bearer Cap: remote=%s\n",
|
||||
get_mncc_name(mncc_msg_type), sdp_msg_to_str(&trans->cc.remote));
|
||||
|
@ -908,7 +908,7 @@ static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg)
|
|||
case GSM48_BCAP_ITCAP_FAX_G3:
|
||||
case GSM48_BCAP_ITCAP_UNR_DIG_INF:
|
||||
if (setup->fields & MNCC_F_BEARER_CAP) {
|
||||
trans->cc.remote = (struct sdp_msg){};
|
||||
trans->cc.remote = (struct osmo_sdp_msg){};
|
||||
trans_cc_set_remote_from_bc(trans, &setup->bearer_cap);
|
||||
LOG_TRANS_CAT(trans, DMNCC, LOGL_DEBUG, "rx %s Bearer Cap: remote=%s\n",
|
||||
get_mncc_name(setup->msg_type), sdp_msg_to_str(&trans->cc.remote));
|
||||
|
@ -1087,7 +1087,7 @@ static int gsm48_cc_rx_call_conf(struct gsm_trans *trans, struct msgb *msg)
|
|||
|
||||
static int mncc_recv_rtp(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref,
|
||||
int cmd, struct osmo_sockaddr_str *rtp_addr, uint32_t payload_type,
|
||||
uint32_t payload_msg_type, const struct sdp_msg *sdp);
|
||||
uint32_t payload_msg_type, const struct osmo_sdp_msg *sdp);
|
||||
|
||||
static int gsm48_cc_mt_rtp_port_and_codec_known(struct gsm_trans *trans)
|
||||
{
|
||||
|
@ -2042,7 +2042,7 @@ static int gsm48_cc_rx_userinfo(struct gsm_trans *trans, struct msgb *msg)
|
|||
|
||||
static int mncc_recv_rtp(struct gsm_network *net, struct gsm_trans *trans, uint32_t callref,
|
||||
int cmd, struct osmo_sockaddr_str *rtp_addr, uint32_t payload_type,
|
||||
uint32_t payload_msg_type, const struct sdp_msg *sdp)
|
||||
uint32_t payload_msg_type, const struct osmo_sdp_msg *sdp)
|
||||
{
|
||||
uint8_t data[sizeof(struct gsm_mncc)];
|
||||
struct gsm_mncc_rtp *rtp;
|
||||
|
|
|
@ -478,7 +478,7 @@ void rtp_stream_set_remote_addr(struct rtp_stream *rtps, const struct osmo_socka
|
|||
rtp_stream_update_id(rtps);
|
||||
}
|
||||
|
||||
void rtp_stream_set_remote_addr_and_codecs(struct rtp_stream *rtps, const struct sdp_msg *sdp)
|
||||
void rtp_stream_set_remote_addr_and_codecs(struct rtp_stream *rtps, const struct osmo_sdp_msg *sdp)
|
||||
{
|
||||
rtp_stream_set_codecs(rtps, &sdp->audio_codecs);
|
||||
if (osmo_sockaddr_str_is_nonzero(&sdp->rtp))
|
||||
|
|
|
@ -1329,7 +1329,7 @@ static bool validate_sdp(const char *func, const char *desc,
|
|||
{
|
||||
const char * const *expect_pos;
|
||||
struct sdp_audio_codec *codec;
|
||||
struct sdp_msg sdp;
|
||||
struct osmo_sdp_msg sdp;
|
||||
if (sdp_msg_from_sdp_str(&sdp, sdp_str)) {
|
||||
BTW("%s: %s: ERROR: failed to parse SDP\n%s", func, desc, sdp_str);
|
||||
return false;
|
||||
|
@ -1427,10 +1427,10 @@ static bool validate_perm_speech(const char *func, const char *desc,
|
|||
|
||||
/* Compose a valid SDP string from the list of codec subtype names given. If a subtype name includes a payload type
|
||||
* number ("AMR#96") then use that PT number in the SDP instead of the default from codec_mapping.c. */
|
||||
static struct sdp_msg *sdp_from_codec_strs(const char *const *codec_strs)
|
||||
static struct osmo_sdp_msg *sdp_from_codec_strs(const char *const *codec_strs)
|
||||
{
|
||||
static struct sdp_msg sdp;
|
||||
sdp = (struct sdp_msg){};
|
||||
static struct osmo_sdp_msg sdp;
|
||||
sdp = (struct osmo_sdp_msg){};
|
||||
const char *const *codec_str;
|
||||
osmo_sockaddr_str_from_str(&sdp.rtp, "1.2.3.4", 56);
|
||||
for (codec_str = codec_strs; *codec_str; codec_str++) {
|
||||
|
|
|
@ -131,7 +131,7 @@ void test_parse_and_compose()
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(sdp_tests); i++) {
|
||||
struct sdp_test_data *t = &sdp_tests[i];
|
||||
struct sdp_msg sdp = {};
|
||||
struct osmo_sdp_msg sdp = {};
|
||||
char str[1024];
|
||||
printf("\n[%d]\n", i);
|
||||
dump_sdp(t->sdp_input, "sdp input: ");
|
||||
|
@ -343,7 +343,7 @@ struct sdp_intersect_test_data sdp_intersect_tests[] = {
|
|||
}
|
||||
};
|
||||
|
||||
const char *sdp_msg_logstr(const struct sdp_msg *sdp)
|
||||
const char *sdp_msg_logstr(const struct osmo_sdp_msg *sdp)
|
||||
{
|
||||
static char buf[1024];
|
||||
sdp_msg_to_sdp_str_buf(buf, sizeof(buf), sdp);
|
||||
|
@ -360,8 +360,8 @@ static void test_intersect()
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(sdp_intersect_tests); i++) {
|
||||
struct sdp_intersect_test_data *t = &sdp_intersect_tests[i];
|
||||
struct sdp_msg sdp_a = {};
|
||||
struct sdp_msg sdp_b = {};
|
||||
struct osmo_sdp_msg sdp_a = {};
|
||||
struct osmo_sdp_msg sdp_b = {};
|
||||
char str[1024];
|
||||
printf("\n[%d] %s\n", i, t->descr);
|
||||
dump_sdp(t->sdp_a, "SDP A: ");
|
||||
|
@ -523,7 +523,7 @@ static void test_select()
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(sdp_select_tests); i++) {
|
||||
struct sdp_select_test_data *t = &sdp_select_tests[i];
|
||||
struct sdp_msg sdp = {};
|
||||
struct osmo_sdp_msg sdp = {};
|
||||
struct sdp_audio_codec *codec;
|
||||
char buf[1024];
|
||||
const char *expect_sdp;
|
||||
|
|
Loading…
Reference in New Issue