Commit 4b89c7a2 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Added soa_get_local_version() and soa_get_remote_version(), ssd_version.

darcs-hash:20050923143710-65a35-1ffa98107d05bc4ebf3e3d4d4ff31ef318c34b9d.gz
parent ebc9404a
2005-09-22 Kai Vehmanen <kai.vehmanen@nokia.com>
* soa.c (soa_get_remote_version): Added.
* soa.c (soa_get_local_version): Added.
* soa_session.h: Added ssd_version field to
soa_description struct.
2005-09-19 Kai Vehmanen <kai.vehmanen@nokia.com>
* soa_static.c: Fix generating offers.
......
......@@ -714,6 +714,17 @@ int soa_get_local_sdp(soa_session_t const *ss,
return 1;
}
/**
* Returns the version number of local session
* description. The version numbering starts from
* zero and is incremented for each modification.
*/
int soa_get_local_version(soa_session_t const *ss)
{
assert(ss != NULL);
return ss->ss_local->ssd_version;
}
int soa_set_local_sdp(soa_session_t *ss,
char const *str, int len)
{
......@@ -755,6 +766,16 @@ int soa_get_remote_sdp(soa_session_t const *ss,
return 1;
}
/**
* Returns the version number of remote session
* description. The version numbering starts from
* zero and is incremented for each modification.
*/
int soa_get_remote_version(soa_session_t const *ss)
{
assert(ss != NULL);
return ss->ss_remote->ssd_version;
}
int soa_set_remote_sdp(soa_session_t *ss,
char const *str, int len)
......@@ -1238,7 +1259,15 @@ void soa_set_activity(soa_session_t *ss,
/* API functions */
/** Parse and store session description */
/**
* Parses and stores session description
*
* @param ss instance pointer
* @param what caps, local or remote
* @param sdp0 new sdp (parsed)
* @param sdp_str new sdp (unparsed)
* @param str_len length on unparsed data
**/
static
int soa_set_sdp(soa_session_t *ss,
enum soa_sdp_kind what,
......@@ -1285,12 +1314,16 @@ int soa_set_sdp(soa_session_t *ss,
sdp, sdp_str, str_len);
}
return 0;
} else {
++ssd->ssd_version;
}
if (sdp0) {
/* note: case 1 - src in parsed form */
*sdp = *sdp0;
}
else /* if (sdp_str) */ {
/* note: case 2 - src in unparsed form */
parser = sdp_parse(ss->ss_home, sdp_str, str_len, flags);
if (sdp_parsing_error(parser)) {
......@@ -1370,6 +1403,7 @@ int soa_description_dup(su_home_t *home,
if (ssd0->ssd_sdp) {
int len = ssd0->ssd_str ? strlen(ssd0->ssd_str) + 1 : 0;
ssd->ssd_version = ssd0->ssd_version;
ssd->ssd_sdp = sdp_session_dup(home, ssd0->ssd_sdp);
ssd->ssd_printer = sdp_print(home, ssd->ssd_sdp, NULL, len, 0);
ssd->ssd_str = (char *)sdp_message(ssd->ssd_printer);
......@@ -1505,6 +1539,8 @@ int soa_base_set_local_sdp(soa_session_t *ss,
sdp->sdp_connection = c;
}
++ss->ss_local->ssd_version;
return soa_description_set(ss, ss->ss_local, sdp, str0, len0);
}
......
......@@ -80,6 +80,9 @@ int soa_get_remote_sdp(soa_session_t const *ss,
char const **return_sdp,
int *return_len);
int soa_get_remote_version(soa_session_t const *ss);
int soa_clear_remote_sdp(soa_session_t *ss);
int soa_set_local_sdp(soa_session_t *ss,
......@@ -89,6 +92,8 @@ int soa_get_local_sdp(soa_session_t const *ss,
char const **return_sdp,
int *return_len);
int soa_get_local_version(soa_session_t const *ss);
char const * const * soa_sip_required(soa_session_t const *ss);
char const * const * soa_sip_support(soa_session_t const *ss);
......
......@@ -113,6 +113,7 @@ int soa_default_process_answer(soa_session_t *ss,
struct soa_description
{
int ssd_version; /**< Version incremented at each change */
sdp_session_t *ssd_sdp; /**< Session description */
char const *ssd_unparsed; /**< Original session description as string */
char const *ssd_str; /**< Session description as string */
......
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