mirror of
https://github.com/nextepc/nextepc-oss.git
synced 2025-11-02 12:53:14 +00:00
Fix the bug for multiple Video Call (#535)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
abts_suite *test_bearer(abts_suite *suite);
|
||||
abts_suite *test_session(abts_suite *suite);
|
||||
abts_suite *test_rx(abts_suite *suite);
|
||||
abts_suite *test_video(abts_suite *suite);
|
||||
|
||||
const struct testlist {
|
||||
abts_suite *(*func)(abts_suite *suite);
|
||||
@@ -31,6 +32,7 @@ const struct testlist {
|
||||
{test_bearer},
|
||||
{test_session},
|
||||
{test_rx},
|
||||
{test_video},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ testapp_volte_sources = files('''
|
||||
bearer-test.c
|
||||
session-test.c
|
||||
rx-test.c
|
||||
video-test.c
|
||||
'''.split())
|
||||
|
||||
testapp_volte_exe = executable('volte',
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "ogs-gtp.h"
|
||||
#include "ogs-diameter-rx.h"
|
||||
|
||||
#include "test-common.h"
|
||||
#include "pcscf-fd-path.h"
|
||||
|
||||
#define MAX_NUM_SESSION_STATE 32
|
||||
@@ -66,8 +67,8 @@ static int pcscf_rx_fb_cb(struct msg **msg, struct avp *avp,
|
||||
return ENOTSUP;
|
||||
}
|
||||
|
||||
void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
int qos_type, int flow_presence)
|
||||
void pcscf_rx_send_aar(uint8_t **rx_sid,
|
||||
test_sess_t *sess, int id_type, int qos_type, int flow_type)
|
||||
{
|
||||
int rv;
|
||||
int ret;
|
||||
@@ -80,14 +81,26 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
struct session *session = NULL;
|
||||
int new;
|
||||
|
||||
test_ue_t *test_ue = NULL;
|
||||
char *ipstr = NULL;
|
||||
char *sip_uri = NULL;
|
||||
ogs_paa_t paa;
|
||||
ogs_ipsubnet_t ipsub;
|
||||
|
||||
ogs_assert(sess);
|
||||
test_ue = sess->test_ue;
|
||||
ogs_assert(test_ue);
|
||||
ogs_assert(rx_sid);
|
||||
|
||||
ogs_assert(ip);
|
||||
rv = ogs_ipsubnet(&ipsub, ip, NULL);
|
||||
ogs_assert(sess->ue_ip.ipv4);
|
||||
ipstr = ogs_ipv4_to_string(sess->ue_ip.addr);
|
||||
ogs_assert(ipstr);
|
||||
sip_uri = ogs_msprintf("sip:%s:40491", ipstr);
|
||||
ogs_assert(sip_uri);
|
||||
|
||||
rv = ogs_ipsubnet(&ipsub, ipstr, NULL);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_free(ipstr);
|
||||
|
||||
/* Create the request */
|
||||
ret = fd_msg_new(ogs_diam_rx_cmd_aar, MSGFL_ALLOC_ETEID, &req);
|
||||
@@ -115,7 +128,7 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
} else {
|
||||
/* Create a new session */
|
||||
#define OGS_DIAM_RX_APP_SID_OPT "app_rx"
|
||||
ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_RX_APP_SID_OPT,
|
||||
ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_RX_APP_SID_OPT,
|
||||
CONSTSTRLEN(OGS_DIAM_RX_APP_SID_OPT));
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_sess_get(fd_g_config->cnf_dict, req, &session, NULL);
|
||||
@@ -138,11 +151,11 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
/* Save Session-Id to PGW Session Context */
|
||||
*rx_sid = sess_data->sid;
|
||||
}
|
||||
|
||||
|
||||
/* Set Origin-Host & Origin-Realm */
|
||||
ret = fd_msg_add_origin(req, 0);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
|
||||
/* Set the Destination-Realm AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_destination_realm, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
@@ -162,23 +175,51 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Vendor-Specific-Application-Id AVP */
|
||||
ret = ogs_diam_message_vendor_specific_appid_set(
|
||||
req, OGS_DIAM_RX_APPLICATION_ID);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the AF-Application-Identifier AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_af_application_identifier, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.os.data = (unsigned char *)("IMS Services");
|
||||
val.os.len = strlen("IMS Services");
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Authroization-Lifetime AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_authorization_lifetime, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 7200;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Subscription-Id */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id_type, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
val.i32 = id_type;
|
||||
ret = fd_msg_avp_setvalue(avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
#define OGS_DIAM_RX_APP_IMSI_BCD "001010123456789"
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.os.data = (uint8_t *)OGS_DIAM_RX_APP_IMSI_BCD;
|
||||
val.os.len = strlen(OGS_DIAM_RX_APP_IMSI_BCD);
|
||||
if (id_type == OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI) {
|
||||
val.os.data = (uint8_t *)test_ue->imsi;
|
||||
val.os.len = strlen(test_ue->imsi);
|
||||
} else if (id_type == OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI) {
|
||||
val.os.data = (uint8_t *)sip_uri;
|
||||
val.os.len = strlen(sip_uri);
|
||||
}
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
@@ -187,6 +228,15 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Reservation-Priority AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_reservation_priority, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 0;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
if (ipsub.family == AF_INET) {
|
||||
/* Set Framed-IP-Address */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_framed_ip_address, 0, &avp);
|
||||
@@ -206,7 +256,7 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
memcpy(paa.addr6, ipsub.sub, OGS_IPV6_LEN);
|
||||
paa.pdn_type = 0x03;
|
||||
#define FRAMED_IPV6_PREFIX_LENGTH 128 /* from spec document */
|
||||
paa.len = FRAMED_IPV6_PREFIX_LENGTH;
|
||||
paa.len = FRAMED_IPV6_PREFIX_LENGTH;
|
||||
val.os.data = (uint8_t*)&paa;
|
||||
val.os.len = OGS_PAA_IPV6_LEN;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
@@ -235,8 +285,11 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
if (qos_type == 1) {
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
if (qos_type == 0) {
|
||||
/* Nothing */
|
||||
} else if (qos_type == 1) {
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 96000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
@@ -244,7 +297,8 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 96000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
@@ -268,7 +322,8 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
} else if (qos_type == 2) {
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 96000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
@@ -276,7 +331,8 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 96000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
@@ -284,7 +340,8 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_min_requested_bandwidth_dl, 0, &avpch1);
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_min_requested_bandwidth_dl, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 88000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
@@ -292,16 +349,20 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_min_requested_bandwidth_ul, 0, &avpch1);
|
||||
ret = fd_msg_avp_new(
|
||||
ogs_diam_rx_min_requested_bandwidth_ul, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 88000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
} else {
|
||||
ogs_fatal("Unknown qos-type[%d]", qos_type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
if (flow_presence) {
|
||||
if (flow_type == 1) {
|
||||
/* Set Media-Sub-Component #1 */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_sub_component, 0, &avpch1);
|
||||
|
||||
@@ -381,6 +442,9 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
} else {
|
||||
ogs_fatal("Unknown flow-type[%d]", flow_type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
@@ -388,8 +452,676 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
|
||||
ret = clock_gettime(CLOCK_REALTIME, &sess_data->ts);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Keep a pointer to the session data for debug purpose,
|
||||
|
||||
/* Keep a pointer to the session data for debug purpose,
|
||||
* in real life we would not need it */
|
||||
svg = sess_data;
|
||||
|
||||
/* Store this value in the session */
|
||||
ret = fd_sess_state_store(pcscf_rx_reg, session, &sess_data);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(sess_data == NULL);
|
||||
|
||||
/* Send the request */
|
||||
ret = fd_msg_send(&req, pcscf_rx_aaa_cb, svg);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Increment the counter */
|
||||
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
|
||||
ogs_diam_logger_self()->stats.nb_sent++;
|
||||
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
|
||||
|
||||
/* Free string memory */
|
||||
ogs_free(sip_uri);
|
||||
}
|
||||
|
||||
void pcscf_rx_send_aar2(uint8_t **rx_sid, test_sess_t *sess, int id_type)
|
||||
{
|
||||
int rv;
|
||||
int ret;
|
||||
|
||||
struct msg *req = NULL;
|
||||
struct avp *avp;
|
||||
struct avp *avpch1, *avpch2;
|
||||
union avp_value val;
|
||||
struct sess_state *sess_data = NULL, *svg;
|
||||
struct session *session = NULL;
|
||||
int new;
|
||||
|
||||
test_ue_t *test_ue = NULL;
|
||||
char *ipstr = NULL;
|
||||
char *sip_uri = NULL;
|
||||
ogs_paa_t paa;
|
||||
ogs_ipsubnet_t ipsub;
|
||||
|
||||
ogs_assert(sess);
|
||||
test_ue = sess->test_ue;
|
||||
ogs_assert(test_ue);
|
||||
ogs_assert(rx_sid);
|
||||
|
||||
ogs_assert(sess->ue_ip.ipv4);
|
||||
ipstr = ogs_ipv4_to_string(sess->ue_ip.addr);
|
||||
ogs_assert(ipstr);
|
||||
sip_uri = ogs_msprintf("sip:%s:40491", ipstr);
|
||||
ogs_assert(sip_uri);
|
||||
|
||||
rv = ogs_ipsubnet(&ipsub, ipstr, NULL);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
ogs_free(ipstr);
|
||||
|
||||
/* Create the request */
|
||||
ret = fd_msg_new(ogs_diam_rx_cmd_aar, MSGFL_ALLOC_ETEID, &req);
|
||||
ogs_assert(ret == 0);
|
||||
{
|
||||
struct msg_hdr * h;
|
||||
ret = fd_msg_hdr( req, &h );
|
||||
ogs_assert(ret == 0);
|
||||
h->msg_appl = OGS_DIAM_RX_APPLICATION_ID;
|
||||
}
|
||||
|
||||
/* Find Diameter Rx Session */
|
||||
if (*rx_sid) {
|
||||
/* Retrieve session by Session-Id */
|
||||
size_t sidlen = strlen((char *)*rx_sid);
|
||||
ret = fd_sess_fromsid_msg(*rx_sid, sidlen, &session, &new);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(new == 0);
|
||||
|
||||
/* Add Session-Id to the message */
|
||||
ret = ogs_diam_message_session_id_set(req, *rx_sid, sidlen);
|
||||
ogs_assert(ret == 0);
|
||||
/* Save the session associated with the message */
|
||||
ret = fd_msg_sess_set(req, session);
|
||||
} else {
|
||||
/* Create a new session */
|
||||
#define OGS_DIAM_RX_APP_SID_OPT "app_rx"
|
||||
ret = fd_msg_new_session(req, (os0_t)OGS_DIAM_RX_APP_SID_OPT,
|
||||
CONSTSTRLEN(OGS_DIAM_RX_APP_SID_OPT));
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_sess_get(fd_g_config->cnf_dict, req, &session, NULL);
|
||||
ogs_assert(ret == 0);
|
||||
}
|
||||
|
||||
/* Retrieve session state in this session */
|
||||
ret = fd_sess_state_retrieve(pcscf_rx_reg, session, &sess_data);
|
||||
if (!sess_data) {
|
||||
os0_t sid;
|
||||
size_t sidlen;
|
||||
|
||||
ret = fd_sess_getsid(session, &sid, &sidlen);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Allocate new session state memory */
|
||||
sess_data = new_state(sid);
|
||||
ogs_assert(sess_data);
|
||||
|
||||
/* Save Session-Id to PGW Session Context */
|
||||
*rx_sid = sess_data->sid;
|
||||
}
|
||||
|
||||
/* Set Origin-Host & Origin-Realm */
|
||||
ret = fd_msg_add_origin(req, 0);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Destination-Realm AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_destination_realm, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.os.data = (unsigned char *)(fd_g_config->cnf_diamrlm);
|
||||
val.os.len = strlen(fd_g_config->cnf_diamrlm);
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Auth-Application-Id AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_auth_application_id, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_APPLICATION_ID;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Vendor-Specific-Application-Id AVP */
|
||||
ret = ogs_diam_message_vendor_specific_appid_set(
|
||||
req, OGS_DIAM_RX_APPLICATION_ID);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the AF-Application-Identifier AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_af_application_identifier, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.os.data = (unsigned char *)("IMS Services");
|
||||
val.os.len = strlen("IMS Services");
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Authroization-Lifetime AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_authorization_lifetime, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 7200;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Subscription-Id */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id_type, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = id_type;
|
||||
ret = fd_msg_avp_setvalue(avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_subscription_id_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
if (id_type == OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI) {
|
||||
val.os.data = (uint8_t *)test_ue->imsi;
|
||||
val.os.len = strlen(test_ue->imsi);
|
||||
} else if (id_type == OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI) {
|
||||
val.os.data = (uint8_t *)sip_uri;
|
||||
val.os.len = strlen(sip_uri);
|
||||
}
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Reservation-Priority AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_reservation_priority, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 0;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Media-Component-Description #1 */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_component_description, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_component_number, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 1;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Media-Sub-Component #1 */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_sub_component, 0, &avpch1);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_number, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 1;
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC5 \
|
||||
"permit out 17 from 45.45.0.3 50022 to 45.45.0.5 50026"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC5;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC5);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC6 \
|
||||
"permit in 17 from 45.45.0.5 50026 to 45.45.0.3 50022"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC6;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC6);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC7 \
|
||||
"permit out 17 from 45.45.0.3 50023 to 45.45.0.5 50027"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC7;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC7);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC8 \
|
||||
"permit in 17 from 45.45.0.5 50027 to 45.45.0.3 50023"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC8;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC8);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_usage, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_FLOW_USAGE_NO_INFORMATION;
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_type, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_MEDIA_TYPE_AUDIO;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 41000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 41000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_rs_bandwidth, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 600;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_rr_bandwidth, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 2000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_codec_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_CODEC_DATA1 \
|
||||
"downlink\noffer\nm=audio 50026 RTP/AVP 104 102 96 97\r\n" \
|
||||
"b=AS:41\r\n" \
|
||||
"b=RS:600\r\n" \
|
||||
"b=RR:2000\r\n" \
|
||||
"a=rtpmap:104 AMR-WB/16000/1\r\n" \
|
||||
"a=fmtp:104 mode-change-capability=2;max-red=0\r\n" \
|
||||
"a=rtpmap:102 AMR/8000/1\r\n" \
|
||||
"a=fmtp:102 mode-change-capability=2;max-red=0\r\n" \
|
||||
"a=rtpmap:96 telephone-event/16000\r\n" \
|
||||
"a=fmtp:96 0-15\r\n" \
|
||||
"a=rtpmap:97 telephone-event/8000\r\n" \
|
||||
"a=fmtp:97 0-15\r\n" \
|
||||
"a=curr:qos local none\r\n" \
|
||||
"a=curr:qos remote none\r\n" \
|
||||
"a=des:qos mandatory local sendrecv\r\n" \
|
||||
"a=des:qos optional remote sendrecv\r\n" \
|
||||
"a=sendrecv\r\n" \
|
||||
"a=maxptime:240\r\n" \
|
||||
"a=ptime:20\r\n"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_CODEC_DATA1;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_CODEC_DATA1) + 1;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_codec_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_CODEC_DATA2 \
|
||||
"uplink\nanswer\nm=audio 50022 RTP/AVP 104 96\r\n" \
|
||||
"b=AS:41\r\n" \
|
||||
"b=RS:600\r\n" \
|
||||
"b=RR:2000\r\n" \
|
||||
"a=rtpmap:104 AMR-WB/16000/1\r\n" \
|
||||
"a=fmtp:104 mode-change-capability=2;max-red=0\r\n" \
|
||||
"a=rtpmap:96 telephone-event/16000\r\n" \
|
||||
"a=fmtp:96 0-15\r\n" \
|
||||
"a=curr:qos local none\r\n" \
|
||||
"a=curr:qos remote none\r\n" \
|
||||
"a=des:qos mandatory local sendrecv\r\n" \
|
||||
"a=des:qos mandatory remote sendrecv\r\n" \
|
||||
"a=conf:qos remote sendrecv\r\n" \
|
||||
"a=sendrecv\r\n" \
|
||||
"a=maxptime:240\r\n" \
|
||||
"a=ptime:20\r\n"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_CODEC_DATA2;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_CODEC_DATA2) + 1;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_status, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_FLOW_STATUS_ENABLED;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Media-Component-Description #2 */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_component_description, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_component_number, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 2;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set Media-Sub-Component #1 */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_sub_component, 0, &avpch1);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_number, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 2;
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC9 \
|
||||
"permit out 17 from 45.45.0.3 60010 to 45.45.0.5 60010"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC9;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC9);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC10 \
|
||||
"permit in 17 from 45.45.0.5 60010 to 45.45.0.3 60010"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC10;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC10);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC11 \
|
||||
"permit out 17 from 45.45.0.3 60011 to 45.45.0.5 60011"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC11;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC11);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_description, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_FLOW_DESC12 \
|
||||
"permit in 17 from 45.45.0.5 60011 to 45.45.0.3 60011"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_FLOW_DESC12;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_FLOW_DESC12);
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_usage, 0, &avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_FLOW_USAGE_NO_INFORMATION;
|
||||
ret = fd_msg_avp_setvalue (avpch2, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avpch1, MSG_BRW_LAST_CHILD, avpch2);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_media_type, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_MEDIA_TYPE_VIDEO;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_dl, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 401000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_max_requested_bandwidth_ul, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 401000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_rs_bandwidth, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 600;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_rr_bandwidth, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 2000;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_codec_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_CODEC_DATA3 \
|
||||
"downlink\noffer\nm=video 60010 RTP/AVP 114 113\r\n" \
|
||||
"b=AS:401\r\n" \
|
||||
"b=RS:600\r\n" \
|
||||
"b=RR:2000\r\n" \
|
||||
"a=rtpmap:114 H264/90000\r\n" \
|
||||
"a=fmtp:114 profile-level-id=42C00C;packetization-mode=1;sar-understood=16;sar-supported=1;sprop-parameter-sets=Z0LADNoPCmgG0KE1,aM4G4g==\r\n" \
|
||||
"a=rtpmap:113 H264/90000\r\n" \
|
||||
"a=fmtp:113 profile-level-id=42C00C;packetization-mode=0;sar-understood=16;sar-supported=1;sprop-parameter-sets=Z0LADNoPCmgG0KE1,aM4G4g==\r\n" \
|
||||
"a=curr:qos local none\r\n" \
|
||||
"a=curr:qos remote none\r\n" \
|
||||
"a=des:qos mandatory local sendrecv\r\n" \
|
||||
"a=des:qos optional remote sendrecv\r\n" \
|
||||
"a=rtcp-fb:* nack\r\n" \
|
||||
"a=rtcp-fb:* nack pli\r\n" \
|
||||
"a=rtcp-fb:* ccm fir\r\n" \
|
||||
"a=rtcp-fb:* ccm tmmbr\r\n" \
|
||||
"a=sendrecv\r\n" \
|
||||
"a=tcap:1 RTP/AVPF\r\n" \
|
||||
"a=pcfg:1 t=1\r\n" \
|
||||
"a=extmap:2 urn:3gpp:video-orientation\r\n"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_CODEC_DATA3;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_CODEC_DATA3) + 1;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_codec_data, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
#define TEST_OGS_DIAM_RX_CODEC_DATA4 \
|
||||
"uplink\nanswer\nm=video 60010 RTP/AVPF 114\r\n" \
|
||||
"b=AS:401\r\n" \
|
||||
"b=RS:600\r\n" \
|
||||
"b=RR:2000\r\n" \
|
||||
"a=rtpmap:114 H264/90000\r\n" \
|
||||
"a=fmtp:114 profile-level-id=42C00C;packetization-mode=1;sar-understood=16;sar-supported=1;sprop-parameter-sets=Z0LADNoPCmgG0KE1,aM4G4g==\r\n" \
|
||||
"a=curr:qos local none\r\n" \
|
||||
"a=curr:qos remote none\r\n" \
|
||||
"a=des:qos mandatory local sendrecv\r\n" \
|
||||
"a=des:qos mandatory remote sendrecv\r\n" \
|
||||
"a=conf:qos remote sendrecv\r\n" \
|
||||
"a=rtcp-fb:* nack\r\n" \
|
||||
"a=rtcp-fb:* nack pli\r\n" \
|
||||
"a=rtcp-fb:* ccm fir\r\n" \
|
||||
"a=rtcp-fb:* ccm tmmbr\r\n" \
|
||||
"a=sendrecv\r\n" \
|
||||
"a=extmap:2 urn:3gpp:video-orientation\r\n" \
|
||||
"a=acfg:1 t=1\r\n"
|
||||
val.os.data = (uint8_t *)TEST_OGS_DIAM_RX_CODEC_DATA4;
|
||||
val.os.len = strlen(TEST_OGS_DIAM_RX_CODEC_DATA4) + 1;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_flow_status, 0, &avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_FLOW_STATUS_ENABLED;
|
||||
ret = fd_msg_avp_setvalue (avpch1, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add (avp, MSG_BRW_LAST_CHILD, avpch1);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
if (ipsub.family == AF_INET) {
|
||||
/* Set Framed-IP-Address */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_framed_ip_address, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.os.data = (uint8_t*)ipsub.sub;
|
||||
val.os.len = OGS_IPV4_LEN;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
} else if (ipsub.family == AF_INET6) {
|
||||
/* Set Framed-IPv6-Prefix */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_framed_ipv6_prefix, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
memset(&paa, 0, sizeof(ogs_paa_t));
|
||||
|
||||
memcpy(paa.addr6, ipsub.sub, OGS_IPV6_LEN);
|
||||
paa.pdn_type = 0x03;
|
||||
#define FRAMED_IPV6_PREFIX_LENGTH 128 /* from spec document */
|
||||
paa.len = FRAMED_IPV6_PREFIX_LENGTH;
|
||||
val.os.data = (uint8_t*)&paa;
|
||||
val.os.len = OGS_PAA_IPV6_LEN;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
}
|
||||
|
||||
/* Set the Specific-Action AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_CHARGING_CORRELATION_EXCHANGE;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_INDICATION_OF_LOSS_OF_BEARER;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_INDICATION_OF_RECOVERY_OF_BEARER;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_INDICATION_OF_RELEASE_OF_BEARER;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_INDICATION_OF_ESTABLISHMENT_OF_BEARER;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_IP_CAN_CHANGE;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = fd_msg_avp_new(ogs_diam_rx_specific_action, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = OGS_DIAM_RX_SPECIFIC_ACTION_ACCESS_NETWORK_INFO_REPORT;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Auth-Grace-Period AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_auth_grace_period, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 0;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Set the Session-Timeout AVP */
|
||||
ret = fd_msg_avp_new(ogs_diam_session_timeout, 0, &avp);
|
||||
ogs_assert(ret == 0);
|
||||
val.i32 = 7200;
|
||||
ret = fd_msg_avp_setvalue(avp, &val);
|
||||
ogs_assert(ret == 0);
|
||||
ret = fd_msg_avp_add(req, MSG_BRW_LAST_CHILD, avp);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
ret = clock_gettime(CLOCK_REALTIME, &sess_data->ts);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
/* Keep a pointer to the session data for debug purpose,
|
||||
* in real life we would not need it */
|
||||
svg = sess_data;
|
||||
|
||||
@@ -406,6 +1138,9 @@ void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
ogs_assert(pthread_mutex_lock(&ogs_diam_logger_self()->stats_lock) == 0);
|
||||
ogs_diam_logger_self()->stats.nb_sent++;
|
||||
ogs_assert(pthread_mutex_unlock(&ogs_diam_logger_self()->stats_lock) == 0);
|
||||
|
||||
/* Free string memory */
|
||||
ogs_free(sip_uri);
|
||||
}
|
||||
|
||||
static void pcscf_rx_aaa_cb(void *data, struct msg **msg)
|
||||
@@ -700,12 +1435,12 @@ void pcscf_rx_send_str(uint8_t *rx_sid)
|
||||
/* Keep a pointer to the session data for debug purpose,
|
||||
* in real life we would not need it */
|
||||
svg = sess_data;
|
||||
|
||||
|
||||
/* Store this value in the session */
|
||||
ret = fd_sess_state_store(pcscf_rx_reg, session, &sess_data);
|
||||
ogs_assert(ret == 0);
|
||||
ogs_assert(sess_data == NULL);
|
||||
|
||||
|
||||
/* Send the request */
|
||||
ret = fd_msg_send(&req, pcscf_rx_sta_cb, svg);
|
||||
ogs_assert(ret == 0);
|
||||
|
||||
@@ -24,11 +24,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ogs-diameter-rx.h"
|
||||
|
||||
int pcscf_fd_init(void);
|
||||
void pcscf_fd_final(void);
|
||||
|
||||
void pcscf_rx_send_aar(uint8_t **rx_sid, const char *ip,
|
||||
int qos_type, int flow_presence);
|
||||
void pcscf_rx_send_aar(uint8_t **rx_sid,
|
||||
test_sess_t *sess, int id_type, int qos_type, int flow_type);
|
||||
void pcscf_rx_send_aar2(uint8_t **rx_sid, test_sess_t *sess, int id_type);
|
||||
void pcscf_rx_send_str(uint8_t *rx_sid);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -31,7 +31,6 @@ static void test1_func(abts_case *tc, void *data)
|
||||
ogs_pkbuf_t *recvbuf;
|
||||
ogs_s1ap_message_t message;
|
||||
|
||||
char *ipstr = NULL;
|
||||
uint8_t *rx_sid = NULL;
|
||||
|
||||
ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci;
|
||||
@@ -366,11 +365,8 @@ static void test1_func(abts_case *tc, void *data)
|
||||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/* Send AA-Request */
|
||||
ogs_assert(sess->ue_ip.ipv4);
|
||||
ipstr = ogs_ipv4_to_string(sess->ue_ip.addr);
|
||||
ogs_assert(ipstr);
|
||||
pcscf_rx_send_aar(&rx_sid, ipstr, 1, 1);
|
||||
ogs_free(ipstr);
|
||||
pcscf_rx_send_aar(&rx_sid, sess,
|
||||
OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI, 1, 1);
|
||||
|
||||
/* Receive E-RAB Setup Request +
|
||||
* Activate dedicated EPS bearer context request */
|
||||
@@ -407,7 +403,8 @@ static void test1_func(abts_case *tc, void *data)
|
||||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/* Send AA-Request without Flow */
|
||||
pcscf_rx_send_aar(&rx_sid, ipstr, 2, 1);
|
||||
pcscf_rx_send_aar(&rx_sid, sess,
|
||||
OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI, 2, 1);
|
||||
|
||||
/* Receive E-RAB Modify Request +
|
||||
* Modify EPS bearer context request */
|
||||
@@ -623,7 +620,6 @@ static void test2_func(abts_case *tc, void *data)
|
||||
ogs_pkbuf_t *recvbuf;
|
||||
ogs_s1ap_message_t message;
|
||||
|
||||
char *ipstr = NULL;
|
||||
uint8_t *rx_sid = NULL;
|
||||
|
||||
ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci;
|
||||
@@ -976,11 +972,8 @@ static void test2_func(abts_case *tc, void *data)
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send AA-Request */
|
||||
ogs_assert(sess->ue_ip.ipv4);
|
||||
ipstr = ogs_ipv4_to_string(sess->ue_ip.addr);
|
||||
ogs_assert(ipstr);
|
||||
pcscf_rx_send_aar(&rx_sid, ipstr, 0, 1);
|
||||
ogs_free(ipstr);
|
||||
pcscf_rx_send_aar(&rx_sid, sess,
|
||||
OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI, 0, 1);
|
||||
|
||||
/* Receive downlink NAS transport +
|
||||
* Modify EPS bearer context request */
|
||||
|
||||
1259
tests/volte/video-test.c
Normal file
1259
tests/volte/video-test.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user