Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
December 2008
- 13 participants
- 473 discussions
Author: mikej
Date: Tue Dec 16 16:42:38 2008
New Revision: 10838
Log:
.update
Modified:
freeswitch/trunk/libs/sofia-sip/.update
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:42:38 2008
@@ -1 +1 @@
-Tue Dec 16 15:22:24 CST 2008
+Tue Dec 16 15:42:18 CST 2008
1
0
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:29:07 2008
New Revision: 10837
Log:
SFSIP-107 don't destroy locked mutex
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c Tue Dec 16 16:29:07 2008
@@ -1020,17 +1020,15 @@
home->suh_blocks = NULL;
if (home->suh_lock) {
-#ifdef WIN32
- UNLOCK(home); /* we must unlock here or windows leaks handles on the next call because the mutex is locked */
-#endif
-/* "In the LinuxThreads implementation, no resources are associated with mutex objects,
- thus pthread_mutex_destroy actually does nothing except checking that the mutex is unlocked. "
- In the Windows pthread implementation we must free the handles that are allocated */
- _su_home_destroy_mutexes(home->suh_lock);
+ void *suh_lock = home->suh_lock;
+
+ home->suh_lock = NULL;
+
+ /* Unlock, or risk assert() or leak handles on Windows */
+ _su_home_unlocker(suh_lock);
+ _su_home_destroy_mutexes(suh_lock);
}
}
-
- home->suh_lock = NULL;
}
/** Free memory blocks allocated through home.
1
0
Author: mikej
Date: Tue Dec 16 16:25:54 2008
New Revision: 10836
Log:
Tue Dec 9 11:11:08 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* RELEASE, configure.ac: opening development head
Modified:
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:25:54 2008
@@ -1,24 +1,30 @@
-===================================
-Release notes for Sofia-SIP 1.12.10
-===================================
+==============================================
+Release notes for current version of Sofia-SIP
+==============================================
-Changes since release 1.12.9
-----------------------------
+Changes since last release
+--------------------------
+
+<changes since last written in freshmeat.net "Changes:" style;
+ and in less than 10 lines, written in 3rd person English, with
+ complete sentences />
-Numerous bugs has been fixed. The SDP parser has been updated to accept
-syntax according to RFC 4566. The TLS certificate verfication can now be
-controlled through offical API.
+Bugs in blaa and foo have been fixed. The stack now supports
+use of foobar...
API/ABI changes and versioning
------------------------------
-libsofia-sip-ua:
- New tags added:
- - TPTAG_TLS_VERIFY_PEER()
- - NUTAG_REFRESH_WITHOUT_SDP()
- Tag behavour updated:
- - NTATAG_SERVER_RPORT(2) now includes and uses rport even if client does not
+<see previous release notes at
+ http://sofia-sip.sourceforge.net/relnotes/ for examples ;
+ - should include all changes to public headers, and
+ other important information to developers;
+ - and should be updated _continuously_! />
+
+**template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
+libsofia-sip-ua:
+- **template**: Added foobar() function (sofia-sip/foobar.h).
- This release is ABI/API compatible with applications linked against
any 1.12.x release. However, applications built against this release won't
work against an older library. The ABI has been tested with the nua module
@@ -32,40 +38,36 @@
Contributors to this release
----------------------------
-Tiago Katcipis <katcipis AT inf DOT ufcs DOT br>
-Mikhail Zabaluev
-Paulo Pizarro <paulo -dot pizarro -at gmail -dot com>
-Filippo Della Betta
-Jarod Neuner <janeuner(a)networkharbor.com>
-Fabio Ferrari <fabioferrari AT gmail DOT com>
-Jeff Lenk <jlenk at frontiernet dot net>
-Brian Czapiga <rys at evool dot com>
-Stefano Sabatini
-Fabio Margarido <fabiomargarido AT gmail DOT com>
+<list of people who contributed to _this_ release
+ - update as people's patches are added, or when you commit stuff
+ - current development team members (see AUTHORS) may be omitted,
+ or listed at the end of the contribur list (depending on the scope
+ of the work done since the last release)
+ - name of the contributor should be enough (email addresses in AUTHORS),
+ plus a _brief_ description of what was contributed
+ - roughly sorted by number of patches accepted
+/>
+
+- **template**: First Surname (patch to nua/soa/msg)
See the AUTHORS file in the distribution package.
+Notes on new features
+---------------------
+
+<information about major new features
+ - new/changed/removed functionality
+ - links to further documentation
+ - section may be omitted for minor releases
+/>
Bugs fixed in this release
--------------------------
-- Configure script options --enable-ndebug and enable-expensive-checks fixed.
- Patch by Fabio Margarido
-- When using session-timers, expire session only at the end of negotiated
- expiration time.
-- Fixed #1930055: Unregister when a new public binding is detected.
- Patch by Mikhail Zabaluev.
-- Use SIPS scheme in Contact URI if registering with SIPS. Patch by Jarod
- Neuner.
-- Using lower-case "udptl" transport name in SDP. Be bug-compatible.
- Report by Timo Bruhn.
-- Fixed mutex handle leak on Windows. Patch by Jeff Lenk.
-- Accept requests with invalid Supported header. Patch by Brian Czapiga.
-- When doing event fetch (SUBSCRIBE with Expires: 0) Wait until NOTIFY is
- received.
-- Fixed memory leak when destroying incomplete INVITE transactions in nua.
-- Not using OPTIONS keepalive on TCP.
-- Fixed bug with To-tags in response to CANCEL.
-- Fixed #2041747: crash when using SIPTAG_ORGANIZATION_TAG_STR
-- Fixed #1904805: build with Vista PlatformSDK
-- Fixed #2037585: crash when call terminated
+< notable bugs fixed in this release
+ - check the sf.net bug tracker; see closed bugs,
+ sorted by closing date
+ - other bugs as fixed in CVS/darcs
+/>
+
+- **template**: #9499652 sf.net bug item title
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:25:54 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.10])
+AC_INIT([sofia-sip], [1.12.10devel])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
Author: mikej
Date: Tue Dec 16 16:25:01 2008
New Revision: 10835
Log:
Mon Dec 8 09:40:33 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* configure.ac, RELEASE: bumped version
Modified:
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:25:01 2008
@@ -1,6 +1,6 @@
-======================================
-Release notes for Sofia-SIP 1.12.10rc2
-======================================
+===================================
+Release notes for Sofia-SIP 1.12.10
+===================================
Changes since release 1.12.9
----------------------------
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:25:01 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9pre10rc2])
+AC_INIT([sofia-sip], [1.12.10])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
Author: mikej
Date: Tue Dec 16 16:24:18 2008
New Revision: 10834
Log:
Wed Dec 3 06:00:07 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* Updated AUTHORS, RELEASE.
Modified:
freeswitch/trunk/libs/sofia-sip/AUTHORS
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/AUTHORS
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/AUTHORS (original)
+++ freeswitch/trunk/libs/sofia-sip/AUTHORS Tue Dec 16 16:24:18 2008
@@ -19,6 +19,7 @@
Jacobs, Remeres <first.surname(a)nokia.com>
Jalava, Teemu <first.surname(a)nokia.com>
Jerris, Michael <mike -at jerris -dot com>
+Katcipis, Tiago <katcipis AT inf DOT ufcs DOT br>
Knoblich, Stefan
Legostayev, Denis <legostayev -at neic -dot nsk -dot su>
Lenk, Jeff <jlenk -at frontiernet -dot net>
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:24:18 2008
@@ -1,30 +1,24 @@
-==============================================
-Release notes for current version of Sofia-SIP
-==============================================
+======================================
+Release notes for Sofia-SIP 1.12.10rc2
+======================================
-Changes since last release
---------------------------
-
-<changes since last written in freshmeat.net "Changes:" style;
- and in less than 10 lines, written in 3rd person English, with
- complete sentences />
+Changes since release 1.12.9
+----------------------------
-Bugs in blaa and foo have been fixed. The stack now supports
-use of foobar...
+Numerous bugs has been fixed. The SDP parser has been updated to accept
+syntax according to RFC 4566. The TLS certificate verfication can now be
+controlled through offical API.
API/ABI changes and versioning
------------------------------
-<see previous release notes at
- http://sofia-sip.sourceforge.net/relnotes/ for examples ;
- - should include all changes to public headers, and
- other important information to developers;
- - and should be updated _continuously_! />
-
-**template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
-
libsofia-sip-ua:
-- **template**: Added foobar() function (sofia-sip/foobar.h).
+ New tags added:
+ - TPTAG_TLS_VERIFY_PEER()
+ - NUTAG_REFRESH_WITHOUT_SDP()
+ Tag behavour updated:
+ - NTATAG_SERVER_RPORT(2) now includes and uses rport even if client does not
+
- This release is ABI/API compatible with applications linked against
any 1.12.x release. However, applications built against this release won't
work against an older library. The ABI has been tested with the nua module
@@ -38,36 +32,40 @@
Contributors to this release
----------------------------
-<list of people who contributed to _this_ release
- - update as people's patches are added, or when you commit stuff
- - current development team members (see AUTHORS) may be omitted,
- or listed at the end of the contribur list (depending on the scope
- of the work done since the last release)
- - name of the contributor should be enough (email addresses in AUTHORS),
- plus a _brief_ description of what was contributed
- - roughly sorted by number of patches accepted
-/>
-
-- **template**: First Surname (patch to nua/soa/msg)
+Tiago Katcipis <katcipis AT inf DOT ufcs DOT br>
+Mikhail Zabaluev
+Paulo Pizarro <paulo -dot pizarro -at gmail -dot com>
+Filippo Della Betta
+Jarod Neuner <janeuner(a)networkharbor.com>
+Fabio Ferrari <fabioferrari AT gmail DOT com>
+Jeff Lenk <jlenk at frontiernet dot net>
+Brian Czapiga <rys at evool dot com>
+Stefano Sabatini
+Fabio Margarido <fabiomargarido AT gmail DOT com>
See the AUTHORS file in the distribution package.
-Notes on new features
----------------------
-
-<information about major new features
- - new/changed/removed functionality
- - links to further documentation
- - section may be omitted for minor releases
-/>
Bugs fixed in this release
--------------------------
-< notable bugs fixed in this release
- - check the sf.net bug tracker; see closed bugs,
- sorted by closing date
- - other bugs as fixed in CVS/darcs
-/>
-
-- **template**: #9499652 sf.net bug item title
+- Configure script options --enable-ndebug and enable-expensive-checks fixed.
+ Patch by Fabio Margarido
+- When using session-timers, expire session only at the end of negotiated
+ expiration time.
+- Fixed #1930055: Unregister when a new public binding is detected.
+ Patch by Mikhail Zabaluev.
+- Use SIPS scheme in Contact URI if registering with SIPS. Patch by Jarod
+ Neuner.
+- Using lower-case "udptl" transport name in SDP. Be bug-compatible.
+ Report by Timo Bruhn.
+- Fixed mutex handle leak on Windows. Patch by Jeff Lenk.
+- Accept requests with invalid Supported header. Patch by Brian Czapiga.
+- When doing event fetch (SUBSCRIBE with Expires: 0) Wait until NOTIFY is
+ received.
+- Fixed memory leak when destroying incomplete INVITE transactions in nua.
+- Not using OPTIONS keepalive on TCP.
+- Fixed bug with To-tags in response to CANCEL.
+- Fixed #2041747: crash when using SIPTAG_ORGANIZATION_TAG_STR
+- Fixed #1904805: build with Vista PlatformSDK
+- Fixed #2037585: crash when call terminated
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:24:18 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9pre10rc1])
+AC_INIT([sofia-sip], [1.12.9pre10rc2])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:23:37 2008
New Revision: 10833
Log:
fixed whitespace
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c Tue Dec 16 16:23:37 2008
@@ -326,7 +326,7 @@
fail_unless(s2_check_callstate(nua_callstate_terminated));
}
-static void
+static void
bye_by_nua_challenged(nua_handle_t *nh,
tag_type_t tag, tag_value_t value, ...)
{
@@ -358,7 +358,7 @@
}
-static void
+static void
cancel_by_nua(nua_handle_t *nh,
struct message *invite,
struct dialog *dialog,
@@ -383,7 +383,7 @@
fail_unless(s2_check_event(nua_r_invite, 487));
}
-static void
+static void
bye_to_nua(nua_handle_t *nh,
tag_type_t tag, tag_value_t value, ...)
{
@@ -1094,7 +1094,7 @@
s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
SIPTAG_USER_AGENT_STR("evil (evil) evil"),
TAG_END());
-
+
nua_respond(nh, SIP_200_OK, TAG_END());
fail_unless(s2_check_callstate(nua_callstate_completed));
@@ -1119,7 +1119,7 @@
s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
SIPTAG_USER_AGENT_STR("evil (evil) evil"),
TAG_END());
-
+
nua_respond(nh, SIP_200_OK, TAG_END());
fail_unless(s2_check_callstate(nua_callstate_completed));
@@ -1564,7 +1564,7 @@
invite = s2_wait_for_request(SIP_METHOD_INVITE);
fail_if(!invite);
- respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR,
+ respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR,
SIPTAG_RETRY_AFTER_STR("8"),
TAG_END());
s2_free_message(invite);
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h Tue Dec 16 16:23:37 2008
@@ -26,7 +26,7 @@
/** Defined when <nua_params.h> has been included. */
#define NUA_PARAMS_H
-/**@internal @file nua_params.h
+/**@internal @file nua_params.h
* @brief Parameters and their handling
*
* @author Pekka Pessi <Pekka.Pessi(a)nokia.com>
@@ -37,7 +37,7 @@
#include <nua_types.h>
-/**@internal @brief NUA preferences.
+/**@internal @brief NUA preferences.
*
* This structure contains values for various preferences and a separate
* bitmap (nhp_set) for each preference. Preferences are set using
@@ -69,7 +69,7 @@
unsigned nhp_auto_ack:1; /**< Automatically ACK a final response */
unsigned :0;
- /** INVITE timeout.
+ /** INVITE timeout.
*
* If no response is received in nhp_invite_timeout seconds,
* INVITE client transaction times out
@@ -80,12 +80,12 @@
/** Default Min-SE Delta value */
unsigned nhp_min_se;
/** no (preference), local or remote */
- enum nua_session_refresher nhp_refresher;
+ enum nua_session_refresher nhp_refresher;
unsigned nhp_update_refresh:1; /**< Use UPDATE to refresh */
/**< Accept refreshes without SDP */
unsigned nhp_refresh_without_sdp:1;
-
+
/* Messaging preferences */
unsigned nhp_message_enable : 1;
/** Be bug-compatible with Windows Messenger */
@@ -131,8 +131,8 @@
char const *nhp_instance;
/** Outbound OPTIONS */
- char const *nhp_outbound;
-
+ char const *nhp_outbound;
+
sip_allow_t *nhp_appl_method;
/** Initial route set */
@@ -143,11 +143,11 @@
union { struct {
/* A bit for each feature set by application */
- /* NOTE:
+ /* NOTE:
Some compilers behave weird if there are bitfields
- together with width > 32
- So there should be a padding field (unsigned:0;)
- every 32 bits.
+ together with width > 32
+ So there should be a padding field (unsigned:0;)
+ every 32 bits.
*/
unsigned nhb_retry_count:1;
unsigned nhb_max_subscriptions:1;
@@ -165,7 +165,7 @@
unsigned nhb_session_timer:1;
unsigned nhb_min_se:1;
- unsigned nhb_refresher:1;
+ unsigned nhb_refresher:1;
unsigned nhb_update_refresh:1;
unsigned nhb_refresh_without_sdp:1;
unsigned nhb_message_enable:1;
@@ -202,7 +202,7 @@
unsigned nhb_initial_route:1;
unsigned nhb_proxy:1;
unsigned :0;
- } set_bits;
+ } set_bits;
unsigned set_unsigned[2];
} nhp_set_;
};
@@ -222,7 +222,7 @@
unsigned ngp_detect_network_updates:1;
unsigned ngp_shutdown_events:1;
unsigned :0;
- } set_bits;
+ } set_bits;
unsigned set_unsigned[2];
} ngp_set_;
};
@@ -250,7 +250,7 @@
#define NH_PGET(nh, pref) \
NHP_GET((nh)->nh_prefs, (nh)->nh_dprefs, pref)
-/* Get preference from handle, if exists and set,
+/* Get preference from handle, if exists and set,
otherwise from default handle */
#define NUA_PGET(nua, nh, pref) \
NHP_GET((nh) ? (nh)->nh_prefs : (nua)->nua_dhandle->nh_prefs, \
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:23:37 2008
@@ -70,14 +70,14 @@
If a re-INVITE transaction fails, the result depends on the status code in
failure. The call can return to the ready state, be terminated immediately,
or be terminated gracefully. The proper action to take is determined with
-sip_response_terminates_dialog().
+sip_response_terminates_dialog().
@sa @ref nua_call_model, #nua_i_state, nua_invite(), #nua_i_invite
-
-@par Session State Diagram
-
-@code
- +----------+
+
+@par Session State Diagram
+
+@code
+ +----------+
| |---------------------+
| Init | |
| |----------+ |
@@ -124,16 +124,16 @@
+->|Terminated|<--------------+
| |
+----------+
- |
+ |
V
+----------+
| |
| Init |
| |
+----------+
-@endcode
-*/
-
+@endcode
+*/
+
/* ---------------------------------------------------------------------- */
/* Session event usage */
@@ -141,10 +141,10 @@
typedef struct nua_session_usage
{
enum nua_callstate ss_state; /**< Session status (enum nua_callstate) */
-
+
unsigned ss_100rel:1; /**< Use 100rel, send 183 */
unsigned ss_alerting:1; /**< 180 is sent/received */
-
+
unsigned ss_update_needed:2; /**< Send an UPDATE (do O/A if > 1) */
unsigned ss_precondition:1; /**< Precondition required */
@@ -273,7 +273,7 @@
continue;
if (cr->cr_status < 200) {
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
NULL,
cr->cr_event,
SIP_481_NO_TRANSACTION,
@@ -291,8 +291,8 @@
ss->ss_state != nua_callstate_init &&
!ss->ss_reporting) {
int status = 0; char const *phrase = "Terminated";
-
- if (cr0)
+
+ if (cr0)
status = cr0->cr_status, phrase = cr0->cr_phrase ? cr0->cr_phrase : phrase;
else if (sr0)
status = sr0->sr_status, phrase = sr0->sr_phrase;
@@ -409,11 +409,11 @@
/**@fn void nua_invite(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Place a call using SIP @b INVITE method.
+ * Place a call using SIP @b INVITE method.
*
* The INVITE method is used to initiate a call between two parties. The
* call is also known as <i>SIP session</i>.
- *
+ *
* At SIP level the session is represented as @e Dialog, which is a
* peer-to-peer association between two SIP User-Agents. The dialog is
* established by a successful 2XX response to the INVITE. The dialog is
@@ -433,7 +433,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Events:
@@ -469,11 +469,11 @@
* @par
* When multiple tags for the same header are specified, the behaviour
* depends on the header type. If only a single header field can be included
- * in a SIP message, the latest non-NULL value is used, e.g., @Subject.
+ * in a SIP message, the latest non-NULL value is used, e.g., @Subject.
* However, if the SIP header can consist of multiple lines or header fields
* separated by comma, e.g., @Accept, all the tagged
* values are concatenated.
- *
+ *
* @par
* However, if a tag value is #SIP_NONE (-1 casted as a void pointer), the
* values from previous tags are ignored.
@@ -490,10 +490,10 @@
* For initial INVITE requests, values from tags are used. If NUTAG_URL() is
* given, it is used as target URI. Otherwise, if SIPTAG_TO() is given, it
* is used as target URI. If neither is given, the complete request line
- * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used.
+ * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used.
* If none of the tags above are given, an internal error is returned to the
* application. At this point, the target URI is stored in the request line,
- * together with method name ("INVITE") and protocol version ("SIP/2.0").
+ * together with method name ("INVITE") and protocol version ("SIP/2.0").
* The initial dialog information is also created: @CallID, @CSeq headers
* are generated, if they do not exist, and an unique tag is added to @From
* header.
@@ -521,14 +521,14 @@
* For in-dialog INVITE (re-INVITE), the request URI is taken from the
* @Contact header received from the remote party during the dialog
* establishment. Also, the @CallID and @CSeq headers and @From and @To tags
- * are generated based on the dialog information and added to the request.
+ * are generated based on the dialog information and added to the request.
* If the dialog has a route (set by @RecordRoute headers), it is added to
* the request, too.
*
* @par
* @MaxForwards header (with default value set by NTATAG_MAX_FORWARDS()) is
* also added now, if it does not exist.
- *
+ *
* @par
* The INVITE request message created by nua_invite() operation is saved as
* a template for automatic re-INVITE requests sent by the session timer
@@ -540,8 +540,8 @@
*
* @par Tags Related to SIP Headers and Request-URI
* NUTAG_URL(), SIPTAG_REQUEST(), SIPTAG_REQUEST_STR() \n
- * NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(),
- * SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(),
+ * NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(),
+ * SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(),
* NUTAG_SERVICE_ROUTE_ENABLE() \n
* SIPTAG_MAX_FORWARDS(), SIPTAG_MAX_FORWARDS_STR() \n
* SIPTAG_PROXY_REQUIRE(), SIPTAG_PROXY_REQUIRE_STR() \n
@@ -574,7 +574,7 @@
* SIPTAG_AUTHORIZATION(), SIPTAG_AUTHORIZATION_STR() \n
* SIPTAG_REFERRED_BY(), SIPTAG_REFERRED_BY_STR() \n
* SIPTAG_REPLACES(), SIPTAG_REPLACES_STR() \n
- * NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
+ * NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
* SIPTAG_SESSION_EXPIRES(), SIPTAG_SESSION_EXPIRES_STR() \n
* NUTAG_MIN_SE(), SIPTAG_MIN_SE(), SIPTAG_MIN_SE_STR() \n
* SIPTAG_SECURITY_CLIENT(), SIPTAG_SECURITY_CLIENT_STR() \n
@@ -596,7 +596,7 @@
* @par
* The SDP description of the
* @ref soa_session_t "soa media session" is included in the INVITE request
- * as a message body.
+ * as a message body.
* The SDP in the message body of the 1XX or 2XX response message is
* interpreted as an answer, given to the @ref soa_session_t "soa media
* session" object for processing.
@@ -608,8 +608,8 @@
* NUTAG_MEDIA_ENABLE(), \n
* NUTAG_INCLUDE_EXTRA_SDP(), \n
* SOATAG_HOLD(), SOATAG_AF(), SOATAG_ADDRESS(),
- * SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(),
- * SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(),
+ * SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(),
+ * SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(),
* SOATAG_AUDIO_AUX(), \n
* SOATAG_USER_SDP() or SOATAG_USER_SDP_STR() \n
*
@@ -623,10 +623,10 @@
* SIP level, that is, the SIP PRACK and UPDATE requests are sent if
* "precondition" is added to the @Require header in the INVITE request.
*
- * Optionally
+ * Optionally
* - uses early media if NUTAG_EARLY_MEDIA() tag is used with non zero-value
* - media parameters can be set by SOA tags
- * - nua_invite() can be used to change status of an existing call:
+ * - nua_invite() can be used to change status of an existing call:
* - #SOATAG_HOLD tag can be used to list the media that will be put on hold,
* the value "*" sets all the media beloginging to the session on hold
*
@@ -645,7 +645,7 @@
* nua_authenticate() \n
* nua_prack() \n
* nua_update() \n
- * nua_info() \n
+ * nua_info() \n
* nua_cancel() \n
* nua_bye() \n
* #nua_i_invite, nua_respond()
@@ -655,7 +655,7 @@
* NUTAG_REFER_PAUSE() \n
*/
-static int nua_invite_client_init(nua_client_request_t *cr,
+static int nua_invite_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_invite_client_request(nua_client_request_t *cr,
@@ -706,7 +706,7 @@
return nua_client_create(nh, e, &nua_invite_client_methods, tags);
}
-static int nua_invite_client_init(nua_client_request_t *cr,
+static int nua_invite_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -715,11 +715,11 @@
nua_session_usage_t *ss;
cr->cr_usage = du = nua_dialog_usage_for_session(nh->nh_ds);
- /* Errors returned by nua_invite_client_init()
+ /* Errors returned by nua_invite_client_init()
do not change the session state */
- cr->cr_neutral = 1;
-
- if (nh_is_special(nh) ||
+ cr->cr_neutral = 1;
+
+ if (nh_is_special(nh) ||
nua_stack_set_handle_special(nh, nh_has_invite, nua_i_error))
return nua_client_return(cr, 900, "Invalid handle for INVITE", msg);
else if (nh_referral_check(nh, tags) < 0)
@@ -751,7 +751,7 @@
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -770,7 +770,7 @@
int offer_sent = 0, retval;
sip_time_t invite_timeout;
- if (du == NULL) /* Call terminated */
+ if (du == NULL) /* Call terminated */
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
ss = NUA_DIALOG_USAGE_PRIVATE(du);
@@ -836,7 +836,7 @@
ss->ss_oa_sent = Offer;
if (!cr->cr_restarting) /* Restart logic calls nua_invite_client_report */
- signal_call_state_change(nh, ss, 0, "INVITE sent",
+ signal_call_state_change(nh, ss, 0, "INVITE sent",
nua_callstate_calling);
}
@@ -861,7 +861,7 @@
session_timer_set(ss);
}
-
+
return nua_session_client_response(cr, status, phrase, sip);
}
@@ -885,7 +885,7 @@
nua_dialog_uac_route(nh, nh->nh_ds, sip, 1);
nua_dialog_store_peer_info(nh, nh->nh_ds, sip);
-
+
/* Tag the INVITE request */
tagged = nta_outgoing_tagged(cr->cr_orq,
nua_client_orq_response, cr,
@@ -898,18 +898,18 @@
ss->ss_reason = "SIP;cause=500;text=\"Cannot Create Early Dialog\"";
}
}
-
+
if (!rseq) {
SU_DEBUG_5(("nua(%p): 100rel missing RSeq\n", (void *)nh));
}
else if (nta_outgoing_rseq(cr->cr_orq) > rseq->rs_response) {
- SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
+ SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
(unsigned)rseq->rs_response,
nta_outgoing_rseq(cr->cr_orq)));
return 1; /* Do not send event */
}
else if (nta_outgoing_setrseq(cr->cr_orq, rseq->rs_response) < 0) {
- SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
+ SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
(unsigned)rseq->rs_response));
cr->cr_graceful = 1;
ss->ss_reason = "SIP;cause=400;text=\"Bad RSeq\"";
@@ -992,7 +992,7 @@
cr->cr_graceful = 1;
ss->ss_reason = "SIP;cause=400;text=\"Malformed Session Description\"";
}
- else
+ else
LOG5("got SDP");
}
@@ -1022,7 +1022,7 @@
nh_referral_respond(nh, status, phrase); /* XXX - restarting after 401/407 */
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -1060,7 +1060,7 @@
else if (status < 200) {
next_state = nua_callstate_proceeding;
- if (sip && sip->sip_rseq &&
+ if (sip && sip->sip_rseq &&
!SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_prack)) {
sip_rack_t rack[1];
@@ -1070,7 +1070,7 @@
rack->ra_method = sip->sip_cseq->cs_method;
rack->ra_method_name = sip->sip_cseq->cs_method_name;
- error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods,
+ error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods,
SIPTAG_RACK(rack),
TAG_END());
if (error < 0) {
@@ -1126,7 +1126,7 @@
if (ss->ss_state > nua_callstate_proceeding || status >= 200)
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
else
- error = nua_client_create(nh, nua_r_cancel,
+ error = nua_client_create(nh, nua_r_cancel,
&nua_cancel_client_methods, tags);
if (error) {
@@ -1154,7 +1154,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1162,7 +1162,7 @@
*
* @par Events:
* #nua_i_media_error \n
- * #nua_i_state (#nua_i_active, #nua_i_terminated)
+ * #nua_i_state (#nua_i_active, #nua_i_terminated)
*
* @sa NUTAG_AUTOACK(), @ref nua_call_model, #nua_i_state
*/
@@ -1196,8 +1196,8 @@
ss->ss_reporting = 1; /* We report terminated state here if BYE fails */
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
ss->ss_reporting = 0;
- signal_call_state_change(nh, ss, 500, "Internal Error",
- error
+ signal_call_state_change(nh, ss, 500, "Internal Error",
+ error
? nua_callstate_terminated
: nua_callstate_terminating);
}
@@ -1254,11 +1254,11 @@
wa = sip_authorization(sip);
pa = sip_proxy_authorization(sip);
-
+
msg_destroy(msg);
msg = nta_msg_create(nh->nh_nua->nua_nta, 0);
- sip = sip_object(msg);
+ sip = sip_object(msg);
if (!msg)
return -1;
@@ -1339,7 +1339,7 @@
reason = "SIP;cause=488;text=\"Incomplete offer/answer\"";
}
}
-
+
proxy_is_set = NH_PISSET(nh, proxy);
proxy = NH_PGET(nh, proxy);
@@ -1406,12 +1406,12 @@
/**@fn void nua_cancel(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Cancel an INVITE operation
+ * Cancel an INVITE operation
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1458,7 +1458,7 @@
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = nua_dialog_usage_for_session(nh->nh_ds);
- if (!du || !du->du_cr || !du->du_cr->cr_orq ||
+ if (!du || !du->du_cr || !du->du_cr->cr_orq ||
nta_outgoing_status(du->du_cr->cr_orq) >= 200) {
return nua_client_return(cr, 481, "No transaction to CANCEL", msg);
}
@@ -1485,12 +1485,12 @@
* The CANCEL may be sent explicitly by nua_cancel() or implicitly by NUA
* state machine.
*
- * @param status response status code
+ * @param status response status code
* @param phrase a short textual description of @a status code
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to CANCEL request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -1509,25 +1509,25 @@
nua_client_request_t const *cr = du->du_cr;
nua_server_request_t const *sr;
- if (ss->ss_state >= nua_callstate_terminating ||
+ if (ss->ss_state >= nua_callstate_terminating ||
/* INVITE is in progress or being authenticated */
(cr && (cr->cr_orq || cr->cr_wait_for_cred)))
return;
/* UPDATE has been queued */
- for (cr = ds->ds_cr; cr; cr = cr->cr_next)
+ for (cr = ds->ds_cr; cr; cr = cr->cr_next)
if (cr->cr_method == sip_method_update)
return;
/* INVITE or UPDATE in progress on server side */
for (sr = ds->ds_sr; sr; sr = sr->sr_next)
- if (sr->sr_usage == du &&
- (sr->sr_method == sip_method_invite ||
+ if (sr->sr_usage == du &&
+ (sr->sr_method == sip_method_invite ||
sr->sr_method == sip_method_update))
return;
if (ss->ss_timer->refresher == nua_remote_refresher) {
- ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
+ ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL);
return;
}
@@ -1542,7 +1542,7 @@
}
}
-/** @interal Shut down session usage.
+/** @interal Shut down session usage.
*
* @retval >0 shutdown done
* @retval 0 shutdown in progress
@@ -1609,21 +1609,21 @@
default:
break;
}
-
+
nua_dialog_usage_remove(nh, ds, du, NULL, NULL);
return 200;
}
/**@fn void nua_prack(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
- * Send a PRACK request.
+ * Send a PRACK request.
*
* PRACK is used to acknowledge receipt of 100rel responses. See @RFC3262.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1647,7 +1647,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to @b PRACK or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -1656,7 +1656,7 @@
* @END_NUA_EVENT
*/
-static int nua_prack_client_init(nua_client_request_t *cr,
+static int nua_prack_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_prack_client_request(nua_client_request_t *cr,
@@ -1695,7 +1695,7 @@
return nua_client_create(nh, e, &nua_prack_client_methods, tags);
}
-static int nua_prack_client_init(nua_client_request_t *cr,
+static int nua_prack_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -1732,7 +1732,7 @@
rseq = sip->sip_rack->ra_response;
if (cri->cr_offer_recv && !cri->cr_answer_sent) {
- if (nh->nh_soa == NULL)
+ if (nh->nh_soa == NULL)
/* It is up to application to handle SDP */
answer_sent = session_get_description(sip, NULL, NULL);
else if (sip->sip_payload)
@@ -1780,12 +1780,12 @@
cr->cr_offer_sent = offer_sent;
cr->cr_answer_sent = answer_sent;
- if (offer_sent)
+ if (offer_sent)
ss->ss_oa_sent = Offer;
else if (answer_sent)
ss->ss_oa_sent = Answer;
- if (cr->cr_restarting)
+ if (cr->cr_restarting)
/* Restart logic calls nua_prack_client_report */;
else if (!cr->cr_auto && (!offer_sent || !answer_sent))
/* Suppose application know it called nua_prack() */;
@@ -1816,7 +1816,7 @@
nua_session_usage_t *ss = nua_dialog_usage_private(du);
int acked = 0;
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -1833,7 +1833,7 @@
else if (nua_invite_client_should_ack(du->du_cr)) {
/* There is an un-ACK-ed INVITE there */
assert(du->du_cr->cr_method == sip_method_invite);
- if (NH_PGET(nh, auto_ack) ||
+ if (NH_PGET(nh, auto_ack) ||
/* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
(ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
/* There should be no UPDATE with offer/answer
@@ -1858,7 +1858,7 @@
else if (ss->ss_update_needed && 200 <= status && status < 300 &&
!SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_update))
nua_client_create(nh, nua_r_update, &nua_update_client_methods, NULL);
-
+
return 1;
}
@@ -1867,7 +1867,7 @@
/** @NUA_EVENT nua_i_invite
*
- * Indication of incoming call or re-INVITE request.
+ * Indication of incoming call or re-INVITE request.
*
* @param status statuscode of response sent automatically by stack
* @param phrase a short textual description of @a status code
@@ -1900,7 +1900,7 @@
* to a #soa_session_t object. The #nua_i_state event sent to the
* application immediately after #nua_i_invite will contain the parsing
* results in SOATAG_REMOTE_SDP() and SOATAG_REMOTE_SDP_STR() tags.
- *
+ *
* Note that currently the parser within @nua does not handle MIME
* multipart. The SDP Offer/Answer engine can get confused if the SDP offer
* is included in a MIME multipart, therefore such an @b INVITE is rejected
@@ -1945,8 +1945,8 @@
*
* @sa nua_respond(), @ref nua_uas_call_model, #nua_i_state,
* NUTAG_MEDIA_ENABLE(), SOATAG_USER_SDP(), SOATAG_USER_SDP_STR(),
- * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(),
- * NUTAG_ONLY183_100REL(),
+ * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(),
+ * NUTAG_ONLY183_100REL(),
* NUTAG_INCLUDE_EXTRA_SDP(),
* #nua_i_prack, #nua_i_update, nua_update(),
* nua_invite(), #nua_r_invite
@@ -1974,7 +1974,7 @@
static int nua_invite_server_report(nua_server_request_t *sr, tagi_t const *);
static int
- process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
+ process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
sip_t const *),
process_ack(nua_server_request_t *, nta_incoming_t *, sip_t const *),
process_ack_error(nua_server_request_t *sr, msg_t *ackmsg,
@@ -1986,11 +1986,11 @@
nta_incoming_t *irq,
sip_t const *sip);
-nua_server_methods_t const nua_invite_server_methods =
+nua_server_methods_t const nua_invite_server_methods =
{
SIP_METHOD_INVITE,
nua_i_invite, /* Event */
- {
+ {
1, /* Create dialog */
0, /* Initial request */
1, /* Target refresh request */
@@ -2004,8 +2004,8 @@
};
-/** @internal Preprocess incoming invite - sure we have a valid request.
- *
+/** @internal Preprocess incoming invite - sure we have a valid request.
+ *
* @return 0 if request is valid, or error statuscode otherwise
*/
static int
@@ -2022,9 +2022,9 @@
if (nua_session_server_init(sr))
return sr->sr_status;
-
+
if (sr->sr_usage) {
- /* Existing session - check for overlap and glare */
+ /* Existing session - check for overlap and glare */
nua_server_request_t const *sr0;
nua_client_request_t const *cr;
@@ -2040,7 +2040,7 @@
if (sr->sr_sdp && sr0->sr_offer_recv && !sr0->sr_answer_sent)
break;
}
-
+
if (sr0) {
/* Overlapping invites - RFC 3261 14.2 */
return nua_server_retry_after(sr, 500, "Overlapping Requests", 0, 10);
@@ -2148,9 +2148,9 @@
soa_init_offer_answer(nh->nh_soa);
if (sr->sr_sdp) {
- if (nh->nh_soa &&
+ if (nh->nh_soa &&
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
- SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
+ SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
"INVITE"));
return SR_STATUS(sr, 400, "Bad Session Description");
}
@@ -2185,7 +2185,7 @@
if (NH_PGET(nh, auto_answer) ||
/* Auto-answer to re-INVITE unless auto_answer is set to 0 on handle */
(ss->ss_state == nua_callstate_ready &&
- /* Auto-answer requires enabled media (soa).
+ /* Auto-answer requires enabled media (soa).
* XXX - if the re-INVITE modifies the media we should not auto-answer.
*/
nh->nh_soa &&
@@ -2216,8 +2216,8 @@
nua_handle_t *nh = sr->sr_owner;
nua_dialog_usage_t *du = sr->sr_usage;
nua_session_usage_t *ss = nua_dialog_usage_private(du);
- msg_t *msg = sr->sr_response.msg;
- sip_t *sip = sr->sr_response.sip;
+ msg_t *msg = sr->sr_response.msg;
+ sip_t *sip = sr->sr_response.sip;
int reliable = 0, maybe_answer = 0, offer = 0, answer = 0, extra = 0;
@@ -2239,7 +2239,7 @@
if (sr->sr_neutral)
return nua_base_server_respond(sr, tags);
}
- else if (tags && 100 < sr->sr_status && sr->sr_status < 200 &&
+ else if (tags && 100 < sr->sr_status && sr->sr_status < 200 &&
!NHP_ISSET(nh->nh_prefs, early_answer)) {
sdp_session_t const *user_sdp = NULL;
char const *user_sdp_str = NULL;
@@ -2275,7 +2275,7 @@
extra = t && t->t_value;
}
else if (sr->sr_offer_recv && !sr->sr_answer_sent && maybe_answer) {
- /* Generate answer */
+ /* Generate answer */
if (soa_generate_answer(nh->nh_soa, NULL) >= 0 &&
soa_activate(nh->nh_soa, NULL) >= 0) {
answer = 1; /* signal that O/A answer sent (answer to invite) */
@@ -2287,11 +2287,11 @@
int wcode;
char const *text;
char const *host = "invalid.";
-
+
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
-
+
wcode = soa_get_warning(nh->nh_soa, &text);
-
+
if (wcode) {
if (sip->sip_contact)
host = sip->sip_contact->m_url->url_host;
@@ -2344,7 +2344,7 @@
if (200 <= sr->sr_status && sr->sr_status < 300) {
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -2354,7 +2354,7 @@
session_timer_add_headers(ss->ss_timer, 0, msg, sip);
}
- return nua_base_server_respond(sr, tags);
+ return nua_base_server_respond(sr, tags);
}
/** Check if the response should be sent reliably.
@@ -2415,9 +2415,9 @@
}
retval = nua_base_server_report(sr, tags), sr = NULL; /* destroys sr */
-
+
if (retval >= 2 || ss == NULL) {
- /* Session has been terminated. */
+ /* Session has been terminated. */
if (!initial && !neutral) {
#if 0
signal_call_state_change(nh, NULL, status, phrase,
@@ -2483,8 +2483,8 @@
/** @NUA_EVENT nua_i_ack
*
- * Final response to INVITE has been acknowledged by UAC with ACK.
- *
+ * Final response to INVITE has been acknowledged by UAC with ACK.
+ *
* @note This event is only sent after 2XX response.
*
* @param nh operation handle associated with the call
@@ -2493,7 +2493,7 @@
* @param tags empty
*
* @sa #nua_i_invite, #nua_i_state, @ref nua_uas_call_model, nua_ack()
- *
+ *
* @END_NUA_EVENT
*/
static
@@ -2521,7 +2521,7 @@
ss->ss_oa_recv = recv;
}
- if (nh->nh_soa == NULL)
+ if (nh->nh_soa == NULL)
;
else if (recv == NULL ) {
if (ss->ss_state >= nua_callstate_ready &&
@@ -2530,7 +2530,7 @@
url_t const *m;
/* The re-INVITE was a refresh and re-INVITEr ignored our offer */
- ss->ss_oa_sent = NULL;
+ ss->ss_oa_sent = NULL;
if (sr->sr_request.sip->sip_contact)
m = sr->sr_request.sip->sip_contact->m_url;
@@ -2538,20 +2538,20 @@
m = sr->sr_request.sip->sip_from->a_url;
SU_DEBUG_3(("nua(%p): re-INVITEr ignored offer in our %u response "
- "(Contact: <" URL_PRINT_FORMAT ">)\n",
+ "(Contact: <" URL_PRINT_FORMAT ">)\n",
(void *)nh, sr->sr_status, URL_PRINT_ARGS(m)));
if (sr->sr_request.sip->sip_user_agent)
SU_DEBUG_3(("nua(%p): re-INVITE: \"User-Agent: %s\"\n", (void *)nh,
sr->sr_request.sip->sip_user_agent->g_string));
- }
- else
- return process_ack_error(sr, msg, 488, "Offer-Answer error",
+ }
+ else
+ return process_ack_error(sr, msg, 488, "Offer-Answer error",
"SIP;cause=488;text=\"No answer to offer\"");
}
else if (soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) >= 0 &&
soa_process_answer(nh->nh_soa, NULL) >= 0 &&
soa_activate(nh->nh_soa, NULL) >= 0) {
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
else {
int status; char const *phrase, *reason;
@@ -2575,7 +2575,7 @@
return 0;
}
-static int
+static int
process_ack_error(nua_server_request_t *sr,
msg_t *ackmsg,
int status,
@@ -2585,14 +2585,14 @@
nua_handle_t *nh = sr->sr_owner;
nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage);
int error;
-
+
nua_stack_event(nh->nh_nua, nh, ackmsg,
nua_i_ack, status, phrase, NULL);
nua_stack_event(nh->nh_nua, nh, NULL,
nua_i_media_error, status, phrase, NULL);
if (reason) ss->ss_reason = reason;
- ss->ss_reporting = 1;
+ ss->ss_reporting = 1;
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
ss->ss_reporting = 0;
@@ -2668,7 +2668,7 @@
if (nua_server_request_is_pending(sr)) {
/* PRACK timeout */
SR_STATUS1(sr, SIP_504_GATEWAY_TIME_OUT);
- nua_server_trespond(sr,
+ nua_server_trespond(sr,
SIPTAG_REASON_STR(reason),
TAG_END());
if (nua_server_report(sr) >= 2)
@@ -2709,7 +2709,7 @@
* @param tags empty
*
* @sa nua_prack(), #nua_r_prack, @RFC3262, NUTAG_EARLY_MEDIA()
- *
+ *
* @END_NUA_EVENT
*/
@@ -2717,11 +2717,11 @@
int nua_prack_server_respond(nua_server_request_t *sr, tagi_t const *tags);
int nua_prack_server_report(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_prack_server_methods =
+nua_server_methods_t const nua_prack_server_methods =
{
SIP_METHOD_PRACK,
nua_i_prack, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
1, /* Target refresh request */
@@ -2744,7 +2744,7 @@
nua_dialog_usage_t *du;
nta_reliable_destroy(rel);
- if (irq == NULL)
+ if (irq == NULL)
/* Final response interrupted 100rel, we did not actually receive PRACK */
return 200;
@@ -2787,7 +2787,7 @@
if (sri == NULL)
return SR_STATUS(sr, 481, "No Such Preliminary Response");
-
+
if (nua_session_server_init(sr))
return sr->sr_status;
@@ -2796,7 +2796,7 @@
char const *offeranswer;
/* XXX - check for overlap? */
-
+
if (sri->sr_offer_sent && !sri->sr_answer_recv)
sr->sr_answer_recv = 1, sri->sr_answer_recv = 1, offeranswer = Answer;
else
@@ -2808,7 +2808,7 @@
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"PRACK", offeranswer));
- return
+ return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
}
@@ -2820,7 +2820,7 @@
{
nua_handle_t *nh = sr->sr_owner;
- if (sr->sr_status < 200 || 300 <= sr->sr_status)
+ if (sr->sr_status < 200 || 300 <= sr->sr_status)
return nua_base_server_respond(sr, tags);
if (sr->sr_sdp) {
@@ -2834,8 +2834,8 @@
}
else if ((sr->sr_offer_recv && soa_generate_answer(nh->nh_soa, NULL) < 0) ||
(sr->sr_answer_recv && soa_process_answer(nh->nh_soa, NULL) < 0)) {
- SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
- (void *)nh, "PRACK",
+ SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
+ (void *)nh, "PRACK",
"error processing",
sr->sr_offer_recv ? Offer : Answer));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
@@ -2865,7 +2865,7 @@
if (retval >= 2 || ss == NULL) {
#if 0
signal_call_state_change(nh, NULL,
- status, phrase,
+ status, phrase,
nua_callstate_terminated);
#endif
return retval;
@@ -2874,11 +2874,11 @@
if (offer_recv_or_answer_sent) {
/* signal offer received, answer sent */
signal_call_state_change(nh, ss,
- status, phrase,
+ status, phrase,
ss->ss_state);
if (nh->nh_soa) {
soa_activate(nh->nh_soa, NULL);
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
@@ -2888,15 +2888,15 @@
assert(sri);
if (sri == NULL) {
-
+
}
else if (SR_HAS_SAVED_SIGNAL(sri)) {
nua_signal_data_t const *e;
-
+
e = nua_signal_data(sri->sr_signal);
sri->sr_application = SR_STATUS(sri, e->e_status, e->e_phrase);
-
+
nua_server_params(sri, e->e_tags);
nua_server_respond(sri, e->e_tags);
nua_server_report(sri);
@@ -3028,15 +3028,15 @@
/**@fn void nua_info(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Send an INFO request.
+ * Send an INFO request.
*
- * INFO is used to send call related information like DTMF
+ * INFO is used to send call related information like DTMF
* digit input events. See @RFC2976.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3048,7 +3048,7 @@
* @sa #nua_i_info
*/
-static int nua_info_client_init(nua_client_request_t *cr,
+static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
@@ -3080,7 +3080,7 @@
return nua_client_create(nh, e, &nua_info_client_methods, tags);
}
-static int nua_info_client_init(nua_client_request_t *cr,
+static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3118,7 +3118,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to @b INFO or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -3139,15 +3139,15 @@
* @param tags empty
*
* @sa nua_info(), #nua_r_info, @RFC2976
- *
+ *
* @END_NUA_EVENT
*/
-nua_server_methods_t const nua_info_server_methods =
+nua_server_methods_t const nua_info_server_methods =
{
SIP_METHOD_INFO,
nua_i_info, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
0, /* Not a target refresh request */
@@ -3165,8 +3165,8 @@
/**@fn void nua_update(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Update a session.
- *
+ * Update a session.
+ *
* Update a session using SIP UPDATE method. See @RFC3311.
*
* Update method can be used when the session has been established with
@@ -3177,7 +3177,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3191,7 +3191,7 @@
* @sa @ref nua_call_model, @RFC3311, nua_update(), #nua_i_update
*/
-static int nua_update_client_init(nua_client_request_t *cr,
+static int nua_update_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_update_client_request(nua_client_request_t *cr,
@@ -3230,7 +3230,7 @@
return nua_client_create(nh, e, &nua_update_client_methods, tags);
}
-static int nua_update_client_init(nua_client_request_t *cr,
+static int nua_update_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3252,7 +3252,7 @@
nua_server_request_t *sr;
nua_client_request_t *cri;
int offer_sent = 0, retval;
-
+
if (du == NULL) /* Call terminated */
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
@@ -3294,7 +3294,7 @@
/* Add session timer headers */
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -3368,7 +3368,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to UPDATE request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -3387,7 +3387,7 @@
nua_dialog_usage_t *du = cr->cr_usage;
nua_session_usage_t *ss = nua_dialog_usage_private(du);
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -3405,7 +3405,7 @@
/* There is an un-ACK-ed INVITE there */
assert(du->du_cr->cr_method == sip_method_invite);
- if (NH_PGET(nh, auto_ack) ||
+ if (NH_PGET(nh, auto_ack) ||
/* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
(ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
if (nua_invite_client_ack(du->du_cr, NULL) > 0)
@@ -3429,11 +3429,11 @@
int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags);
int nua_update_server_report(nua_server_request_t *, tagi_t const *);
-nua_server_methods_t const nua_update_server_methods =
+nua_server_methods_t const nua_update_server_methods =
{
SIP_METHOD_UPDATE,
nua_i_update, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
1, /* Target refresh request */
@@ -3498,7 +3498,7 @@
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"UPDATE", Offer));
- return
+ return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
@@ -3524,7 +3524,7 @@
sr->sr_answer_sent = 1, ss ? ss->ss_oa_sent = Answer : Answer;
}
else if (soa_generate_answer(nh->nh_soa, NULL) < 0) {
- SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
+ SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
(void *)nh, "UPDATE", "error processing", Offer));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
@@ -3538,14 +3538,14 @@
}
else {
sr->sr_answer_sent = 1, ss->ss_oa_sent = Answer;
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
if (200 <= sr->sr_status && sr->sr_status < 300) {
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -3597,7 +3597,7 @@
if (retval >= 2 || ss == NULL) {
#if 0
- signal_call_state_change(nh, NULL, status, phrase,
+ signal_call_state_change(nh, NULL, status, phrase,
nua_callstate_terminated);
#endif
return retval;
@@ -3606,7 +3606,7 @@
if (offer_recv_or_answer_sent) {
/* signal offer received, answer sent */
enum nua_callstate state = ss->ss_state;
-
+
if (state == nua_callstate_ready && status < 200)
state = nua_callstate_received;
@@ -3615,13 +3615,13 @@
if (200 <= status && status < 300
&& ss->ss_state < nua_callstate_ready
- && ss->ss_precondition
+ && ss->ss_precondition
&& !ss->ss_alerting
&& NH_PGET(nh, auto_alert)) {
nua_server_request_t *sri;
-
+
for (sri = nh->nh_ds->ds_sr; sri; sri = sr->sr_next)
- if (sri->sr_method == sip_method_invite &&
+ if (sri->sr_method == sip_method_invite &&
nua_server_request_is_pending(sri))
break;
@@ -3642,13 +3642,13 @@
*
* Hangdown a call.
*
- * Hangdown a call using SIP BYE method. Also the media session
- * associated with the call is terminated.
+ * Hangdown a call using SIP BYE method. Also the media session
+ * associated with the call is terminated.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3659,7 +3659,7 @@
* #nua_i_media_error
*/
-static int nua_bye_client_init(nua_client_request_t *cr,
+static int nua_bye_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_bye_client_request(nua_client_request_t *cr,
@@ -3694,7 +3694,7 @@
{
nua_session_usage_t *ss = nua_session_usage_for_dialog(nh->nh_ds);
- if (ss &&
+ if (ss &&
nua_callstate_calling <= ss->ss_state &&
ss->ss_state <= nua_callstate_proceeding)
return nua_client_create(nh, e, &nua_cancel_client_methods, tags);
@@ -3702,7 +3702,7 @@
return nua_client_create(nh, e, &nua_bye_client_methods, tags);
}
-static int nua_bye_client_init(nua_client_request_t *cr,
+static int nua_bye_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3778,12 +3778,12 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to BYE request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
* @sa nua_bye(), @ref nua_call_model, #nua_i_state, #nua_r_invite()
- *
+ *
* @END_NUA_EVENT
*/
@@ -3796,7 +3796,7 @@
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = cr->cr_usage;
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -3821,7 +3821,7 @@
nua_client_bind(cr, NULL);
- signal_call_state_change(nh, ss, status, "to BYE",
+ signal_call_state_change(nh, ss, status, "to BYE",
nua_callstate_terminated);
for (cri = du->du_dialog->ds_cr; cri; cri = cri->cr_next) {
@@ -3857,11 +3857,11 @@
int nua_bye_server_init(nua_server_request_t *sr);
int nua_bye_server_report(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_bye_server_methods =
+nua_server_methods_t const nua_bye_server_methods =
{
SIP_METHOD_BYE,
nua_i_bye, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
0, /* Not a target refresh request */
@@ -3949,7 +3949,7 @@
*
* @brief Call state has changed.
*
- * This event will be sent whenever the call state changes.
+ * This event will be sent whenever the call state changes.
*
* In addition to basic changes of session status indicated with enum
* ::nua_callstate, the @RFC3264 SDP Offer/Answer negotiation status is also
@@ -3977,7 +3977,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip NULL
- * @param tags NUTAG_CALLSTATE(),
+ * @param tags NUTAG_CALLSTATE(),
* SOATAG_LOCAL_SDP(), SOATAG_LOCAL_SDP_STR(),
* NUTAG_OFFER_SENT(), NUTAG_ANSWER_SENT(),
* SOATAG_REMOTE_SDP(), SOATAG_REMOTE_SDP_STR(),
@@ -3986,7 +3986,7 @@
* SOATAG_ACTIVE_IMAGE(), SOATAG_ACTIVE_CHAT().
*
* @sa @ref nua_call_model, #nua_i_active, #nua_i_terminated,
- * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(),
+ * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(),
* NUTAG_MEDIA_ENABLE(),
* NUTAG_AUTOALERT(), NUTAG_AUTOANSWER(), NUTAG_EARLY_MEDIA(),
* NUTAG_EARLY_ANSWER(), NUTAG_INCLUDE_EXTRA_SDP(),
@@ -4075,14 +4075,14 @@
next_state = ss->ss_state;
else if (ss->ss_state == nua_callstate_terminating)
return;
- else
+ else
ss->ss_state = next_state = nua_callstate_terminated;
}
else if (next_state > ss_state)
ss->ss_state = next_state;
}
- if (next_state == nua_callstate_init)
+ if (next_state == nua_callstate_init)
next_state = nua_callstate_terminated;
if (ss && ss->ss_state == nua_callstate_ready)
@@ -4165,7 +4165,7 @@
*
* @deprecated Use #nua_i_state instead.
*
- * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated,
+ * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated,
* #nua_i_invite
*
* @END_NUA_EVENT
@@ -4222,7 +4222,7 @@
return t->local.supported;
}
-/** Set session timer preferences */
+/** Set session timer preferences */
static
void session_timer_preferences(struct session_timer *t,
sip_t const *sip,
@@ -4260,7 +4260,7 @@
t->local.min_se = sip->sip_min_se->min_delta;
if (t->local.expires != 0 && t->local.min_se > t->local.expires)
t->local.expires = t->local.min_se;
-
+
return nua_client_restart(cr, 100, "Re-Negotiating Session Timer");
}
}
@@ -4301,7 +4301,7 @@
/* Include extension parameters, if any */
if (request->sip_min_se)
min_se->min_params = request->sip_min_se->min_params;
-
+
sip_add_dup(msg, sip, (sip_header_t *)min_se);
return 422;
@@ -4310,7 +4310,7 @@
return 0;
}
-/** Store session timer parameters in request from uac / response from uas */
+/** Store session timer parameters in request from uac / response from uas */
static
void session_timer_store(struct session_timer *t,
sip_t const *sip)
@@ -4349,7 +4349,7 @@
}
/** Add timer feature and Session-Expires/Min-SE headers to request/response
- *
+ *
*/
static int
session_timer_add_headers(struct session_timer *t,
@@ -4377,7 +4377,7 @@
if (uas) {
session_timer_negotiate(t);
-
+
refresher = t->refresher;
expires = t->interval;
}
@@ -4440,7 +4440,7 @@
t->interval = t->local.expires;
if (t->local.defaults != 0 && t->interval > t->local.defaults)
t->interval = t->local.defaults;
-
+
if (t->interval != 0) {
if (t->interval < t->local.min_se)
t->interval = t->local.min_se;
@@ -4652,11 +4652,11 @@
int nua_options_server_respond(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_options_server_methods =
+nua_server_methods_t const nua_options_server_methods =
{
SIP_METHOD_OPTIONS,
nua_i_options, /* Event */
- {
+ {
0, /* Do not create dialog */
0, /* Initial request */
0, /* Not a target refresh request */
1
0
[commit] r10832 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by FreeSWITCH SVN 16 Dec '08
by FreeSWITCH SVN 16 Dec '08
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:22:43 2008
New Revision: 10832
Log:
Thu Nov 27 06:09:44 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* nua_session.c: use signed ss_sdp_version (soa_get_user_version() returns int)
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:22:43 2008
@@ -1 +1 @@
-Tue Dec 16 15:20:42 CST 2008
+Tue Dec 16 15:22:24 CST 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:22:43 2008
@@ -173,7 +173,7 @@
char const *ss_oa_recv, *ss_oa_sent;
/**< Version of user SDP from latest successful O/A */
- unsigned ss_sdp_version;
+ int ss_sdp_version;
} nua_session_usage_t;
static char const Offer[] = "offer", Answer[] = "answer";
1
0
Author: mikej
Date: Tue Dec 16 16:22:01 2008
New Revision: 10831
Log:
Wed Nov 26 13:18:57 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* configure.ac: bumped version number
Modified:
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:22:01 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9devel1])
+AC_INIT([sofia-sip], [1.12.9pre10rc1])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
[commit] r10830 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by FreeSWITCH SVN 16 Dec '08
by FreeSWITCH SVN 16 Dec '08
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:21:04 2008
New Revision: 10830
Log:
Fri Nov 21 08:12:28 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* nua_session.c: call soa_activate() only when nh->nh_soa is valid
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:21:04 2008
@@ -1 +1 @@
-Tue Dec 16 15:19:47 CST 2008
+Tue Dec 16 15:20:42 CST 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:21:04 2008
@@ -1315,8 +1315,9 @@
;
else if (nh->nh_soa && soa_is_complete(nh->nh_soa)) {
/* signal SOA that O/A round(s) is (are) complete */
- if (soa_activate(nh->nh_soa, NULL) >= 0)
+ if (soa_activate(nh->nh_soa, NULL) >= 0) {
ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
}
else if (nh->nh_soa == NULL
/* NUA does not necessarily know dirty details */
@@ -1748,8 +1749,9 @@
}
else {
answer_sent = 1;
- if (soa_activate(nh->nh_soa, NULL) >= 0)
+ if (soa_activate(nh->nh_soa, NULL) >= 0) {
ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
}
}
else if (nh->nh_soa == NULL) {
@@ -2326,8 +2328,9 @@
else if (answer)
sr->sr_answer_sent = 1 + reliable, ss->ss_oa_sent = Answer;
- if (answer && reliable)
+ if (answer && reliable && nh->nh_soa) {
ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
}
if (reliable && sr->sr_status < 200) {
1
0
[commit] r10829 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua libsofia-sip-ua/nua/sofia-sip
by FreeSWITCH SVN 16 Dec '08
by FreeSWITCH SVN 16 Dec '08
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:20:22 2008
New Revision: 10829
Log:
Fri Nov 21 04:52:55 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* nua: try to cope if a re-INVITE nor its ACK contain SDP
Some SIP user-agents use INVITE without SDP offer to refresh session.
By default, NUA sends an offer in 200 OK to such an INVITE and expects
an answer back in ACK. Now nua tries to recover from such a Offer/Answer
protocol error.
Also, if NUTAG_REFRESH_WITHOUT_SDP(1) tag is used, and if the re-INVITE was
received without SDP, no SDP offer is sent in 200 OK.
Thanks for Anthony Minessale for reporting the problem.
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:20:22 2008
@@ -1 +1 @@
-Tue Dec 16 14:46:55 CST 2008
+Tue Dec 16 15:19:47 CST 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c Tue Dec 16 16:20:22 2008
@@ -1077,6 +1077,71 @@
}
END_TEST
+START_TEST(call_2_3_3)
+{
+ nua_handle_t *nh;
+ struct message *response;
+
+ s2_case("2.3.3", "Handling re-INVITE without SDP gracefully",
+ "NUA receives INVITE, "
+ "re-INVITE without SDP (w/o NUTAG_REFRESH_WITHOUT_SDP(), "
+ "re-INVITE without SDP (using NUTAG_REFRESH_WITHOUT_SDP(), "
+ "sends BYE.");
+
+ nh = invite_to_nua(
+ TAG_END());
+
+ s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
+ SIPTAG_USER_AGENT_STR("evil (evil) evil"),
+ TAG_END());
+
+ nua_respond(nh, SIP_200_OK, TAG_END());
+
+ fail_unless(s2_check_callstate(nua_callstate_completed));
+
+ response = s2_wait_for_response(200, SIP_METHOD_INVITE);
+
+ fail_if(!response);
+ s2_update_dialog(dialog, response);
+ fail_if(!response->sip->sip_content_type);
+ s2_free_message(response);
+
+ fail_if(s2_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+
+ fail_unless(s2_check_event(nua_i_ack, 200));
+ fail_unless(s2_check_callstate(nua_callstate_ready));
+
+ s2_fast_forward(10);
+
+ nua_set_hparams(nh, NUTAG_REFRESH_WITHOUT_SDP(1), TAG_END());
+ fail_unless(s2_check_event(nua_r_set_params, 200));
+
+ s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
+ SIPTAG_USER_AGENT_STR("evil (evil) evil"),
+ TAG_END());
+
+ nua_respond(nh, SIP_200_OK, TAG_END());
+
+ fail_unless(s2_check_callstate(nua_callstate_completed));
+
+ response = s2_wait_for_response(200, SIP_METHOD_INVITE);
+
+ fail_if(!response);
+ s2_update_dialog(dialog, response);
+ fail_if(response->sip->sip_content_type);
+ s2_free_message(response);
+
+ fail_if(s2_request_to(dialog, SIP_METHOD_ACK, NULL, TAG_END()));
+
+ fail_unless(s2_check_event(nua_i_ack, 200));
+ fail_unless(s2_check_callstate(nua_callstate_ready));
+
+ bye_by_nua(nh, TAG_END());
+
+ nua_handle_destroy(nh);
+}
+END_TEST
+
TCase *session_timer_tcase(void)
{
@@ -1085,6 +1150,7 @@
{
tcase_add_test(tc, call_2_3_1);
tcase_add_test(tc, call_2_3_2);
+ tcase_add_test(tc, call_2_3_3);
}
return tc;
}
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h Tue Dec 16 16:20:22 2008
@@ -116,6 +116,7 @@
unsigned sr_offer_sent:2; /**< We have offered SDP (reliably, if >1) */
unsigned sr_answer_recv:1; /**< We have received SDP answer */
+
unsigned :0;
char const *sr_sdp; /**< SDP received from client */
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c Tue Dec 16 16:20:22 2008
@@ -301,6 +301,7 @@
* NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
+ * NUTAG_REFRESH_WITHOUT_SDP() \n
* NUTAG_REGISTRAR() \n
* NUTAG_RETRY_COUNT() \n
* NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -422,6 +423,7 @@
* NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
+ * NUTAG_REFRESH_WITHOUT_SDP() \n
* NUTAG_REGISTRAR() \n
* NUTAG_RETRY_COUNT() \n
* NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -770,6 +772,10 @@
else if (tag == nutag_update_refresh) {
NHP_SET(nhp, update_refresh, value != 0);
}
+ /* NUTAG_REFRESH_WITHOUT_SDP(refresh_without_sdp) */
+ else if (tag == nutag_refresh_without_sdp) {
+ NHP_SET(nhp, refresh_without_sdp, value != 0);
+ }
/* NUTAG_ENABLEMESSAGE(message_enable) */
else if (tag == nutag_enablemessage) {
NHP_SET(nhp, message_enable, value != 0);
@@ -1478,6 +1484,7 @@
* NUTAG_PATH_ENABLE() \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
+ * NUTAG_REFRESH_WITHOUT_SDP() \n
* NUTAG_REGISTRAR() \n
* NUTAG_RETRY_COUNT() \n
* NUTAG_SERVICE_ROUTE_ENABLE() \n
@@ -1639,6 +1646,7 @@
TIF(NUTAG_MIN_SE, min_se),
TIFD(NUTAG_SESSION_REFRESHER, refresher),
TIF(NUTAG_UPDATE_REFRESH, update_refresh),
+ TIF(NUTAG_REFRESH_WITHOUT_SDP, refresh_without_sdp),
TIF(NUTAG_ENABLEMESSAGE, message_enable),
TIF(NUTAG_ENABLEMESSENGER, win_messenger_enable),
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h Tue Dec 16 16:20:22 2008
@@ -82,6 +82,9 @@
/** no (preference), local or remote */
enum nua_session_refresher nhp_refresher;
unsigned nhp_update_refresh:1; /**< Use UPDATE to refresh */
+
+ /**< Accept refreshes without SDP */
+ unsigned nhp_refresh_without_sdp:1;
/* Messaging preferences */
unsigned nhp_message_enable : 1;
@@ -164,6 +167,7 @@
unsigned nhb_min_se:1;
unsigned nhb_refresher:1;
unsigned nhb_update_refresh:1;
+ unsigned nhb_refresh_without_sdp:1;
unsigned nhb_message_enable:1;
unsigned nhb_win_messenger_enable:1;
unsigned nhb_message_auto_respond:1;
@@ -179,9 +183,9 @@
unsigned nhb_keepalive:1;
unsigned nhb_keepalive_stream:1;
unsigned nhb_registrar:1;
+ unsigned :0; /* at most 32 bits before this point */
unsigned nhb_allow:1;
- unsigned :0; /* at most 32 bits before this point */
unsigned nhb_supported:1;
unsigned nhb_allow_events:1;
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:20:22 2008
@@ -171,6 +171,9 @@
/* Offer-Answer status */
char const *ss_oa_recv, *ss_oa_sent;
+
+ /**< Version of user SDP from latest successful O/A */
+ unsigned ss_sdp_version;
} nua_session_usage_t;
static char const Offer[] = "offer", Answer[] = "answer";
@@ -964,11 +967,14 @@
/* XXX */
sdp = NULL;
}
- else if (soa_activate(nh->nh_soa, NULL) < 0)
+ else if (soa_activate(nh->nh_soa, NULL) < 0) {
/* XXX - what about errors? */
LOG3("error activating media after");
- else
+ }
+ else {
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
LOG5("processed SDP");
+ }
}
else if (cr->cr_method != sip_method_invite) {
/* If non-invite request did not have offer, ignore SDP in response */
@@ -1309,7 +1315,8 @@
;
else if (nh->nh_soa && soa_is_complete(nh->nh_soa)) {
/* signal SOA that O/A round(s) is (are) complete */
- soa_activate(nh->nh_soa, NULL);
+ if (soa_activate(nh->nh_soa, NULL) >= 0)
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
else if (nh->nh_soa == NULL
/* NUA does not necessarily know dirty details */
@@ -1741,7 +1748,8 @@
}
else {
answer_sent = 1;
- soa_activate(nh->nh_soa, NULL);
+ if (soa_activate(nh->nh_soa, NULL) >= 0)
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
else if (nh->nh_soa == NULL) {
@@ -1967,6 +1975,8 @@
process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
sip_t const *),
process_ack(nua_server_request_t *, nta_incoming_t *, sip_t const *),
+ process_ack_error(nua_server_request_t *sr, msg_t *ackmsg,
+ int status, char const *phrase, char const *reason),
process_cancel(nua_server_request_t *, nta_incoming_t *, sip_t const *),
process_timeout(nua_server_request_t *, nta_incoming_t *),
process_prack(nua_server_request_t *,
@@ -2207,7 +2217,7 @@
msg_t *msg = sr->sr_response.msg;
sip_t *sip = sr->sr_response.sip;
- int reliable = 0, offer = 0, answer = 0, early_answer = 0, extra = 0;
+ int reliable = 0, maybe_answer = 0, offer = 0, answer = 0, extra = 0;
enter;
@@ -2217,8 +2227,11 @@
return nua_base_server_respond(sr, tags);
}
- if (nua_invite_server_is_100rel(sr, tags)) {
- reliable = 1, early_answer = 1;
+ if (200 <= sr->sr_status && sr->sr_status < 300) {
+ reliable = 1, maybe_answer = 1;
+ }
+ else if (nua_invite_server_is_100rel(sr, tags)) {
+ reliable = 1, maybe_answer = 1;
}
else if (!nh->nh_soa || sr->sr_status >= 300) {
if (sr->sr_neutral)
@@ -2234,10 +2247,10 @@
SOATAG_USER_SDP_STR_REF(user_sdp_str),
TAG_END());
- early_answer = user_sdp || user_sdp_str;
+ maybe_answer = user_sdp || user_sdp_str;
}
else {
- early_answer = NH_PGET(nh, early_answer);
+ maybe_answer = NH_PGET(nh, early_answer);
}
if (!nh->nh_soa) {
@@ -2259,11 +2272,12 @@
tagi_t const *t = tl_find_last(tags, nutag_include_extra_sdp);
extra = t && t->t_value;
}
- else if (sr->sr_offer_recv && !sr->sr_answer_sent && early_answer) {
+ else if (sr->sr_offer_recv && !sr->sr_answer_sent && maybe_answer) {
/* Generate answer */
if (soa_generate_answer(nh->nh_soa, NULL) >= 0 &&
soa_activate(nh->nh_soa, NULL) >= 0) {
answer = 1; /* signal that O/A answer sent (answer to invite) */
+ /* ss_sdp_version is updated only after answer is sent reliably */
}
/* We have an error! */
else if (sr->sr_status >= 200) {
@@ -2288,12 +2302,16 @@
/* 1xx - we don't have to send answer */
}
}
- else if (sr->sr_offer_recv && sr->sr_answer_sent == 1 && early_answer) {
+ else if (sr->sr_offer_recv && sr->sr_answer_sent == 1 && maybe_answer) {
/* The answer was sent unreliably, keep sending it */
answer = 1;
}
else if (!sr->sr_offer_recv && !sr->sr_offer_sent && reliable) {
- /* Generate offer */
+ if (200 <= sr->sr_status && nua_callstate_ready <= ss->ss_state &&
+ NH_PGET(nh, refresh_without_sdp))
+ /* This is a re-INVITE without SDP - do not try to send offer in 200 */;
+ else
+ /* Generate offer */
if (soa_generate_offer(nh->nh_soa, 0, NULL) < 0)
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
else
@@ -2307,6 +2325,9 @@
sr->sr_offer_sent = 1 + reliable, ss->ss_oa_sent = Offer;
else if (answer)
sr->sr_answer_sent = 1 + reliable, ss->ss_oa_sent = Answer;
+
+ if (answer && reliable)
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
if (reliable && sr->sr_status < 200) {
@@ -2340,16 +2361,15 @@
int nua_invite_server_is_100rel(nua_server_request_t *sr, tagi_t const *tags)
{
nua_handle_t *nh = sr->sr_owner;
- sip_t const *sip = sr->sr_response.sip;
sip_require_t *require = sr->sr_request.sip->sip_require;
sip_supported_t *supported = sr->sr_request.sip->sip_supported;
if (sr->sr_status >= 200)
- return 1;
+ return 0;
else if (sr->sr_status == 100)
return 0;
- if (sip_has_feature(sip->sip_require, "100rel"))
+ if (sip_has_feature(sr->sr_response.sip->sip_require, "100rel"))
return 1;
if (require == NULL && supported == NULL)
@@ -2473,7 +2493,7 @@
*
* @END_NUA_EVENT
*/
-
+static
int process_ack(nua_server_request_t *sr,
nta_incoming_t *irq,
sip_t const *sip)
@@ -2489,7 +2509,6 @@
if (sr->sr_offer_sent && !sr->sr_answer_recv) {
char const *sdp;
size_t len;
- int error;
if (session_get_description(sip, &sdp, &len))
recv = Answer;
@@ -2499,32 +2518,45 @@
ss->ss_oa_recv = recv;
}
- if (nh->nh_soa == NULL)
+ if (nh->nh_soa == NULL)
;
- else if (recv == NULL ||
- soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) < 0 ||
- soa_process_answer(nh->nh_soa, NULL) < 0 ||
- soa_activate(nh->nh_soa, NULL) < 0) {
- int status; char const *phrase, *reason;
+ else if (recv == NULL ) {
+ if (ss->ss_state >= nua_callstate_ready &&
+ soa_get_user_version(nh->nh_soa) == ss->ss_sdp_version &&
+ soa_process_reject(nh->nh_soa, NULL) >= 0) {
+ url_t const *m;
- status = soa_error_as_sip_response(nh->nh_soa, &phrase);
- reason = soa_error_as_sip_reason(nh->nh_soa);
+ /* The re-INVITE was a refresh and re-INVITEr ignored our offer */
+ ss->ss_oa_sent = NULL;
- nua_stack_event(nh->nh_nua, nh, msg,
- nua_i_ack, status, phrase, NULL);
- nua_stack_event(nh->nh_nua, nh, NULL,
- nua_i_media_error, status, phrase, NULL);
+ if (sr->sr_request.sip->sip_contact)
+ m = sr->sr_request.sip->sip_contact->m_url;
+ else
+ m = sr->sr_request.sip->sip_from->a_url;
- ss->ss_reporting = 1; /* We report terminated state here if BYE fails */
- error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
- ss->ss_reporting = 0;
+ SU_DEBUG_3(("nua(%p): re-INVITEr ignored offer in our %u response "
+ "(Contact: <" URL_PRINT_FORMAT ">)\n",
+ (void *)nh, sr->sr_status, URL_PRINT_ARGS(m)));
+ if (sr->sr_request.sip->sip_user_agent)
+ SU_DEBUG_3(("nua(%p): re-INVITE: \"User-Agent: %s\"\n", (void *)nh,
+ sr->sr_request.sip->sip_user_agent->g_string));
+ }
+ else
+ return process_ack_error(sr, msg, 488, "Offer-Answer error",
+ "SIP;cause=488;text=\"No answer to offer\"");
+ }
+ else if (soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) >= 0 &&
+ soa_process_answer(nh->nh_soa, NULL) >= 0 &&
+ soa_activate(nh->nh_soa, NULL) >= 0) {
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
+ else {
+ int status; char const *phrase, *reason;
- signal_call_state_change(nh, ss, 488, "Offer-Answer Error",
- error
- ? nua_callstate_terminated
- : nua_callstate_terminating);
+ status = soa_error_as_sip_response(nh->nh_soa, &phrase);
+ reason = soa_error_as_sip_reason(nh->nh_soa);
- return 0;
+ return process_ack_error(sr, msg, status, phrase, reason);
}
}
@@ -2540,6 +2572,38 @@
return 0;
}
+static int
+process_ack_error(nua_server_request_t *sr,
+ msg_t *ackmsg,
+ int status,
+ char const *phrase,
+ char const *reason)
+{
+ nua_handle_t *nh = sr->sr_owner;
+ nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage);
+ int error;
+
+ nua_stack_event(nh->nh_nua, nh, ackmsg,
+ nua_i_ack, status, phrase, NULL);
+ nua_stack_event(nh->nh_nua, nh, NULL,
+ nua_i_media_error, status, phrase, NULL);
+
+ if (reason) ss->ss_reason = reason;
+ ss->ss_reporting = 1;
+ error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
+ ss->ss_reporting = 0;
+
+ signal_call_state_change(nh, ss,
+ 488, "Offer-Answer Error",
+ /* We report terminated state if BYE failed */
+ error
+ ? nua_callstate_terminated
+ : nua_callstate_terminating);
+
+ return 0;
+}
+
+
/** @NUA_EVENT nua_i_cancel
*
* Incoming INVITE has been cancelled by the client.
@@ -2809,8 +2873,10 @@
signal_call_state_change(nh, ss,
status, phrase,
ss->ss_state);
- if (nh->nh_soa)
+ if (nh->nh_soa) {
soa_activate(nh->nh_soa, NULL);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ }
}
if (status < 200 || 300 <= status)
@@ -3469,6 +3535,7 @@
}
else {
sr->sr_answer_sent = 1, ss->ss_oa_sent = Answer;
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c Tue Dec 16 16:20:22 2008
@@ -182,7 +182,8 @@
* UPDATE requests.
* Settings:
* - NUTAG_MIN_SE(), NUTAG_SESSION_REFRESHER(),
- * NUTAG_SESSION_TIMER(), NUTAG_UPDATE_REFRESH()
+ * NUTAG_SESSION_TIMER(), NUTAG_UPDATE_REFRESH(),
+ * NUTAG_REFRESH_WITHOUT_SDP(),
* - "timer" in NUTAG_SUPPORTED()/SIPTAG_SUPPORTED()
* Specifications:
* - @RFC4028
@@ -954,6 +955,11 @@
* @SessionExpires header sends a re-INVITE requests (or an UPDATE
* request if NUTAG_UPDATE_REFRESH(1) parameter tag has been set).
*
+ * Some SIP user-agents use INVITE without SDP offer to refresh session.
+ * By default, NUA sends an offer in 200 OK to such an INVITE and expects
+ * an answer back in ACK. If NUTAG_REFRESH_WITHOUT_SDP(1) tag is used,
+ * no SDP offer is sent in 200 OK if re-INVITE was received without SDP.
+ *
* @par When to Use NUTAG_SESSION_TIMER()?
*
* The session time extension is enabled ("timer" feature tag is included in
@@ -1106,7 +1112,7 @@
* Corresponding tag taking reference parameter is NUTAG_UPDATE_REFRESH_REF().
*
* @sa #nua_r_update, NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
- * NUTAG_UPDATE_REFRESH(), @RFC4028, @SessionExpires, @MinSE
+ * NUTAG_SESSION_REFRESHER(), @RFC4028, @SessionExpires, @MinSE
*/
tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
@@ -1115,6 +1121,45 @@
*/
+/**@def NUTAG_REFRESH_WITHOUT_SDP(x)
+ *
+ * Do not send offer in response if re-INVITE was received without SDP.
+ *
+ * Some SIP user-agents use INVITE without SDP offer to refresh session.
+ * By default, NUA sends an offer in 200 OK to such an INVITE and expects
+ * an answer back in ACK.
+ *
+ * If NUTAG_REFRESH_WITHOUT_SDP(1) tag is used, no SDP offer is sent in 200
+ * OK if re-INVITE was received without SDP.
+ *
+ * @par Used with
+ * nua_handle(), nua_invite(), nua_update(), nua_respond() \n
+ * nua_set_params() or nua_set_hparams() \n
+ * nua_get_params() or nua_get_hparams()
+ *
+ * See nua_set_hparams() for a complete list of all the nua operations that
+ * accept this tag.
+ *
+ * @par Parameter type
+ * int (boolean: nonzero is true, zero is false)
+ *
+ * @par Values
+ * - 1 (true, do not try to send offer in response to re-INVITE)
+ * - 0 (false, always use SDP offer-answer in re-INVITEs)
+ *
+ * Corresponding tag taking reference parameter is NUTAG_REFRESH_WITHOUT_SDP_REF().
+ *
+ * @sa #nua_r_update, NUTAG_SESSION_TIMER(), NUTAG_MIN_SE_REF(),
+ * NUTAG_SESSION_REFRESHER(), NUTAG_UPDATE_REFRESH(), @RFC4028,
+ * @SessionExpires, @MinSE
+ */
+tag_typedef_t nutag_refresh_without_sdp = BOOLTAG_TYPEDEF(refresh_without_sdp);
+
+/**@def NUTAG_REFRESH_WITHOUT_SDP_REF(x)
+ * Reference tag for NUTAG_REFRESH_WITHOUT_SDP_REF().
+ */
+
+
/**@def NUTAG_REFER_EXPIRES()
*
* Default lifetime for implicit subscriptions created by REFER.
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/sofia-sip/nua_tag.h Tue Dec 16 16:20:22 2008
@@ -183,6 +183,12 @@
#define NUTAG_UPDATE_REFRESH_REF(x) nutag_update_refresh_ref, tag_bool_vr((&(x)))
SOFIAPUBVAR tag_typedef_t nutag_update_refresh_ref;
+#define NUTAG_REFRESH_WITHOUT_SDP(x) nutag_refresh_without_sdp, tag_bool_v((x))
+SOFIAPUBVAR tag_typedef_t nutag_refresh_without_sdp;
+#define NUTAG_REFRESH_WITHOUT_SDP_REF(x) \
+ nutag_refresh_without_sdp_ref, tag_bool_vr((&(x)))
+SOFIAPUBVAR tag_typedef_t nutag_refresh_without_sdp_ref;
+
#define NUTAG_AUTOALERT(x) nutag_autoalert, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_autoalert;
#define NUTAG_AUTOALERT_REF(x) nutag_autoalert_ref, tag_bool_vr(&(x))
1
0