Commit ea29079f authored by Pekka Pessi's avatar Pekka Pessi

Using sdp tags to pass session descriptions.

darcs-hash:20050929111858-65a35-9991710cb75833aa31dae289945081cd8297a51b.gz
parent 65b28d85
......@@ -350,7 +350,7 @@ int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
int af;
sdp_session_t *caps_sdp, *user_sdp;
sdp_session_t const *caps_sdp, *user_sdp;
char const *caps_sdp_str, *user_sdp_str;
char const *media_address, *hold;
......
......@@ -41,6 +41,7 @@ const char soa_tag_c_id[] =
#include <soa.h>
#include <su_tag_class.h>
#include <sdp_tag.h>
/**@def SOATAG_CAPS_SDP(x)
* Pass parsed capability description to soa session object.
......@@ -58,7 +59,7 @@ const char soa_tag_c_id[] =
*
* Corresponding tag taking reference parameter is SOATAG_CAPS_SDP_REF()
*/
tag_typedef_t soatag_caps_sdp = PTRTAG_TYPEDEF(caps_sdp);
tag_typedef_t soatag_caps_sdp = SDPTAG_TYPEDEF(caps_sdp);
/**@def SOATAG_CAPS_SDP_STR(x)
* Pass capability description to soa session object.
......@@ -95,7 +96,7 @@ tag_typedef_t soatag_caps_sdp_str = STRTAG_TYPEDEF(caps_sdp_str);
*
* Corresponding tag taking reference parameter is SOATAG_LOCAL_SDP_REF()
*/
tag_typedef_t soatag_local_sdp = PTRTAG_TYPEDEF(local_sdp);
tag_typedef_t soatag_local_sdp = SDPTAG_TYPEDEF(local_sdp);
/**@def SOATAG_LOCAL_SDP_STR(x)
* Get local session description as a string from soa session object.
......@@ -127,7 +128,7 @@ tag_typedef_t soatag_local_sdp_str = STRTAG_TYPEDEF(local_sdp_str);
*
* Corresponding tag taking reference parameter is SOATAG_REMOTE_SDP_REF()
*/
tag_typedef_t soatag_remote_sdp = PTRTAG_TYPEDEF(remote_sdp);
tag_typedef_t soatag_remote_sdp = SDPTAG_TYPEDEF(remote_sdp);
/**@def SOATAG_REMOTE_SDP_STR(x)
* Pass media description file name to the NUA stack.
......@@ -164,7 +165,7 @@ tag_typedef_t soatag_remote_sdp_str = STRTAG_TYPEDEF(remote_sdp_str);
*
* Corresponding tag taking reference parameter is SOATAG_USER_SDP_REF()
*/
tag_typedef_t soatag_user_sdp = PTRTAG_TYPEDEF(user_sdp);
tag_typedef_t soatag_user_sdp = SDPTAG_TYPEDEF(user_sdp);
/**@def SOATAG_USER_SDP_STR(x)
* Pass media description file name to the NUA stack.
......@@ -187,8 +188,6 @@ tag_typedef_t soatag_user_sdp = PTRTAG_TYPEDEF(user_sdp);
*/
tag_typedef_t soatag_user_sdp_str = STRTAG_TYPEDEF(user_sdp_str);
/**@def SOATAG_AF(x)
*
* Preferred address family for media.
......
......@@ -35,6 +35,9 @@
#ifndef SU_TAG_H
#include <su_tag.h>
#endif
#ifndef SDP_TAG_H
#include <sdp_tag.h>
#endif
/**
* Media states
......@@ -53,10 +56,10 @@ enum {
* soa_get_params() or soa_get_paramlist()
*/
#define SOATAG_LOCAL_SDP(x) soatag_local_sdp, tag_ptr_v(x)
#define SOATAG_LOCAL_SDP(x) soatag_local_sdp, sdptag_session_v(x)
extern tag_typedef_t soatag_local_sdp;
#define SOATAG_LOCAL_SDP_REF(x) \
soatag_local_sdp_ref, tag_ptr_vr(&(x), (x))
soatag_local_sdp_ref, sdptag_session_vr(&(x))
extern tag_typedef_t soatag_local_sdp_ref;
#define SOATAG_LOCAL_SDP_STR(x) soatag_local_sdp_str, tag_str_v(x)
......@@ -65,10 +68,10 @@ extern tag_typedef_t soatag_local_sdp_str;
soatag_local_sdp_str_ref, tag_str_vr(&(x))
extern tag_typedef_t soatag_local_sdp_str_ref;
#define SOATAG_USER_SDP(x) soatag_user_sdp, tag_ptr_v(x)
#define SOATAG_USER_SDP(x) soatag_user_sdp, sdptag_session_v(x)
extern tag_typedef_t soatag_user_sdp;
#define SOATAG_USER_SDP_REF(x) \
soatag_user_sdp_ref, tag_ptr_vr(&(x), (x))
soatag_user_sdp_ref, sdptag_session_vr(&(x))
extern tag_typedef_t soatag_user_sdp_ref;
#define SOATAG_USER_SDP_STR(x) soatag_user_sdp_str, tag_str_v(x)
......@@ -77,10 +80,10 @@ extern tag_typedef_t soatag_user_sdp_str;
soatag_user_sdp_str_ref, tag_str_vr(&(x))
extern tag_typedef_t soatag_user_sdp_str_ref;
#define SOATAG_CAPS_SDP(x) soatag_caps_sdp, tag_ptr_v(x)
#define SOATAG_CAPS_SDP(x) soatag_caps_sdp, sdptag_session_v(x)
extern tag_typedef_t soatag_caps_sdp;
#define SOATAG_CAPS_SDP_REF(x) \
soatag_caps_sdp_ref, tag_ptr_vr(&(x), (x))
soatag_caps_sdp_ref, sdptag_session_vr(&(x))
extern tag_typedef_t soatag_caps_sdp_ref;
#define SOATAG_CAPS_SDP_STR(x) soatag_caps_sdp_str, tag_str_v(x)
......@@ -89,10 +92,10 @@ extern tag_typedef_t soatag_caps_sdp_str;
soatag_caps_sdp_str_ref, tag_str_vr(&(x))
extern tag_typedef_t soatag_caps_sdp_str_ref;
#define SOATAG_REMOTE_SDP(x) soatag_remote_sdp, tag_ptr_v(x)
#define SOATAG_REMOTE_SDP(x) soatag_remote_sdp, sdptag_session_v(x)
extern tag_typedef_t soatag_remote_sdp;
#define SOATAG_REMOTE_SDP_REF(x) \
soatag_remote_sdp_ref, tag_ptr_vr(&(x), (x))
soatag_remote_sdp_ref, sdptag_session_vr(&(x))
extern tag_typedef_t soatag_remote_sdp_ref;
#define SOATAG_REMOTE_SDP_STR(x) soatag_remote_sdp_str, tag_str_v(x)
......@@ -101,16 +104,16 @@ extern tag_typedef_t soatag_remote_sdp_str;
soatag_remote_sdp_str_ref, tag_str_vr(&(x))
extern tag_typedef_t soatag_remote_sdp_str_ref;
#define SOATAG_SESSION_SDP(x) soatag_session_sdp, tag_ptr_v(x)
extern tag_typedef_t soatag_session_sdp;
#define SOATAG_SESSION_SDP_REF(x) \
soatag_session_sdp_ref, tag_ptr_vr(&(x), (x))
extern tag_typedef_t soatag_session_sdp_ref;
#define SOATAG_LOCAL_SDP(x) soatag_local_sdp, sdptag_session_v(x)
extern tag_typedef_t soatag_local_sdp;
#define SOATAG_LOCAL_SDP_REF(x) \
soatag_local_sdp_ref, sdptag_session_vr(&(x))
extern tag_typedef_t soatag_local_sdp_ref;
#define SOATAG_SESSION_SDP_STR(x) soatag_session_sdp_str, tag_str_v(x)
extern tag_typedef_t soatag_session_sdp_str;
#define SOATAG_SESSION_SDP_STR_REF(x) \
soatag_session_sdp_str_ref, tag_str_vr(&(x))
#define SOATAG_LOCAL_SDP_STR(x) soatag_local_sdp_str, tag_str_v(x)
extern tag_typedef_t soatag_local_sdp_str;
#define SOATAG_LOCAL_SDP_STR_REF(x) \
soatag_local_sdp_str_ref, tag_str_vr(&(x))
extern tag_typedef_t soatag_session_sdp_str_ref;
#define SOATAG_AF(x) soatag_af, tag_uint_v((x))
......
......@@ -54,6 +54,8 @@ struct context;
#include "soa_tag.h"
#include "soa_add.h"
#include <sdp.h>
#include <su_log.h>
extern su_log_t soa_log[];
......@@ -371,6 +373,24 @@ int test_static_offer_answer(struct context *ctx)
TEST_1(SOA_ACTIVE_SENDRECV == soa_is_remote_audio_active(a));
TEST_1(SOA_ACTIVE_REJECTED == soa_is_video_active(a));
{
/* Test tags */
sdp_session_t const *l = NULL, *u = NULL, *r = NULL;
sdp_media_t const *m;
TEST(soa_get_params(b,
SOATAG_LOCAL_SDP_REF(l),
SOATAG_USER_SDP_REF(u),
SOATAG_REMOTE_SDP_REF(r),
TAG_END()), 3);
TEST_1(l); TEST_1(u); TEST_1(r);
TEST_1(m = l->sdp_media); TEST(m->m_type, sdp_media_audio);
TEST_1(!m->m_rejected);
TEST_1(m = m->m_next); TEST(m->m_type, sdp_media_video);
TEST_1(m->m_rejected);
}
/* 'B' will now propose adding video. */
/* 'A' will accept. */
TEST(soa_set_params(b,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment