Wed Jan 23 10:07:30 EST 2008 Pekka Pessi <Pekka.Pessi@nokia.com>

* soa_static.c: fixed signedness error
Shall I unpull this patch? (8/128)  [ynWvpxqadjk], or ? for help: y

Tue Jan 22 11:35:44 EST 2008  Pekka.Pessi@nokia.com
  * test_soa.c: testing hold with inactive, offered mode and setting remote activity flags while in hold
Shall I unpull this patch? (15/128)  [ynWvpxqadjk], or ? for help: y

Mon Jan 21 14:08:08 EST 2008  Pekka.Pessi@nokia.com
  * soa_static.c: soa_sdp_mode_set() now includes wanted media state in offer

  The wanted media state is based on original user SDP and SOATAG_HOLD()
  content. Removed soa_sdp_mode_set_is_needed(), using dry-run parameter
  instead.

Shall I unpull this patch? (20/128)  [ynWvpxqadjk], or ? for help: y

Thu Jan 17 11:40:46 EST 2008  Pekka Pessi <Pekka.Pessi@nokia.com>
  * soa_static.c: cleaned inactive hold, added tests
Shall I unpull this patch? (31/128)  [ynWvpxqadjk], or ? for help: y

Fri Jan 11 09:15:18 EST 2008  Pekka.Pessi@nokia.com
  * soa_tag.c: documented SOATAG_HOLD() inactive mode
Shall I unpull this patch? (46/128)  [ynWvpxqadjk], or ? for help: y

Fri Jan 11 09:12:01 EST 2008  Bernhard Suttner <suttner at comdasys.com>
  * Using # in SOATAG_HOLD to set media as inactive instead of sendonly
Shall I unpull this patch? (47/128)  [ynWvpxqadjk], or ? for help: y

revert a few more patches from sofia-sip darcs





git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7361 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2008-01-25 19:57:46 +00:00
1 parent dd3fb97612
commit d3e6109b34
4 files changed
+64 -130

No files matched your search

+55 -64
View File
@@ -974,28 +974,58 @@ int soa_sdp_reject(su_home_t *home,
return 0;
}
/** Update mode within session.
*
* @sa soatag_hold
*
* @retval 1 if session was changed (or to be changed, if @a dryrun is nonzero)
*/
/** Check if @a session mode should be changed. */
static
int soa_sdp_mode_set(sdp_session_t const *user,
int const *s2u,
sdp_session_t *session,
int soa_sdp_mode_set_is_needed(sdp_session_t const *session,
sdp_session_t const *remote,
char const *hold)
{
sdp_media_t const *sm, *rm, *rm_next;
int hold_all;
sdp_mode_t recv_mode;
SU_DEBUG_7(("soa_sdp_mode_set_is_needed(%p, %p, \"%s\"): called\n",
(void *)session, (void *)remote, hold ? hold : ""));
if (!session )
return 0;
hold_all = str0cmp(hold, "*") == 0;
rm = remote ? remote->sdp_media : NULL, rm_next = NULL;
for (sm = session->sdp_media; sm; sm = sm->m_next, rm = rm_next) {
rm_next = rm ? rm->m_next : NULL;
if (sm->m_rejected)
continue;
if (rm) {
/* Mode bits do not match */
if (((rm->m_mode & sdp_recvonly) == sdp_recvonly)
!= ((sm->m_mode & sdp_sendonly) == sdp_sendonly))
return 1;
}
recv_mode = sm->m_mode & sdp_recvonly;
if (recv_mode && hold &&
(hold_all || strcasestr(hold, sm->m_type_name)))
return 1;
}
return 0;
}
/** Update mode within session */
static
int soa_sdp_mode_set(sdp_session_t *session,
sdp_session_t const *remote,
char const *hold,
int dryrun)
char const *hold)
{
sdp_media_t *sm;
sdp_media_t const *rm, *rm_next, *um;
int retval = 0, i, j;
sdp_media_t const *rm, *rm_next;
int hold_all;
int inactive_all;
int inactive = 0;
char const *hold_media = NULL;
sdp_mode_t send_mode, recv_mode;
SU_DEBUG_7(("soa_sdp_mode_set(%p, %p, \"%s\"): called\n",
@@ -1007,58 +1037,25 @@ int soa_sdp_mode_set(sdp_session_t const *user,
rm = remote ? remote->sdp_media : NULL, rm_next = NULL;
hold_all = str0cmp(hold, "*") == 0;
inactive_all = str0cmp(hold, "#") == 0;
i = 0;
for (sm = session->sdp_media; sm; sm = sm->m_next, rm = rm_next, i++) {
for (sm = session->sdp_media; sm; sm = sm->m_next, rm = rm_next) {
rm_next = rm ? rm->m_next : NULL;
inactive = 0;
if (sm->m_rejected)
continue;
assert(s2u);
for (j = 0, um = user->sdp_media; j != s2u[i]; um = um->m_next, j++)
assert(um);
assert(um);
send_mode = um->m_mode & sdp_sendonly;
send_mode = sdp_sendonly;
if (rm)
send_mode = (rm->m_mode & sdp_recvonly) ? sdp_sendonly : 0;
recv_mode = um->m_mode & sdp_recvonly;
if (rm && rm->m_mode == sdp_inactive) {
send_mode = recv_mode = 0;
}
else if (inactive_all) {
send_mode = recv_mode = 0;
}
else if (hold_all) {
recv_mode = sm->m_mode & sdp_recvonly;
if (recv_mode && hold && (hold_all || strcasestr(hold, sm->m_type_name)))
recv_mode = 0;
}
else if (hold && (hold_media = strcasestr(hold, sm->m_type_name))) {
recv_mode = 0;
hold_media += strlen(sm->m_type_name);
hold_media += strspn(hold_media, " \t");
if (hold_media[0] == '=') {
hold_media += strspn(hold, " \t");
if (strncasecmp(hold_media, "inactive", strlen("inactive")) == 0)
recv_mode = send_mode = 0;
}
}
if (sm->m_mode != (unsigned)(recv_mode | send_mode))
retval = 1;
if (!dryrun) {
sm->m_mode = recv_mode | send_mode;
}
sm->m_mode = recv_mode | send_mode;
}
return retval;
return 0;
}
enum offer_answer_action {
@@ -1216,22 +1213,16 @@ static int offer_answer_step(soa_session_t *ss,
/* Step D: Set media mode bits */
switch (action) {
int const *s2u_;
case generate_offer:
case generate_answer:
case process_answer:
s2u_ = s2u;
if (!s2u_) s2u_ = sss->sss_s2u;
if (soa_sdp_mode_set(user, s2u_, local, remote, ss->ss_hold, 1)) {
if (soa_sdp_mode_set_is_needed(local, remote, ss->ss_hold)) {
if (local != local0) {
*local0 = *local, local = local0;
DUP_LOCAL(local);
}
soa_sdp_mode_set(user, s2u_, local, remote, ss->ss_hold, 0);
soa_sdp_mode_set(local, remote, ss->ss_hold);
}
break;
default: