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
September 2008
- 13 participants
- 335 discussions
[Freeswitch-svn] [commit] r9423 - freeswitch/trunk/src/mod/applications/mod_fax
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: brian
Date: Wed Sep 3 14:47:05 2008
New Revision: 9423
Modified:
freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
Log:
tweaks from agx
Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c Wed Sep 3 14:47:05 2008
@@ -40,14 +40,20 @@
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
t30_stats_t t;
- char local_ident[21];
- char far_ident[21];
+ const char *local_ident = NULL;
+ const char *far_ident = NULL;
if (result == T30_ERR_OK)
{
t30_get_transfer_statistics(s, &t);
- t30_get_far_ident(s, far_ident);
- t30_get_local_ident(s, local_ident);
+ far_ident = t30_get_tx_ident(s);
+ if (!switch_strlen_zero(far_ident)) {
+ far_ident = "";
+ }
+ local_ident = t30_get_rx_ident(s);
+ if (!switch_strlen_zero(local_ident)) {
+ local_ident = "";
+ }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully received.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote station id: %s\n", far_ident);
@@ -65,7 +71,7 @@
}
}
-static void phase_d_handler(t30_state_t *s, void *user_data, int result)
+static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
t30_stats_t t;
@@ -83,6 +89,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image size (bytes) %i\n", t.image_size);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
}
+ return T30_ERR_OK;
}
SWITCH_STANDARD_APP(rxfax_function)
@@ -140,8 +147,8 @@
}
fax_init(&fax, calling_party);
- t30_set_local_ident(&fax.t30_state, "test");
- t30_set_header_info(&fax.t30_state, "test");
+ t30_set_tx_ident(&fax.t30_state, "test");
+ t30_set_tx_page_header_info(&fax.t30_state, "test");
t30_set_rx_file(&fax.t30_state, file_name, -1);
t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, NULL);
@@ -202,15 +209,14 @@
}
SWITCH_MODULE_LOAD_FUNCTION(mod_fax_load)
-
{
switch_application_interface_t *app_interface;
-
+
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
-
+
SWITCH_ADD_APP(app_interface, "rxfax", "Trivial FAX Receive Application", "Trivial FAX Receive Application", rxfax_function, "", SAF_NONE);
-
+
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}
1
0
[Freeswitch-svn] [commit] r9422 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:32:12 2008
New Revision: 9422
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
Log:
Wed Sep 3 14:21:06 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* nua: using nua_client_set_terminating()
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Sep 3 14:32:12 2008
@@ -1 +1 @@
-Wed Sep 3 14:29:36 EDT 2008
+Wed Sep 3 14:31:22 EDT 2008
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 Wed Sep 3 14:32:12 2008
@@ -564,9 +564,9 @@
}
/** Mark client request as a terminating one */
-su_inline void nua_client_terminating(nua_client_request_t *cr)
+su_inline void nua_client_set_terminating(nua_client_request_t *cr, int value)
{
- cr->cr_terminating = 1;
+ cr->cr_terminating = value != 0;
}
int nua_client_init_request(nua_client_request_t *cr);
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c Wed Sep 3 14:32:12 2008
@@ -696,7 +696,7 @@
#endif
if (nu->nu_substate == nua_substate_terminated)
- cr->cr_terminating = 1;
+ nua_client_set_terminating(cr, 1);
if (cr->cr_terminating) {
nua_server_request_t *sr;
@@ -704,7 +704,7 @@
if (sr->sr_usage == du) {
/* If subscribe has not been responded, don't terminate usage by NOTIFY */
sr->sr_terminating = 1;
- cr->cr_terminating = 0;
+ nua_client_set_terminating(cr, 0);
break;
}
}
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c Wed Sep 3 14:32:12 2008
@@ -338,7 +338,7 @@
cr->cr_event != nua_r_publish ||
(du && du->du_shutdown) ||
(sip->sip_expires && sip->sip_expires->ex_delta == 0);
- cr->cr_terminating = un;
+ nua_client_set_terminating(cr, un);
done = un;
if (du) {
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c Wed Sep 3 14:32:12 2008
@@ -645,7 +645,7 @@
unreg = cr->cr_event != nua_r_register ||
(sip->sip_expires && sip->sip_expires->ex_delta == 0);
if (unreg)
- nua_client_terminating(cr);
+ nua_client_set_terminating(cr, 1);
du = nua_dialog_usage_add(nh, nh->nh_ds, nua_register_usage, NULL);
if (du == NULL)
@@ -725,7 +725,7 @@
if ((du && du->du_shutdown) ||
(sip->sip_expires && sip->sip_expires->ex_delta == 0))
- nua_client_terminating(cr);
+ nua_client_set_terminating(cr, 1);
if (contacts) {
if (!cr->cr_terminating) {
@@ -734,7 +734,7 @@
break;
/* All contacts have expires=0 */
if (m == NULL)
- nua_client_terminating(cr);
+ nua_client_set_terminating(cr, 1);
}
}
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c Wed Sep 3 14:32:12 2008
@@ -1966,7 +1966,7 @@
*
* @par Terminating Dialog Usages and Dialogs
*
- * The response can be marked as terminating with nua_client_terminating().
+ * The response is marked as terminating with nua_client_set_terminating().
* When a terminating request completes the dialog usage is removed and the
* dialog is destroyed (unless there is an another active usage).
*/
@@ -2499,7 +2499,7 @@
if (sip_add_tagis(cr->cr_msg, NULL, &tags) < 0)
/* XXX */;
- cr->cr_terminating = terminating;
+ nua_client_set_terminating(cr, terminating);
return nua_client_request_try(cr);
}
@@ -2528,7 +2528,7 @@
}
if (terminating)
- cr->cr_terminating = terminating;
+ nua_client_set_terminating(cr, terminating);
if (nua_client_request_queue(cr))
return 0;
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c Wed Sep 3 14:32:12 2008
@@ -250,7 +250,7 @@
sip_time_t expires = 0;
if (cr->cr_event == nua_r_destroy || !du || du->du_shutdown)
- cr->cr_terminating = 1;
+ nua_client_set_terminating(cr, 1);
if (du) {
struct event_usage *eu = nua_dialog_usage_private(du);
@@ -353,7 +353,7 @@
sip_t const *sip)
{
nua_handle_t *nh = cr->cr_owner;
- nua_dialog_usage_t *du = cr->cr_usage;
+ nua_dialog_usage_t *du = cr->cr_usage;
struct event_usage *eu = nua_dialog_usage_private(du);
enum nua_substate substate;
@@ -415,7 +415,7 @@
if (substate == nua_substate_terminated)
/* let nua_base_client_tresponse to remove usage */
- cr->cr_terminated = 1;
+ cr->cr_terminated = 1;
}
return nua_base_client_tresponse(cr, status, phrase, sip,
1
0
[Freeswitch-svn] [commit] r9421 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:30:56 2008
New Revision: 9421
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
Log:
Wed Sep 3 14:20:29 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* nua: added reference counting for client-side transactions
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Sep 3 14:30:56 2008
@@ -1 +1 @@
-Wed Sep 3 14:29:03 EDT 2008
+Wed Sep 3 14:29:36 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c Wed Sep 3 14:30:56 2008
@@ -354,12 +354,12 @@
*
* Zap dialog state (leg, tag and route) if no usages remain.
*/
-static
-void nua_dialog_usage_remove_at(nua_owner_t *own,
- nua_dialog_state_t *ds,
- nua_dialog_usage_t **at,
- nua_client_request_t *cr0,
- nua_server_request_t *sr0)
+static void
+nua_dialog_usage_remove_at(nua_owner_t *own,
+ nua_dialog_state_t *ds,
+ nua_dialog_usage_t **at,
+ nua_client_request_t *cr0,
+ nua_server_request_t *sr0)
{
if (*at) {
nua_dialog_usage_t *du = *at;
@@ -376,17 +376,9 @@
o ? " with event " : "", o ? o->o_type :""));
du->du_class->usage_remove(own, ds, du, cr0, sr0);
- /* Destroy saved client request */
- if (cr0 != du->du_cr && nua_client_is_bound(du->du_cr)) {
- nua_client_bind(cr = du->du_cr, NULL);
-
- if (nua_client_is_queued(cr))
- nua_client_request_complete(cr);
- else if (nua_client_is_reporting(cr))
- ;
- else
- nua_client_request_destroy(cr);
- }
+ /* Clean reference to saved client request */
+ if (du->du_cr)
+ nua_client_bind(du->du_cr, NULL);
/* Clean references from queued client requests */
for (cr = ds->ds_cr; cr; cr = cr_next) {
@@ -395,6 +387,7 @@
cr->cr_usage = NULL;
}
+ /* Clean references from queued server requests */
for (sr = ds->ds_sr; sr; sr = sr_next) {
sr_next = sr->sr_next;
if (sr->sr_usage == du) {
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 Wed Sep 3 14:30:56 2008
@@ -276,6 +276,8 @@
unsigned short cr_retry_count; /**< Retry count for this request */
uint32_t cr_seq;
+
+ unsigned cr_refs; /**< References to client request */
/* Flags used with offer-answer */
unsigned short cr_answer_recv; /**< Recv answer in response
@@ -300,7 +302,6 @@
unsigned cr_waiting:1; /**< Request is waiting */
unsigned cr_challenged:1; /**< Request was challenged */
unsigned cr_wait_for_cred:1; /**< Request is pending authentication */
- unsigned cr_wait_for_timer:1; /**< Request is waiting for a timer to expire */
unsigned cr_restarting:1; /**< Request is being restarted */
unsigned cr_reporting:1; /**< Reporting in progress */
unsigned cr_terminating:1; /**< Request terminates the usage */
@@ -523,8 +524,23 @@
return (void *)(cr + 1);
}
-void nua_client_request_complete(nua_client_request_t *);
-void nua_client_request_destroy(nua_client_request_t *);
+nua_client_request_t *nua_client_request_ref(nua_client_request_t *);
+int nua_client_request_unref(nua_client_request_t *);
+
+#if HAVE_MEMLEAK_LOG
+
+#define nua_client_request_ref(cr) \
+ nua_client_request_ref_by((cr), __FILE__, __LINE__, __func__)
+#define nua_client_request_unref(cr) \
+ nua_client_request_unref_by((cr), __FILE__, __LINE__, __func__)
+
+nua_client_request_t *nua_client_request_ref_by(nua_client_request_t *,
+ char const *file, unsigned line,
+ char const *who);
+int nua_client_request_unref_by(nua_client_request_t *,
+ char const *file, unsigned line, char const *who);
+
+#endif
int nua_client_request_queue(nua_client_request_t *cr);
@@ -533,8 +549,8 @@
return cr && cr->cr_prev;
}
-void nua_client_request_remove(nua_client_request_t *cr);
-void nua_client_request_clean(nua_client_request_t *cr);
+int nua_client_request_remove(nua_client_request_t *cr);
+int nua_client_request_clean(nua_client_request_t *cr);
int nua_client_bind(nua_client_request_t *cr, nua_dialog_usage_t *du);
su_inline int nua_client_is_bound(nua_client_request_t const *cr)
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 Wed Sep 3 14:30:56 2008
@@ -276,7 +276,7 @@
NULL);
}
- nua_client_request_destroy(cr);
+ nua_client_request_remove(cr);
cr_next = ds->ds_cr;
}
@@ -1177,9 +1177,9 @@
soa_set_params(nh->nh_soa, TAG_NEXT(tags));
}
- error = nua_invite_client_ack(cr, tags);
+ nua_client_request_ref(cr);
- nua_client_request_clean(cr);
+ error = nua_invite_client_ack(cr, tags);
if (error < 0) {
if (ss->ss_reason == NULL)
@@ -1195,8 +1195,7 @@
else if (ss)
signal_call_state_change(nh, ss, 200, "ACK sent", nua_callstate_ready);
- if (!nua_client_is_queued(cr) && !nua_client_is_bound(cr))
- nua_client_request_destroy(cr);
+ nua_client_request_unref(cr);
nua_client_next_request(nh->nh_ds->ds_cr, 1);
@@ -1233,7 +1232,8 @@
if (!ds->ds_leg) {
/* XXX - fix nua_dialog_usage_remove_at() instead! */
- nta_outgoing_destroy(cr->cr_orq);
+ nua_client_request_clean(cr);
+ nua_client_request_remove(cr);
return -1;
}
@@ -1366,9 +1366,11 @@
if (error == -1)
msg_destroy(msg);
- nua_client_request_remove(cr);
cr->cr_acked = 1; /* ... or we have at least tried */
-
+
+ nua_client_request_clean(cr);
+ nua_client_request_remove(cr);
+
return error;
}
@@ -1452,11 +1454,19 @@
return nua_client_return(cr, 481, "No transaction to CANCEL", msg);
}
+ assert(cr->cr_orq == NULL);
+
cr->cr_orq = nta_outgoing_tcancel(du->du_cr->cr_orq,
- nua_client_orq_response, cr,
+ nua_client_orq_response,
+ nua_client_request_ref(cr),
TAG_NEXT(tags));
- return cr->cr_orq ? 0 : -1;
+ if (cr->cr_orq == NULL) {
+ nua_client_request_unref(cr);
+ return -1;
+ }
+
+ return 0;
}
/** @NUA_EVENT nua_r_cancel
@@ -3630,7 +3640,6 @@
if (nh->nh_soa)
soa_terminate(nh->nh_soa, 0);
- du->du_cr = NULL;
nua_client_bind(cr, du);
return 0;
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c Wed Sep 3 14:30:56 2008
@@ -114,6 +114,8 @@
static void nua_stack_timer(nua_t *nua, su_timer_t *t, su_timer_arg_t *a);
+static int nua_client_request_complete(nua_client_request_t *cr);
+
/* ---------------------------------------------------------------------- */
/* Constant data */
@@ -963,7 +965,7 @@
nea_server_destroy(nh->nh_notifier), nh->nh_notifier = NULL;
while (nh->nh_ds->ds_cr)
- nua_client_request_destroy(nh->nh_ds->ds_cr);
+ nua_client_request_complete(nh->nh_ds->ds_cr);
while (nh->nh_ds->ds_sr)
nua_server_request_destroy(nh->nh_ds->ds_sr);
@@ -1956,8 +1958,8 @@
* crm_report().
*
* The final responses are processed by crm_recv() and and preliminary ones
- * by crm_preliminary(). Both functions call nua_base_client_response() after
- * method-specific processing.
+ * by crm_preliminary(). All virtual functions should call
+ * nua_base_client_response() beside method-specific processing.
*
* The nua_base_client_response() relays the response to the application with
* nua_client_restart() and crm_report().
@@ -1968,6 +1970,8 @@
* When a terminating request completes the dialog usage is removed and the
* dialog is destroyed (unless there is an another active usage).
*/
+static void nua_client_request_destroy(nua_client_request_t *cr);
+static int nua_client_init_request0(nua_client_request_t *cr);
static int nua_client_request_try(nua_client_request_t *cr);
static int nua_client_request_sendmsg(nua_client_request_t *cr,
msg_t *msg, sip_t *sip);
@@ -2038,6 +2042,10 @@
if (tags && cr->cr_tags == NULL)
cr->cr_tags = tl_tlist(nh->nh_home, TAG_NEXT(tags));
+#if HAVE_MEMLEAK_LOG
+ SU_DEBUG_0(("%p %s() for %s\n", cr, __func__, cr->cr_methods->crm_method_name));
+#endif
+
if (nua_client_request_queue(cr))
return 0;
@@ -2057,6 +2065,55 @@
return retval;
}
+#if HAVE_MEMLEAK_LOG
+nua_client_request_t *
+nua_client_request_ref_by(nua_client_request_t *cr,
+ char const *where, unsigned line, char const *who)
+{
+ SU_DEBUG_0(("%p ref %s to %u by %s:%u: %s()\n",
+ cr, cr->cr_methods->crm_method_name,
+ ++(cr->cr_refs), where, line, who));
+ return cr;
+}
+
+int nua_client_request_unref_by(nua_client_request_t *cr,
+ char const *where, unsigned line, char const *who)
+{
+ SU_DEBUG_0(("%p unref %s to %u by %s:%u: %s()\n",
+ cr, cr->cr_methods->crm_method_name,
+ cr->cr_refs - 1, where, line, who));
+
+ if (cr->cr_refs > 1) {
+ cr->cr_refs--;
+ return 0;
+ }
+ else {
+ cr->cr_refs = 0;
+ nua_client_request_destroy(cr);
+ return 1;
+ }
+}
+#else
+nua_client_request_t *nua_client_request_ref(nua_client_request_t *cr)
+{
+ cr->cr_refs++;
+ return cr;
+}
+
+int nua_client_request_unref(nua_client_request_t *cr)
+{
+ if (cr->cr_refs > 1) {
+ cr->cr_refs--;
+ return 0;
+ }
+ else {
+ cr->cr_refs = 0;
+ nua_client_request_destroy(cr);
+ return 1;
+ }
+}
+#endif
+
int nua_client_request_queue(nua_client_request_t *cr)
{
int queued = 0;
@@ -2066,6 +2123,8 @@
cr->cr_status = 0;
+ nua_client_request_ref(cr);
+
if (cr->cr_method != sip_method_invite &&
cr->cr_method != sip_method_cancel) {
while (*queue) {
@@ -2092,41 +2151,68 @@
return queued;
}
-void nua_client_request_remove(nua_client_request_t *cr)
+int
+nua_client_request_remove(nua_client_request_t *cr)
{
if (cr->cr_prev)
if ((*cr->cr_prev = cr->cr_next))
cr->cr_next->cr_prev = cr->cr_prev;
cr->cr_prev = NULL, cr->cr_next = NULL;
+
+ if (cr->cr_timer) {
+ su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
+ nua_client_request_unref(cr);
+ }
+
+ return nua_client_request_unref(cr);
}
-void nua_client_request_clean(nua_client_request_t *cr)
+int
+nua_client_request_clean(nua_client_request_t *cr)
{
- nta_outgoing_destroy(cr->cr_orq), cr->cr_orq = NULL, cr->cr_acked = 0;
+ if (cr->cr_orq) {
+ nta_outgoing_destroy(cr->cr_orq), cr->cr_orq = NULL, cr->cr_acked = 0;
+ return nua_client_request_unref(cr);
+ }
+ return 0;
}
-void nua_client_request_complete(nua_client_request_t *cr)
+static int
+nua_client_request_complete(nua_client_request_t *cr)
{
- nua_client_request_remove(cr);
- if (cr && cr->cr_methods->crm_complete)
- cr->cr_methods->crm_complete(cr);
+ if (cr->cr_orq) {
+ if (cr && cr->cr_methods->crm_complete)
+ cr->cr_methods->crm_complete(cr);
+ nta_outgoing_destroy(cr->cr_orq), cr->cr_orq = NULL, cr->cr_acked = 0;
+ nua_client_request_unref(cr);
+ }
+
+ return nua_client_request_remove(cr);
}
-void nua_client_request_destroy(nua_client_request_t *cr)
+static void
+nua_client_request_destroy(nua_client_request_t *cr)
{
nua_handle_t *nh;
if (cr == NULL)
return;
- nua_client_request_complete(cr);
+ /* Possible references: */
+ assert(cr->cr_prev == NULL); /* queue */
+ assert(cr->cr_orq == NULL); /* transaction callback */
+ assert(cr->cr_timer == NULL); /* timer callback */
nh = cr->cr_owner;
nua_destroy_signal(cr->cr_signal);
nua_client_bind(cr, NULL);
-
+
+#if HAVE_MEMLEAK_LOG
+ SU_DEBUG_0(("%p %s for %s\n", cr, __func__, cr->cr_methods->crm_method_name));
+#endif
+
if (cr->cr_msg)
msg_destroy(cr->cr_msg);
cr->cr_msg = NULL, cr->cr_sip = NULL;
@@ -2135,9 +2221,6 @@
nta_outgoing_destroy(cr->cr_orq);
cr->cr_orq = NULL;
- if (cr->cr_timer)
- su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
-
if (cr->cr_target)
su_free(nh->nh_home, cr->cr_target);
@@ -2154,40 +2237,53 @@
return -1;
if (du == NULL) {
- if (cr->cr_usage && cr->cr_usage->du_cr == cr)
- cr->cr_usage->du_cr = NULL;
+ du = cr->cr_usage;
cr->cr_usage = NULL;
+ if (du && du->du_cr == cr) {
+ du->du_cr = NULL;
+ nua_client_request_unref(cr);
+ }
return 0;
}
- if (du->du_cr && cr != du->du_cr) {
- /* This should never happen (but it does):
- assert(!nua_client_is_queued(du->du_cr));
- */
- if (nua_client_is_queued(du->du_cr))
- return -1;
- if (nua_client_is_reporting(du->du_cr)) {
- du->du_cr->cr_usage = NULL;
- du->du_cr = NULL;
- }
- else
- nua_client_request_destroy(du->du_cr);
+ if (du->du_cr && cr == du->du_cr)
+ return 0;
+
+ if (du->du_cr) {
+ nua_client_bind(du->du_cr, NULL);
}
- du->du_cr = cr, cr->cr_usage = du;
+ du->du_cr = nua_client_request_ref(cr), cr->cr_usage = du;
return 0;
}
/**Initialize client request for sending.
*
- * This function is called only first time the request is sent.
+ * This function is called when the request is taken from queue and sent.
*
* @retval 0 if request is pending
* @retval >=1 if error event has been sent
*/
int nua_client_init_request(nua_client_request_t *cr)
{
+ int retval;
+ nua_client_request_ref(cr);
+ retval = nua_client_init_request0(cr);
+ nua_client_request_unref(cr);
+ return retval;
+}
+
+/**Initialize client request for sending.
+ *
+ * This function is called when the request is taken from queue and sent.
+ *
+ * @retval 0 if request is pending
+ * @retval >=1 if error event has been sent
+ */
+static
+int nua_client_init_request0(nua_client_request_t *cr)
+{
nua_handle_t *nh = cr->cr_owner;
nua_t *nua = nh->nh_nua;
nua_dialog_state_t *ds = nh->nh_ds;
@@ -2354,7 +2450,6 @@
cr->cr_sip = sip;
return nua_client_request_try(cr);
-
}
msg_t *nua_client_request_template(nua_client_request_t *cr)
@@ -2373,7 +2468,7 @@
tagi_t const *t = nh->nh_tags;
/* Use the From header from the dialog.
- From is always first tag in the handle */
+ If From is set, it is always first tag in the handle */
if (ds->ds_leg && t->t_tag == siptag_from)
t++;
@@ -2670,15 +2765,23 @@
cr->cr_seq = sip->sip_cseq->cs_seq; /* Save last sequence number */
+ assert(cr->cr_orq == NULL);
+
cr->cr_orq = nta_outgoing_mcreate(nh->nh_nua->nua_nta,
- nua_client_orq_response, cr,
- NULL,
+ nua_client_orq_response,
+ nua_client_request_ref(cr),
+ NULL,
msg,
TAG_IF(proxy_is_set,
NTATAG_DEFAULT_PROXY(proxy)),
TAG_NEXT(tags));
- return cr->cr_orq ? 0 : -1;
+ if (cr->cr_orq == NULL) {
+ nua_client_request_unref(cr);
+ return -1;
+ }
+
+ return 0;
}
/** Callback for nta client transaction */
@@ -2741,10 +2844,13 @@
{
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = cr->cr_usage;
+ int retval = 0;
if (cr->cr_restarting)
return 0;
+ nua_client_request_ref(cr);
+
cr->cr_status = status;
cr->cr_phrase = phrase;
@@ -2752,6 +2858,7 @@
/* Xyzzy */
}
else if (sip && nua_client_check_restart(cr, status, phrase, sip)) {
+ nua_client_request_unref(cr);
return 0;
}
else if (status < 300) {
@@ -2786,20 +2893,24 @@
else if (graceful)
cr->cr_graceful = 1;
}
-
+
if (status < 200) {
if (cr->cr_methods->crm_preliminary)
cr->cr_methods->crm_preliminary(cr, status, phrase, sip);
else
nua_base_client_response(cr, status, phrase, sip, NULL);
cr->cr_phrase = NULL;
- return 0;
}
+ else {
+ if (cr->cr_methods->crm_recv)
+ retval = cr->cr_methods->crm_recv(cr, status, phrase, sip);
+ else
+ retval = nua_base_client_response(cr, status, phrase, sip, NULL);
+ }
- if (cr->cr_methods->crm_recv)
- return cr->cr_methods->crm_recv(cr, status, phrase, sip);
- else
- return nua_base_client_response(cr, status, phrase, sip, NULL);
+ nua_client_request_unref(cr);
+
+ return retval;
}
/** Check if request should be restarted.
@@ -2914,6 +3025,7 @@
nua_client_report(cr, status, phrase, NULL, orq, NULL);
nta_outgoing_destroy(orq);
cr->cr_status = 0, cr->cr_phrase = NULL;
+ nua_client_request_unref(cr);
return 1;
}
@@ -2922,20 +3034,24 @@
if (500 <= status && status < 600 &&
sip->sip_retry_after &&
sip->sip_retry_after->af_delta < 32) {
+ su_timer_t *timer;
char phrase[18]; /* Retry After XXXX\0 */
- if (cr->cr_timer == NULL)
- cr->cr_timer = su_timer_create(su_root_task(nh->nh_nua->nua_root), 0);
+ timer = su_timer_create(su_root_task(nh->nh_nua->nua_root), 0);
- if (su_timer_set_interval(cr->cr_timer, nua_client_restart_after, cr,
- sip->sip_retry_after->af_delta * 1000) < 0)
+ if (su_timer_set_interval(timer, nua_client_restart_after, cr,
+ sip->sip_retry_after->af_delta * 1000) < 0) {
+ su_timer_destroy(timer);
return 0; /* Too bad */
+ }
+
+ cr->cr_timer = timer; /* This takes over reference from orq */
snprintf(phrase, sizeof phrase, "Retry After %u",
(unsigned)sip->sip_retry_after->af_delta);
orq = cr->cr_orq, cr->cr_orq = NULL;
- cr->cr_waiting = cr->cr_wait_for_timer = 1;
+ cr->cr_waiting = 1;
nua_client_report(cr, 100, phrase, NULL, orq, NULL);
nta_outgoing_destroy(orq);
cr->cr_status = 0, cr->cr_phrase = NULL;
@@ -2951,11 +3067,10 @@
su_timer_t *timer,
nua_client_request_t *cr)
{
- if (!cr->cr_wait_for_timer)
- return;
-
- cr->cr_waiting = cr->cr_wait_for_timer = 0;
+ cr->cr_waiting = 0;
+ su_timer_destroy(cr->cr_timer), cr->cr_timer = NULL;
nua_client_restart_request(cr, cr->cr_terminating, NULL);
+ nua_client_request_unref(cr);
}
/** Restart request.
@@ -3017,6 +3132,7 @@
nua_client_report(cr, status, phrase, NULL, orq, NULL);
nta_outgoing_destroy(orq);
+ nua_client_request_unref(cr); /* ... reference used by old orq */
return 1;
}
@@ -3086,7 +3202,6 @@
nua_handle_t *nh = cr->cr_owner;
sip_method_t method = cr->cr_method;
nua_dialog_usage_t *du;
- nua_client_request_t *cr_next;
cr->cr_reporting = 1, nh->nh_ds->ds_reporting = 1;
@@ -3115,8 +3230,7 @@
return 1;
}
- if (cr->cr_orq)
- nta_outgoing_destroy(cr->cr_orq), cr->cr_orq = NULL, cr->cr_acked = 0;
+ nua_client_request_clean(cr);
du = cr->cr_usage;
@@ -3144,15 +3258,10 @@
cr->cr_phrase = NULL;
cr->cr_reporting = 0, nh->nh_ds->ds_reporting = 0;
- cr_next = nh->nh_ds->ds_cr;
-
- if (!nua_client_is_queued(cr) && !nua_client_is_bound(cr))
- nua_client_request_destroy(cr);
-
if (method == sip_method_cancel)
return 1;
- return nua_client_next_request(cr_next, method == sip_method_invite);
+ return nua_client_next_request(nh->nh_ds->ds_cr, method == sip_method_invite);
}
/** Send event, zap transaction but leave cr in list */
@@ -3206,8 +3315,9 @@
break;
}
- if (cr && cr->cr_orq == NULL)
+ if (cr && cr->cr_orq == NULL) {
nua_client_init_request(cr);
+ }
return 1;
}
1
0
[Freeswitch-svn] [commit] r9420 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:29:19 2008
New Revision: 9420
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
Log:
Wed Sep 3 13:55:22 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* nua: using HAVE_MEMLEAK_LOG
Logging nua_handle_ref() and nua_handle_unref().
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Sep 3 14:29:19 2008
@@ -1 +1 @@
-Wed Sep 3 14:27:37 EDT 2008
+Wed Sep 3 14:29:03 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c Wed Sep 3 14:29:19 2008
@@ -163,8 +163,47 @@
SU_DEBUG_0(("nh_destructor(%p)\n", (void *)nh));
}
-#undef nua_handle_ref
-#undef nua_handle_unref
+#if HAVE_MEMLEAK_LOG
+
+nua_handle_t *
+_nua_handle_ref_by(nua_handle_t *nh,
+ char const *file, unsigned line,
+ char const *function)
+{
+ if (nh)
+ SU_DEBUG_0(("%p - nua_handle_ref() => "MOD_ZU" by %s:%u: %s()\n",
+ nh, su_home_refcount((su_home_t *)nh) + 1, file, line, by));
+ return (nua_handle_t *)su_home_ref((su_home_t *)nh);
+}
+
+int
+_nua_handle_unref_by(nua_handle_t *nh,
+ char const *file, unsigned line,
+ char const *function)
+{
+ if (nh) {
+ size_t refcount = su_home_refcount((su_home_t *)nh) - 1;
+ int freed = su_home_unref((su_home_t *)nh);
+ if (freed) refcount = 0;
+ SU_DEBUG_0(("%p - nua_handle_unref() => "MOD_ZU" by %s:%u: %s()\n",
+ nh, refcount, file, line, by));
+ return freed;
+ }
+
+ return 0;
+}
+
+nua_handle_t *nua_handle_ref(nua_handle_t *nh)
+{
+ return _nua_handle_ref_by(nh, "<app>", 0, "<app>")
+}
+
+int nua_handle_unref(nua_handle_t *nh)
+{
+ return _nua_handle_unref_by(nh, "<app>", 0, "<app>")
+}
+
+#else
/** Make a new reference to handle.
*
@@ -198,6 +237,8 @@
return su_home_unref(nh->nh_home);
}
+#endif
+
/** Generate an instance identifier. */
char const *nua_generate_instance_identifier(su_home_t *home)
{
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h Wed Sep 3 14:29:19 2008
@@ -103,37 +103,6 @@
TAG_IF((include) && (soa) && soa_is_remote_chat_active(soa) >= 0, \
SOATAG_ACTIVE_CHAT(soa_is_remote_chat_active(soa)))
-#if HAVE_NUA_HANDLE_DEBUG
-
-#define nua_handle_ref(nh) nua_handle_ref_by((nh), __func__)
-#define nua_handle_unref(nh) nua_handle_unref_by((nh), __func__)
-
-su_inline nua_handle_t *nua_handle_ref_by(nua_handle_t *nh,
- char const *by)
-{
- if (nh)
- SU_DEBUG_0(("nua_handle_ref(%p) => "MOD_ZU" by %s\n", nh,
- su_home_refcount((su_home_t *)nh) + 1,
- by));
- return (nua_handle_t *)su_home_ref((su_home_t *)nh);
-}
-
-su_inline int nua_handle_unref_by(nua_handle_t *nh, char const *by)
-{
- if (nh) {
- size_t refcount = su_home_refcount((su_home_t *)nh) - 1;
- int freed = su_home_unref((su_home_t *)nh);
- if (freed) refcount = 0;
- SU_DEBUG_0(("nua_handle_unref(%p) => "MOD_ZU" by %s\n",
- nh, refcount, by));
- return freed;
- }
-
- return 0;
-}
-
-#endif
-
/** @internal @brief NUA handle.
*
*/
@@ -277,6 +246,20 @@
#define __func__ "nua"
#endif
+#if HAVE_MEMLEAK_LOG
+
+#define nua_handle_ref(nh) \
+ _nua_handle_ref_by((nh), __FILE__, __LINE__, __func__)
+#define nua_handle_unref(nh) \
+ _nua_handle_unref_by((nh), __FILE__, __LINE__, __func__)
+
+nua_handle_t *_nua_handle_ref_by(
+ nua_handle_t *nh, char const *file, unsigned line, char const *by);
+int _nua_handle_unref_by(
+ nua_handle_t *nh, char const *file, unsigned line, char const *by);
+
+#endif
+
su_inline nua_t *nua_stack_ref(nua_t *nua)
{
return (nua_t *)su_home_ref(nua->nua_home);
1
0
[Freeswitch-svn] [commit] r9419 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:28:41 2008
New Revision: 9419
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_tag.c
Log:
Wed Sep 3 13:50:17 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* nua_tag.c: updated documentation on NUA tags
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 Wed Sep 3 14:28:41 2008
@@ -299,7 +299,7 @@
*
* @par Values
* #url_string_t, which is either a pointer to #url_t or NULL terminated
- * character string representing URL \n
+ * character string representing URL
*
* For normal nua calls, this tag is used as request target, which is usually
* stored as request-URI.
@@ -445,9 +445,9 @@
*
* Require 100rel extension and PRACK only with 183 response.
*
- * If this parameter is set, stack includes feature tag "100rel" in the
- * @Require header only with 183: otherwise, all 1XX responses (except
- * <i>100 Trying</i>) require 100rel.
+ * When NUTAG_EARLY_MEDIA() is set, and if this parameter is set, stack
+ * includes feature tag "100rel" in the @Require header only with 183:
+ * otherwise, all 1XX responses (except <i>100 Trying</i>) require 100rel.
*
* @par Used with
* nua_set_params() \n
@@ -474,7 +474,7 @@
*/
tag_typedef_t nutag_only183_100rel = BOOLTAG_TYPEDEF(only183_100rel);
-/**@def NUTAG_ONLY183_100REL_REF(x)
+/**@def NUTAG_ONLY183_100REL_REF(x)
* Reference tag for NUTAG_ONLY183_100REL().
*/
@@ -487,11 +487,11 @@
* nua_respond(), nua_set_params(), nua_set_hparams()
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 False \n
- * @c !=0 True
+ * - 0 (false) - do not include SDP in non-100rel 1XX responses
+ * - 1 (true) - try to include SDP in preliminary responses
*
* Corresponding tag taking reference parameter is NUTAG_EARLY_ANSWER_REF().
*
@@ -503,7 +503,7 @@
*/
tag_typedef_t nutag_early_answer = BOOLTAG_TYPEDEF(early_answer);
-/**@def NUTAG_EARLY_ANSWER_REF(x)
+/**@def NUTAG_EARLY_ANSWER_REF(x)
* Reference tag for NUTAG_EARLY_ANSWER().
*/
@@ -523,11 +523,12 @@
* nua_respond()
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 False \n
- * @c !=0 True
+ * - 0 (false) - do not include extra SDP on 200 OK
+ * - 1 (true) - include SDP in 200 OK even if it has been sent
+ * a 100rel response, too
*
* Corresponding tag taking reference parameter is
* NUTAG_INCLUDE_EXTRA_SDP_REF().
@@ -536,12 +537,12 @@
*
* @sa NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(), NUTAG_AUTOALERT(),
* NUTAG_MEDIA_ENABLE(), @RFC3264, @RFC3264
- *
+ *
* @since New in @VERSION_1_12_4.
*/
tag_typedef_t nutag_include_extra_sdp = BOOLTAG_TYPEDEF(include_extra_sdp);
-/**@def NUTAG_INCLUDE_EXTRA_SDP_REF(x)
+/**@def NUTAG_INCLUDE_EXTRA_SDP_REF(x)
* Reference tag for NUTAG_INCLUDE_EXTRA_SDP().
*/
@@ -551,7 +552,7 @@
* Enable built-in media session handling
*
* The built-in media session object @soa takes care of most details
- * of offer-answer negotiation.
+ * of offer-answer negotiation.
*
* @par Used with
* nua_create()
@@ -560,14 +561,14 @@
* int
*
* @par Values
- * @c 0 False \n
- * @c !=0 True
+ * - 0 (false) - do not use soa
+ * - 1 (true) - use soa with SDP O/A
*
* Corresponding tag taking reference parameter is NUTAG_MEDIA_ENABLE_REF()
*/
tag_typedef_t nutag_media_enable = BOOLTAG_TYPEDEF(media_enable);
-/**@def NUTAG_MEDIA_ENABLE_REF(x)
+/**@def NUTAG_MEDIA_ENABLE_REF(x)
* Reference tag for NUTAG_MEDIA_ENABLE().
*/
@@ -597,7 +598,7 @@
/**@def NUTAG_RETRY_COUNT(x)
- *
+ *
* Set request retry count.
*
* Retry count determines how many times stack will automatically retry
@@ -612,7 +613,7 @@
* nua_options(), nua_invite(), nua_ack(), nua_cancel(), nua_bye(),
* nua_prack(), nua_update(), nua_info(),
* nua_message(), nua_publish(), nua_unpublish(), nua_notifier(),
- * nua_subscribe(), nua_unsubscribe(), nua_notify(), nua_refer(),
+ * nua_subscribe(), nua_unsubscribe(), nua_notify(), nua_refer(),
* nua_method(), nua_respond()
* nua_authenticate().
*
@@ -620,7 +621,7 @@
* unsigned
*
* @par Values
- * - 0 - Never retry automatically \n
+ * - 0 - Never retry automatically
* - Otherwise, number of extra transactions initiated after initial
* transaction failed with recoverable error response
*
@@ -630,7 +631,7 @@
*/
tag_typedef_t nutag_retry_count = UINTTAG_TYPEDEF(retry_count);
-/**@def NUTAG_RETRY_COUNT_REF(x)
+/**@def NUTAG_RETRY_COUNT_REF(x)
*
* Reference tag for NUTAG_RETRY_COUNT().
*/
@@ -648,19 +649,19 @@
* nua_get_params()
*
* @par Parameter type
- * unsigned
+ * unsigned int
*
* @par Values
- * @c 0 Do not allow any subscriptions \n
+ * - 0 (zero) - do not allow any subscriptions
*
* @sa nua_notifier(), nua_authorize()
*
- * Corresponding tag taking reference parameter is
+ * Corresponding tag taking reference parameter is
* NUTAG_MAX_SUBSCRIPTIONS_REF().
*/
tag_typedef_t nutag_max_subscriptions = UINTTAG_TYPEDEF(max_subscriptions);
-/**@def NUTAG_MAX_SUBSCRIPTIONS_REF(x)
+/**@def NUTAG_MAX_SUBSCRIPTIONS_REF(x)
* Reference tag for NUTAG_MAX_SUBSCRIPTIONS().
*/
@@ -692,7 +693,7 @@
*/
tag_typedef_t nutag_callstate = INTTAG_TYPEDEF(callstate);
-/**@def NUTAG_CALLSTATE_REF(x)
+/**@def NUTAG_CALLSTATE_REF(x)
* Reference tag for NUTAG_CALLSTATE().
*/
@@ -711,7 +712,7 @@
*/
tag_typedef_t nutag_offer_recv = BOOLTAG_TYPEDEF(offer_recv);
-/**@def NUTAG_OFFER_RECV_REF(x)
+/**@def NUTAG_OFFER_RECV_REF(x)
* Reference tag for NUTAG_OFFER_RECV().
*/
@@ -730,7 +731,7 @@
*/
tag_typedef_t nutag_answer_recv = BOOLTAG_TYPEDEF(answer_recv);
-/**@def NUTAG_ANSWER_RECV_REF(x)
+/**@def NUTAG_ANSWER_RECV_REF(x)
* Reference tag for NUTAG_ANSWER_RECV().
*/
@@ -749,7 +750,7 @@
*/
tag_typedef_t nutag_offer_sent = BOOLTAG_TYPEDEF(offer_sent);
-/**@def NUTAG_OFFER_SENT_REF(x)
+/**@def NUTAG_OFFER_SENT_REF(x)
* Reference tag for NUTAG_OFFER_SENT().
*/
@@ -768,7 +769,7 @@
*/
tag_typedef_t nutag_answer_sent = BOOLTAG_TYPEDEF(answer_sent);
-/**@def NUTAG_ANSWER_SENT_REF(x)
+/**@def NUTAG_ANSWER_SENT_REF(x)
* Reference tag for NUTAG_ANSWER_SENT().
*/
@@ -799,7 +800,7 @@
*
* Note that the @SubscriptionState or @Expires headers specified by
* application with the nua_notify() or nua_respond() to SUBSCRIBE overrides
- * the subscription state specified by NUTAG_SUBSTATE().
+ * the subscription state specified by NUTAG_SUBSTATE().
* Application can terminate subscription by including
* NUTAG_SUBSTATE(nua_substate_terminated), @SubscriptionState with value
* "terminated" or @Expires header with value 0 in the NOTIFY request sent
@@ -813,7 +814,7 @@
*/
tag_typedef_t nutag_substate = INTTAG_TYPEDEF(substate);
-/**@def NUTAG_SUBSTATE_REF(x)
+/**@def NUTAG_SUBSTATE_REF(x)
* Reference tag for NUTAG_SUBSTATE().
*/
@@ -848,7 +849,7 @@
*/
tag_typedef_t nutag_sub_expires = UINTTAG_TYPEDEF(substate);
-/**@def NUTAG_SUB_EXPIRES_REF(x)
+/**@def NUTAG_SUB_EXPIRES_REF(x)
* Reference tag for NUTAG_SUB_EXPIRES().
*/
@@ -858,7 +859,7 @@
* Send unsolicited NOTIFY request.
*
* Some applications may require sending unsolicited NOTIFY requests, that
- * is, NOTIFY without SUBSCRIBE or REFER request sent by event watcher.
+ * is, NOTIFY without SUBSCRIBE or REFER request sent by event watcher.
* However, sending NOTIFY request requires an existing dialog usage by
* default. If the nua_notify() tags include NUTAG_NEWSUB(1), the usage
* is created by nua_notify() itself.
@@ -871,12 +872,12 @@
* nua_notify()
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * - 0 - false (default) - do not create new subscription
- * but reject NOTIFY with 481 locally \n
- * - 1 - true - create a subscription if it does not exist \n
+ * - 0 - false (default) - do not create new subscription
+ * but reject NOTIFY with 481 locally
+ * - 1 - true - create a subscription if it does not exist
*
* Corresponding tag taking reference parameter is NUTAG_NEWSUB_REF().
*
@@ -884,7 +885,7 @@
*/
tag_typedef_t nutag_newsub = BOOLTAG_TYPEDEF(newsub);
-/**@def NUTAG_NEWSUB_REF(x)
+/**@def NUTAG_NEWSUB_REF(x)
* Reference tag for NUTAG_NEWSUB().
*/
@@ -904,14 +905,14 @@
* int (enum nua_af)
*
* @par Values
- * @c 0 no timer \n
- * @c >0 timer in seconds
+ * - 0 no timer
+ * - >0 timer in seconds
*
* Corresponding tag taking reference parameter is NUTAG_INVITE_TIMER_REF().
*/
tag_typedef_t nutag_invite_timer = UINTTAG_TYPEDEF(invite_timer);
-/**@def NUTAG_INVITE_TIMER_REF(x)
+/**@def NUTAG_INVITE_TIMER_REF(x)
* Reference tag for NUTAG_INVITE_TIMER().
*/
@@ -924,17 +925,17 @@
* extension is used. The tag value is the proposed session expiration time
* in seconds, the session is refreshed twice during the expiration time.
*
- * @par Sending INVITE and UPDATE Requests
+ * @par Sending INVITE and UPDATE Requests
*
* If NUTAG_SESSION_TIMER() is used with non-zero value, the value is used
- * in the @SessionExpires header included in the INVITE or UPDATE requests.
+ * in the @SessionExpires header included in the INVITE or UPDATE requests.
* The intermediate proxies or the ultimate destination can lower the
* interval in @SessionExpires header. If the value is too low, they can
* reject the request with the status code <i>422 Session Timer Too
* Small</i>. In that case, @b nua increases the value of @SessionExpires
* header and retries the request automatically.
*
- * @par Returning a Response to the INVITE and UPDATE Requests
+ * @par Returning a Response to the INVITE and UPDATE Requests
*
* The NUTAG_SESSION_TIMER() value is also used when sending the final
* response to the INVITE or UPDATE requests. If the NUTAG_SESSION_TIMER()
@@ -952,7 +953,7 @@
* response. The party indicated with the "refresher" parameter of the
* @SessionExpires header sends a re-INVITE requests (or an UPDATE
* request if NUTAG_UPDATE_REFRESH(1) parameter tag has been set).
- *
+ *
* @par When to Use NUTAG_SESSION_TIMER()?
*
* The session time extension is enabled ("timer" feature tag is included in
@@ -997,7 +998,7 @@
*/
tag_typedef_t nutag_session_timer = UINTTAG_TYPEDEF(session_timer);
-/**@def NUTAG_SESSION_TIMER_REF(x)
+/**@def NUTAG_SESSION_TIMER_REF(x)
* Reference tag for NUTAG_SESSION_TIMER().
*/
@@ -1031,7 +1032,7 @@
*/
tag_typedef_t nutag_min_se = UINTTAG_TYPEDEF(min_se);
-/**@def NUTAG_MIN_SE_REF(x)
+/**@def NUTAG_MIN_SE_REF(x)
* Reference tag for NUTAG_MIN_SE().
*/
@@ -1055,10 +1056,10 @@
* #nua_any_refresher }
*
* @par Values
- * @c nua_no_refresher (session timers are disabled) \n
- * @c nua_local_refresher \n
- * @c nua_remote_refresher \n
- * @c nua_any_refresher (default) \n
+ * - nua_no_refresher (session timers are disabled)
+ * - nua_local_refresher
+ * - nua_remote_refresher
+ * - nua_any_refresher (default)
*
* Corresponding tag taking reference parameter is
* NUTAG_SESSION_REFRESHER_REF().
@@ -1068,7 +1069,7 @@
*/
tag_typedef_t nutag_session_refresher = INTTAG_TYPEDEF(session_refresher);
-/**@def NUTAG_SESSION_REFRESHER_REF(x)
+/**@def NUTAG_SESSION_REFRESHER_REF(x)
* Reference tag for NUTAG_SESSION_REFRESHER().
*/
@@ -1080,7 +1081,7 @@
* Use UPDATE as refresh method.
*
* If this parameter is true and the remote endpoint has included UPDATE in
- * Allow header, the nua stack uses UPDATE instead of INVITE to refresh the
+ * Allow header, the nua stack uses UPDATE instead of INVITE to refresh the
* session when using the session timer extension.
*
* Note that the session timer headers @SessionExpires and @MinSE are always
@@ -1096,11 +1097,11 @@
* accept this tag.
*
* @par Parameter type
- * boolean
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 1 Use UPDATE \n
- * @c 0 Use INVITE
+ * - 1 (true, use UPDATE)
+ * - 0 (false, use INVITE)
*
* Corresponding tag taking reference parameter is NUTAG_UPDATE_REFRESH_REF().
*
@@ -1109,7 +1110,7 @@
*/
tag_typedef_t nutag_update_refresh = BOOLTAG_TYPEDEF(update_refresh);
-/**@def NUTAG_UPDATE_REFRESH_REF(x)
+/**@def NUTAG_UPDATE_REFRESH_REF(x)
* Reference tag for NUTAG_UPDATE_REFRESH().
*/
@@ -1138,7 +1139,7 @@
*/
tag_typedef_t nutag_refer_expires = UINTTAG_TYPEDEF(refer_expires);
-/**@def NUTAG_REFER_EXPIRES_REF(x)
+/**@def NUTAG_REFER_EXPIRES_REF(x)
* Reference tag for NUTAG_REFER_EXPIRES().
*/
@@ -1162,11 +1163,11 @@
* nua_update()).
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * 0 (false, do not use id with subscription created with first REFER request) \n
- * 1 (true, use id with all subscriptions created with REFER request) \n
+ * - 0 (false, do not use id with subscription created with first REFER request)
+ * - 1 (true, use id with all subscriptions created with REFER request)
*
* Corresponding tag taking reference parameter is NUTAG_REFER_WITH_ID_REF().
*
@@ -1180,24 +1181,26 @@
/**@def NUTAG_AUTOALERT(x)
*
- * Send alerting (180 Ringing) automatically
+ * Send alerting (180 Ringing) automatically (instead of 100 Trying). If the
+ * early media has been enabled with NUTAG_EARLY_MEDIA(1), the stack will
+ * send 183, wait for PRACK and then return 180 Ringing.
*
* @par Used with
* nua_set_params() \n
* nua_get_params()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 No automatic sending of "180 Ringing" \n
- * @c !=0 "180 Ringing" sent automatically
+ * - 0 (false) - no automatic sending of "180 Ringing"
+ * - 1 (true) - "180 Ringing" sent automatically
*
* Corresponding tag taking reference parameter is NUTAG_AUTOALERT_REF().
*/
tag_typedef_t nutag_autoalert = BOOLTAG_TYPEDEF(autoAlert);
-/**@def NUTAG_AUTOALERT_REF(x)
+/**@def NUTAG_AUTOALERT_REF(x)
* Reference tag for NUTAG_AUTOALERT().
*/
@@ -1213,7 +1216,7 @@
* nua_respond()
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
* - 0 (false) - No automatic sending of "200 Ok"
@@ -1222,7 +1225,7 @@
* Corresponding tag taking reference parameter is NUTAG_AUTOANSWER_REF().
*
* @note Requires that @soa is enabled with NUTAG_MEDIA_ENABLE(1).
- *
+ *
* @par Auto-Answer to Re-INVITE requests
* By default, NUA tries to auto answer the re-INVITEs used to refresh the
* session when the media is enabled. Set NUTAG_AUTOANSWER(0) on the call
@@ -1240,7 +1243,7 @@
*/
tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer);
-/**@def NUTAG_AUTOANSWER_REF(x)
+/**@def NUTAG_AUTOANSWER_REF(x)
* Reference tag for NUTAG_AUTOANSWER().
*/
@@ -1261,19 +1264,19 @@
* nua_respond()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 No automatic sending of ACK \n
- * @c !=0 ACK sent automatically
+ * - 0 (false) - No automatic sending of ACK
+ * - 1 (true) - ACK sent automatically
*
* Default value is NUTAG_AUTOACK(1).
- *
+ *
* Corresponding tag taking reference parameter is NUTAG_AUTOACK_REF().
*/
tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);
-/**@def NUTAG_AUTOACK_REF(x)
+/**@def NUTAG_AUTOACK_REF(x)
* Reference tag for NUTAG_AUTOACK().
*/
@@ -1288,17 +1291,17 @@
* nua_get_params()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 Incoming INVITE not enabled. NUA answers 403 Forbidden \n
- * @c !=0 Incoming INVITE enabled
+ * - 0 (false) - Incoming INVITE not enabled. NUA answers 403 Forbidden
+ * - 1 (true) - Incoming INVITE enabled
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEINVITE_REF().
*/
tag_typedef_t nutag_enableinvite = BOOLTAG_TYPEDEF(enableInvite);
-/**@def NUTAG_ENABLEINVITE_REF(x)
+/**@def NUTAG_ENABLEINVITE_REF(x)
* Reference tag for NUTAG_ENABLEINVITE().
*/
@@ -1313,17 +1316,17 @@
* nua_get_params()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 Incoming MESSAGE not enabled. NUA answers 403 Forbidden \n
- * @c !=0 Incoming MESSAGE enabled
+ * - 0 (false) - Incoming MESSAGE not enabled. NUA answers 403 Forbidden
+ * - 1 (true) - Incoming MESSAGE enabled
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEMESSAGE_REF().
*/
tag_typedef_t nutag_enablemessage = BOOLTAG_TYPEDEF(enableMessage);
-/**@def NUTAG_ENABLEMESSAGE_REF(x)
+/**@def NUTAG_ENABLEMESSAGE_REF(x)
* Reference tag for NUTAG_ENABLEMESSAGE().
*/
@@ -1333,24 +1336,26 @@
*
* Enable incoming MESSAGE with To tag.
*
- * Set this parameter if you want to chat with Windows Messenger.
+ * Set this parameter true if you want to chat with Windows Messenger. When
+ * it is set, stack will accept MESSAGE requests with To tag outside
+ * existing dialogs.
*
* @par Used with
* nua_set_params() \n
* nua_get_params()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 False \n
- * @c !=0 True
+ * - 0 (false) - disable Windows-Messenger-specific features
+ * - 1 (true) - enable Windows-Messenger-specific features
*
* Corresponding tag taking reference parameter is NUTAG_ENABLEMESSENGER_REF().
*/
tag_typedef_t nutag_enablemessenger = BOOLTAG_TYPEDEF(enableMessenger);
-/**@def NUTAG_ENABLEMESSENGER_REF(x)
+/**@def NUTAG_ENABLEMESSENGER_REF(x)
* Reference tag for NUTAG_ENABLEMESSENGER().
*/
@@ -1365,17 +1370,17 @@
* nua_get_params()
*
* @par Parameter type
- * boolean
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 S/MIME is Disabled \n
- * @c !=0 S/MIME is Enabled
+ * - 0 (false) - S/MIME is Disabled
+ * - 1 (true) - S/MIME is Enabled
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_ENABLE_REF().
*/
tag_typedef_t nutag_smime_enable = BOOLTAG_TYPEDEF(smime_enable);
-/**@def NUTAG_SMIME_ENABLE_REF(x)
+/**@def NUTAG_SMIME_ENABLE_REF(x)
* Reference tag for NUTAG_SMIME_ENABLE().
*/
@@ -1396,16 +1401,16 @@
* int
*
* @par Values
- * @c -1 (SM_ID_NULL) No security service needed \n
- * @c 0 (SM_ID_CLEAR_SIGN) Clear signing \n
- * @c 1 (SM_ID_SIGN) S/MIME signing \n
- * @c 2 (SM_ID_ENCRYPT) S/MIME encryption
+ * - -1 (SM_ID_NULL) No security service needed
+ * - 0 (SM_ID_CLEAR_SIGN) Clear signing
+ * - 1 (SM_ID_SIGN) S/MIME signing
+ * - 2 (SM_ID_ENCRYPT) S/MIME encryption
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_OPT_REF().
*/
tag_typedef_t nutag_smime_opt = INTTAG_TYPEDEF(smime_opt);
-/**@def NUTAG_SMIME_OPT_REF(x)
+/**@def NUTAG_SMIME_OPT_REF(x)
* Reference tag for NUTAG_SMIME_OPT().
*/
@@ -1425,17 +1430,17 @@
* unsigned int
*
* @par Values
- * @c -1 (SM_MODE_NULL) Unspecified \n
- * @c 0 (SM_MODE_PAYLOAD_ONLY) SIP payload only \n
- * @c 1 (SM_MODE_TUNNEL) SIP tunneling mode \n
- * @c 2 (SM_MODE_SIPFRAG) SIPfrag protection
+ * - -1 (SM_MODE_NULL) Unspecified
+ * - 0 (SM_MODE_PAYLOAD_ONLY) SIP payload only
+ * - 1 (SM_MODE_TUNNEL) SIP tunneling mode
+ * - 2 (SM_MODE_SIPFRAG) SIPfrag protection
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_PROTECTION_MODE_REF().
*/
-tag_typedef_t nutag_smime_protection_mode =
+tag_typedef_t nutag_smime_protection_mode =
INTTAG_TYPEDEF(smime_protection_mode);
-/**@def NUTAG_SMIME_PROTECTION_MODE_REF(x)
+/**@def NUTAG_SMIME_PROTECTION_MODE_REF(x)
* Reference tag for NUTAG_SMIME_PROTECTION_MODE().
*/
@@ -1456,10 +1461,10 @@
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_DIGEST_REF().
*/
-tag_typedef_t nutag_smime_message_digest =
+tag_typedef_t nutag_smime_message_digest =
STRTAG_TYPEDEF(smime_message_digest);
-/**@def NUTAG_SMIME_MESSAGE_DIGEST_REF(x)
+/**@def NUTAG_SMIME_MESSAGE_DIGEST_REF(x)
* Reference tag for NUTAG_SMIME_MESSAGE_DIGEST().
*/
@@ -1480,10 +1485,10 @@
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_SIGNATURE_REF().
*/
-tag_typedef_t nutag_smime_signature =
+tag_typedef_t nutag_smime_signature =
STRTAG_TYPEDEF(smime_signature);
-/**@def NUTAG_SMIME_SIGNATURE_REF(x)
+/**@def NUTAG_SMIME_SIGNATURE_REF(x)
* Reference tag for NUTAG_SMIME_SIGNATURE().
*/
@@ -1504,10 +1509,10 @@
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_KEY_ENCRYPTION_REF().
*/
-tag_typedef_t nutag_smime_key_encryption =
+tag_typedef_t nutag_smime_key_encryption =
STRTAG_TYPEDEF(smime_key_encryption);
-/**@def NUTAG_SMIME_KEY_ENCRYPTION_REF(x)
+/**@def NUTAG_SMIME_KEY_ENCRYPTION_REF(x)
* Reference tag for NUTAG_SMIME_KEY_ENCRYPTION().
*/
@@ -1528,10 +1533,10 @@
*
* Corresponding tag taking reference parameter is NUTAG_SMIME_MESSAGE_ENCRYPTION_REF().
*/
-tag_typedef_t nutag_smime_message_encryption =
+tag_typedef_t nutag_smime_message_encryption =
STRTAG_TYPEDEF(smime_message_encryption);
-/**@def NUTAG_SMIME_MESSAGE_ENCRYPTION_REF(x)
+/**@def NUTAG_SMIME_MESSAGE_ENCRYPTION_REF(x)
* Reference tag for NUTAG_SMIME_MESSAGE_ENCRYPTION().
*/
@@ -1556,7 +1561,7 @@
*/
tag_typedef_t nutag_sips_url = URLTAG_TYPEDEF(sips_url);
-/**@def NUTAG_SIPS_URL_REF(x)
+/**@def NUTAG_SIPS_URL_REF(x)
* Reference tag for NUTAG_SIPS_URL().
*/
@@ -1578,7 +1583,7 @@
*/
tag_typedef_t nutag_certificate_dir = STRTAG_TYPEDEF(certificate_dir);
-/**@def NUTAG_CERTIFICATE_DIR_REF(x)
+/**@def NUTAG_CERTIFICATE_DIR_REF(x)
* Reference tag for NUTAG_CERTIFICATE_DIR().
*/
@@ -1599,7 +1604,7 @@
*/
tag_typedef_t nutag_certificate_phrase = STRTAG_TYPEDEF(certificate_phrase);
-/**@def NUTAG_CERTIFICATE_PHRASE_REF(x)
+/**@def NUTAG_CERTIFICATE_PHRASE_REF(x)
* Reference tag for NUTAG_CERTIFICATE_PHRASE().
*/
@@ -1612,8 +1617,8 @@
* The initial route set is used instead or or in addition to the outbound
* proxy URL given by NUTAG_PROXY(). The NUTAG_INITIAL_ROUTE() accepts a
* list of parsed @Route header structures, NUTAG_INITIAL_ROUTE_STR() an
- * unparsed string.
- *
+ * unparsed string.
+ *
* If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
* NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
* all.
@@ -1638,7 +1643,7 @@
*/
tag_typedef_t nutag_initial_route = SIPEXTHDRTAG_TYPEDEF(initial_route, route);
-/**@def NUTAG_INITIAL_ROUTE_REF(x)
+/**@def NUTAG_INITIAL_ROUTE_REF(x)
* Reference tag for NUTAG_INITIAL_ROUTE().
*/
@@ -1654,11 +1659,11 @@
* commas.
*
* Please note that the syntax requires <> around the @Route URIs if they
- * contain parameters, e.g., "lr".
+ * contain parameters, e.g., "lr".
*
* If a tag list contains multiple NUTAG_INITIAL_ROUTE() or
* NUTAG_INITIAL_ROUTE_STR() tags, the route set is constructed from them
- * all.
+ * all.
*
* The initial route set can be reset with NUTAG_INITIAL_ROUTE(NULL).
*
@@ -1684,7 +1689,7 @@
*/
tag_typedef_t nutag_initial_route_str = STRTAG_TYPEDEF(inital_route_str);
-/**@def NUTAG_INITIAL_ROUTE_STR_REF(x)
+/**@def NUTAG_INITIAL_ROUTE_STR_REF(x)
* Reference tag for NUTAG_INITIAL_ROUTE_STR().
*/
@@ -1707,7 +1712,7 @@
*/
tag_typedef_t nutag_registrar = URLTAG_TYPEDEF(registrar);
-/**@def NUTAG_REGISTRAR_REF(x)
+/**@def NUTAG_REGISTRAR_REF(x)
* Reference tag for NUTAG_REGISTRAR().
*/
@@ -1734,7 +1739,7 @@
*/
tag_typedef_t nutag_identity = PTRTAG_TYPEDEF(identity);
-/**@def NUTAG_IDENTITY_REF(x)
+/**@def NUTAG_IDENTITY_REF(x)
* Reference tag for NUTAG_IDENTITY().
*/
@@ -1768,7 +1773,7 @@
*/
tag_typedef_t nutag_m_display = STRTAG_TYPEDEF(m_display);
-/**@def NUTAG_M_DISPLAY_REF(x)
+/**@def NUTAG_M_DISPLAY_REF(x)
* Reference tag for NUTAG_M_DISPLAY().
*/
@@ -1803,7 +1808,7 @@
*/
tag_typedef_t nutag_m_username = STRTAG_TYPEDEF(m_username);
-/**@def NUTAG_M_USERNAME_REF(x)
+/**@def NUTAG_M_USERNAME_REF(x)
* Reference tag for NUTAG_M_USERNAME().
*/
@@ -1820,7 +1825,7 @@
* user-agent.
*
* @par Used with
- * nua_register(), nua_set_hparams(), nua_set_params(),
+ * nua_register(), nua_set_hparams(), nua_set_params(),
* nua_invite(), nua_respond(), nua_subscribe(), nua_notify()
*
* @par Parameter type
@@ -1838,7 +1843,7 @@
*/
tag_typedef_t nutag_m_params = STRTAG_TYPEDEF(m_params);
-/**@def NUTAG_M_PARAMS_REF(x)
+/**@def NUTAG_M_PARAMS_REF(x)
* Reference tag for NUTAG_M_PARAMS().
*/
@@ -1877,7 +1882,7 @@
*/
tag_typedef_t nutag_m_features = STRTAG_TYPEDEF(m_features);
-/**@def NUTAG_M_FEATURES_REF(x)
+/**@def NUTAG_M_FEATURES_REF(x)
* Reference tag for NUTAG_M_FEATURES().
*/
@@ -1887,7 +1892,7 @@
* Intance identifier.
*
* @par Used with
- * nua_create(), nua_set_params(), nua_get_params(),
+ * nua_create(), nua_set_params(), nua_get_params(),
* nua_register()
*
* @par Parameter type
@@ -1901,7 +1906,7 @@
*/
tag_typedef_t nutag_instance = STRTAG_TYPEDEF(instance);
-/**@def NUTAG_INSTANCE_REF(x)
+/**@def NUTAG_INSTANCE_REF(x)
* Reference tag for NUTAG_INSTANCE().
*/
@@ -1922,7 +1927,7 @@
* An option token with "no-" or "not-" prefix turns the option off. For
* example, if you want to try to traverse NATs but not to use OPTIONS
* keepalive, use NUTAG_OUTBOUND("natify no-options-keepalive").
- *
+ *
* An empty string can be passed to let the stack choose the
* default values for outbound usage (in the 1.12.5 release, the
* defaults are: "gruuize no-outbound validate use-port options-keepalive").
@@ -1947,7 +1952,7 @@
*/
tag_typedef_t nutag_outbound = STRTAG_TYPEDEF(outbound);
-/**@def NUTAG_OUTBOUND_REF(x)
+/**@def NUTAG_OUTBOUND_REF(x)
* Reference tag for NUTAG_OUTBOUND().
*/
@@ -1972,7 +1977,7 @@
*/
tag_typedef_t nutag_outbound_set1 = STRTAG_TYPEDEF(outbound_set1);
-/*#@def NUTAG_OUTBOUND_SET1_REF(x)
+/*#@def NUTAG_OUTBOUND_SET1_REF(x)
* Reference tag for NUTAG_OUTBOUND_SET1().
*/
@@ -1997,7 +2002,7 @@
*/
tag_typedef_t nutag_outbound_set2 = STRTAG_TYPEDEF(outbound_set2);
-/*#@def NUTAG_OUTBOUND_SET2_REF(x)
+/*#@def NUTAG_OUTBOUND_SET2_REF(x)
* Reference tag for NUTAG_OUTBOUND_SET2().
*/
@@ -2022,7 +2027,7 @@
*/
tag_typedef_t nutag_outbound_set3 = STRTAG_TYPEDEF(outbound_set3);
-/*#@def NUTAG_OUTBOUND_SET3_REF(x)
+/*#@def NUTAG_OUTBOUND_SET3_REF(x)
* Reference tag for NUTAG_OUTBOUND_SET3().
*/
@@ -2047,7 +2052,7 @@
*/
tag_typedef_t nutag_outbound_set4 = STRTAG_TYPEDEF(outbound_set4);
-/*#@def NUTAG_OUTBOUND_SET4_REF(x)
+/*#@def NUTAG_OUTBOUND_SET4_REF(x)
* Reference tag for NUTAG_OUTBOUND_SET4().
*/
@@ -2057,7 +2062,7 @@
*
* Keepalive interval in milliseconds.
*
- * This setting applies to OPTIONS/STUN keepalives. See documentation
+ * This setting applies to OPTIONS/STUN keepalives. See documentation
* for nua_register() for more detailed information.
*
* @par Used with
@@ -2070,7 +2075,7 @@
* @par Parameter type
* unsigned int
*
- * @par Values
+ * @par Values
* - 0 - disable keepalives
* - 120000 - default value (120000 milliseconds, 120 seconds)
*
@@ -2079,7 +2084,7 @@
*/
tag_typedef_t nutag_keepalive = UINTTAG_TYPEDEF(keepalive);
-/**@def NUTAG_KEEPALIVE_REF(x)
+/**@def NUTAG_KEEPALIVE_REF(x)
* Reference tag for NUTAG_KEEPALIVE().
*/
@@ -2100,7 +2105,7 @@
* @par Parameter type
* unsigned int
*
- * @par Values
+ * @par Values
*
* Transport-level keepalive interval for streams in milliseconds. If this
* parameter specified, it takes presedence over value given in
@@ -2113,7 +2118,7 @@
*/
tag_typedef_t nutag_keepalive_stream = UINTTAG_TYPEDEF(keepalive_stream);
-/**@def NUTAG_KEEPALIVE_STREAM_REF(x)
+/**@def NUTAG_KEEPALIVE_STREAM_REF(x)
* Reference tag for NUTAG_KEEPALIVE_STREAM().
*/
@@ -2126,17 +2131,17 @@
* @par Used with nua calls that send a SIP request
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c False (zero) \n
- * @c True (nonzero)
+ * - 0 (false) - do not create a dialog
+ * - 1 (true) - store dialog info
*
* Corresponding tag taking reference parameter is NUTAG_USE_DIALOG_REF().
*/
tag_typedef_t nutag_use_dialog = BOOLTAG_TYPEDEF(use_dialog);
-/**@def NUTAG_USE_DIALOG_REF(x)
+/**@def NUTAG_USE_DIALOG_REF(x)
* Reference tag for NUTAG_USE_DIALOG().
*/
@@ -2162,7 +2167,7 @@
*/
tag_typedef_t nutag_auth = STRTAG_TYPEDEF(auth);
-/**@def NUTAG_AUTH_REF(x)
+/**@def NUTAG_AUTH_REF(x)
* Reference tag for NUTAG_AUTH().
*/
@@ -2178,8 +2183,8 @@
* unsigned int
*
* @par Values
- * @c 0 Use authentication data only for this handle \n
- * @c !=0 Lifetime in seconds
+ * - 0 (zero) - Use authentication data only for this handle
+ * - nonzero - Lifetime of authentication data in seconds
*
* @todo
*
@@ -2187,7 +2192,7 @@
*/
tag_typedef_t nutag_authtime = INTTAG_TYPEDEF(authtime);
-/**@def NUTAG_AUTHTIME_REF(x)
+/**@def NUTAG_AUTHTIME_REF(x)
* Reference tag for NUTAG_AUTHTIME().
*/
@@ -2208,7 +2213,7 @@
*/
tag_typedef_t nutag_event = INTTAG_TYPEDEF(event);
-/**@def NUTAG_EVENT_REF(x)
+/**@def NUTAG_EVENT_REF(x)
* Reference tag for NUTAG_EVENT().
*/
@@ -2223,19 +2228,19 @@
* unsigned int
*
* @par Values
- * 100 - preliminary response, request is being processed by next hop \n
- * 1XX - preliminary response, request is being processed by UAS \n
- * 2XX - successful final response \n
- * 3XX - redirection error response \n
- * 4XX - client error response \n
- * 5XX - server error response \n
- * 6XX - global error response \n
+ * - 100 - preliminary response, request is being processed by next hop
+ * - 1XX - preliminary response, request is being processed by UAS
+ * - 2XX - successful final response
+ * - 3XX - redirection error response
+ * - 4XX - client error response
+ * - 5XX - server error response
+ * - 6XX - global error response
*
* Corresponding tag taking reference parameter is NUTAG_STATUS_REF().
*/
tag_typedef_t nutag_status = INTTAG_TYPEDEF(status);
-/**@def NUTAG_STATUS_REF(x)
+/**@def NUTAG_STATUS_REF(x)
* Reference tag for NUTAG_STATUS().
*/
@@ -2255,7 +2260,7 @@
*/
tag_typedef_t nutag_phrase = STRTAG_TYPEDEF(phrase);
-/**@def NUTAG_PHRASE_REF(x)
+/**@def NUTAG_PHRASE_REF(x)
* Reference tag for NUTAG_PHRASE().
*/
@@ -2275,7 +2280,7 @@
*/
tag_typedef_t nutag_handle = PTRTAG_TYPEDEF(handle);
-/**@def NUTAG_HANDLE_REF(x)
+/**@def NUTAG_HANDLE_REF(x)
* Reference tag for NUTAG_HANDLE().
*/
@@ -2303,7 +2308,7 @@
*/
tag_typedef_t nutag_notify_refer = PTRTAG_TYPEDEF(notify_refer);
-/**@def NUTAG_NOTIFY_REFER_REF(x)
+/**@def NUTAG_NOTIFY_REFER_REF(x)
* Reference tag for NUTAG_NOTIFY_REFER().
*/
@@ -2330,7 +2335,7 @@
*/
tag_typedef_t nutag_refer_event = SIPHDRTAG_NAMED_TYPEDEF(refer_event, event);
-/**@def NUTAG_REFER_EVENT_REF(x)
+/**@def NUTAG_REFER_EVENT_REF(x)
* Reference tag for NUTAG_REFER_EVENT().
*/
@@ -2348,11 +2353,11 @@
* nua_invite()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 False \n
- * @c !=0 True
+ * - 0 (false) - do not pause referring call
+ * - 1 (true) - pause referring call
*
* Corresponding tag taking reference parameter is NUTAG_REFER_PAUSE_REF().
*
@@ -2360,7 +2365,7 @@
*/
tag_typedef_t nutag_refer_pause = BOOLTAG_TYPEDEF(refer_pause);
-/**@def NUTAG_REFER_PAUSE_REF(x)
+/**@def NUTAG_REFER_PAUSE_REF(x)
* Reference tag for NUTAG_REFER_PAUSE().
*/
@@ -2395,7 +2400,7 @@
*/
tag_typedef_t nutag_user_agent = STRTAG_TYPEDEF(user_agent);
-/**@def NUTAG_USER_AGENT_REF(x)
+/**@def NUTAG_USER_AGENT_REF(x)
* Reference tag for NUTAG_USER_AGENT().
*/
@@ -2428,7 +2433,7 @@
*/
tag_typedef_t nutag_allow = STRTAG_TYPEDEF(allow);
-/**@def NUTAG_ALLOW_REF(x)
+/**@def NUTAG_ALLOW_REF(x)
* Reference tag for NUTAG_ALLOW().
*/
@@ -2468,7 +2473,7 @@
*/
tag_typedef_t nutag_allow_events = STRTAG_TYPEDEF(allow_events);
-/**@def NUTAG_ALLOW_EVENTS_REF(x)
+/**@def NUTAG_ALLOW_EVENTS_REF(x)
* Reference tag for NUTAG_ALLOW_EVENTS().
*/
@@ -2510,7 +2515,7 @@
*/
tag_typedef_t nutag_appl_method = STRTAG_TYPEDEF(appl_method);
-/**@def NUTAG_APPL_METHOD_REF(x)
+/**@def NUTAG_APPL_METHOD_REF(x)
* Reference tag for NUTAG_APPL_METHOD().
*/
@@ -2545,13 +2550,13 @@
*/
tag_typedef_t nutag_supported = STRTAG_TYPEDEF(supported);
-/**@def NUTAG_SUPPORTED_REF(x)
+/**@def NUTAG_SUPPORTED_REF(x)
* Reference tag for NUTAG_SUPPORTED().
*/
-/**@def NUTAG_PATH_ENABLE(x)
- *
+/**@def NUTAG_PATH_ENABLE(x)
+ *
* If true, add "path" to @Supported in REGISTER.
*
* @par Used with
@@ -2560,11 +2565,11 @@
* - nua_register()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 Do not include "path" to @Supported header
- * @c !=0 Include "path" to @Supported header
+ * - 0 (false) - Do not include "path" to @Supported header
+ * - 1 (true) - Include "path" to @Supported header
*
* @sa NUTAG_SERVICE_ROUTE_ENABLE(), NUTAG_SUPPORTED(),
* NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(), @RFC3327
@@ -2580,7 +2585,7 @@
-/**@def NUTAG_SERVICE_ROUTE_ENABLE(x)
+/**@def NUTAG_SERVICE_ROUTE_ENABLE(x)
*
* Use route taken from the @ServiceRoute header in the 200 class response
* to REGISTER.
@@ -2591,22 +2596,22 @@
* - nua_register()
*
* @par Parameter type
- * int
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
- * @c 0 Do not use @ServiceRoute
- * @c !=0 Use @ServiceRoute
+ * - 0 (false) - Do not use @ServiceRoute
+ * - 1 (true) - Use @ServiceRoute
*
* Corresponding tag taking reference parameter is NUTAG_SERVICE_ROUTE_ENABLE_REF().
*
* @sa NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(), @RFC3608
*
- * @todo
+ * @todo
*/
-tag_typedef_t nutag_service_route_enable =
+tag_typedef_t nutag_service_route_enable =
BOOLTAG_TYPEDEF(service_route_enable);
-/**@def NUTAG_SERVICE_ROUTE_ENABLE_REF(x)
+/**@def NUTAG_SERVICE_ROUTE_ENABLE_REF(x)
* Reference tag for NUTAG_SERVICE_ROUTE_ENABLE().
*/
@@ -2618,23 +2623,23 @@
* @par Used with
* nua_set_params(), nua_set_hparams() \n
* nua_get_params(), nua_get_hparams() \n
- * @NUA_HPARAM_CALLS
+ * @NUA_HPARAM_CALLS
*
* @par Parameter type
* enum nua_auth_cache
*
* @par Values
* - nua_auth_cache_dialog (0) - include credentials within dialog
- * - nua_auth_cache_challenged (1) - include credentials only when
+ * - nua_auth_cache_challenged (1) - include credentials only when
* challenged
- *
+ *
* Corresponding tag taking reference parameter is NUTAG_AUTH_CACHE_REF().
*
* @NEW_1_12_6.
*/
tag_typedef_t nutag_auth_cache = INTTAG_TYPEDEF(auth_cache);
-/**@def NUTAG_AUTH_CACHE_REF(x)
+/**@def NUTAG_AUTH_CACHE_REF(x)
* Reference tag for NUTAG_AUTH_CACHE().
*/
@@ -2660,7 +2665,7 @@
*/
tag_typedef_t nutag_detect_network_updates = UINTTAG_TYPEDEF(detect_network_updates);
-/**@def NUTAG_DETECT_NETWORK_UPDATES_REF(x)
+/**@def NUTAG_DETECT_NETWORK_UPDATES_REF(x)
* Reference tag for NUTAG_DETECT_NETWORK_UPDATES().
*/
@@ -2721,6 +2726,7 @@
tag_typedef_t nutag_with = PTRTAG_TYPEDEF(with);
+
/**@def NUTAG_DIALOG(x)
*
* An (extension) method is used to create dialog or refresh target.
@@ -2729,12 +2735,12 @@
* nua_method()
*
* @par Parameter type
- * unsigned int (0, 1, 2)
+ * unsigned int (0, 1, 2)
*
* @par Values
* - 0 if dialog target is not refreshed
* - 1 if dialog target is refreshed
- * - > 1 if dialog is to be created
+ * - > 1 if dialog is to be created
*
* @NEW_1_12_6.
*
@@ -2774,7 +2780,7 @@
* Corresponding tag taking reference parameter is NUTAG_PROXY_REF().
*/
-/**@def NUTAG_PROXY_REF(x)
+/**@def NUTAG_PROXY_REF(x)
* Reference tag for NUTAG_PROXY().
*/
@@ -2796,7 +2802,7 @@
* Corresponding tag taking reference parameter is NUTAG_SIP_PARSER_REF().
*/
-/**@def NUTAG_SIP_PARSER_REF(x)
+/**@def NUTAG_SIP_PARSER_REF(x)
* Reference tag for NUTAG_SIP_PARSER().
*/
@@ -2814,7 +2820,7 @@
* nua_create(), nua_set_params().
*
* @par Parameter type
- * int (boolean)
+ * int (boolean: nonzero is true, zero is false)
*
* @par Values
* - 0 (false) - pass only #nua_r_shutdown events to application during shutdown
@@ -2823,12 +2829,12 @@
* Corresponding tag taking reference parameter is NUTAG_SHUTDOWN_EVENTS_REF().
*
* @sa nua_shutdown(), nua_destroy().
- *
+ *
* @NEW_1_12_9.
*/
tag_typedef_t nutag_shutdown_events = BOOLTAG_TYPEDEF(shutdown_events);
-/**@def NUTAG_SHUTDOWN_EVENTS_REF(x)
+/**@def NUTAG_SHUTDOWN_EVENTS_REF(x)
* Reference tag for NUTAG_SHUTDOWN_EVENTS().
*/
1
0
[Freeswitch-svn] [commit] r9418 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:27:56 2008
New Revision: 9418
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
Log:
Wed Sep 3 13:49:53 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* outbound.c: do not use OPTIONS keepalive by default but on UDP
On TCP, use TCP-level keepalives.
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Sep 3 14:27:56 2008
@@ -1 +1 @@
-Wed Sep 3 14:27:05 EDT 2008
+Wed Sep 3 14:27:37 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Wed Sep 3 14:27:56 2008
@@ -77,7 +77,7 @@
unsigned gruuize:1; /**< Establish a GRUU */
unsigned outbound:1; /**< Try to use outbound */
unsigned natify:1; /**< Try to detect NAT */
- unsigned okeepalive:1; /**< Connection keepalive with OPTIONS */
+ signed okeepalive:2; /**< Connection keepalive with OPTIONS */
unsigned validate:1; /**< Validate registration with OPTIONS */
/* How to detect NAT binding or connect to outbound: */
unsigned use_connect:1; /**< Use HTTP connect */
@@ -270,7 +270,7 @@
prefs->gruuize = 1;
prefs->outbound = 0;
prefs->natify = 1;
- prefs->okeepalive = 1;
+ prefs->okeepalive = -1;
prefs->validate = 1;
prefs->use_rport = 1;
@@ -662,12 +662,18 @@
nta_outgoing_t *register_transaction)
{
unsigned interval = 0;
- int need_to_validate;
+ int need_to_validate, udp;
if (!ob)
return;
- if (ob->ob_prefs.natify && ob->ob_prefs.okeepalive)
+ udp = ob->ob_via && ob->ob_via->v_protocol == sip_transport_udp;
+
+ if (ob->ob_prefs.natify &&
+ /* On UDP, use OPTIONS keepalive by default */
+ (udp ? ob->ob_prefs.okeepalive != 0
+ /* Otherwise, only if requested */
+ : ob->ob_prefs.okeepalive > 0))
interval = ob->ob_prefs.interval;
need_to_validate = ob->ob_prefs.validate && !ob->ob_validated;
1
0
03 Sep '08
Author: mikej
Date: Wed Sep 3 14:27:14 2008
New Revision: 9417
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/configure.ac
Log:
Wed Sep 3 13:11:43 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* configure.ac: added --enable-memleag-log and HAVE_MEMLEAK_LOG
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Wed Sep 3 14:27:14 2008
@@ -1 +1 @@
-Thu Aug 14 12:02:14 EDT 2008
+Wed Sep 3 14:27:05 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Wed Sep 3 14:27:14 2008
@@ -151,6 +151,15 @@
AC_DEFINE([HAVE_SRTP], 0, [Define to 1 if we use SRTP])
AC_DEFINE([HAVE_UPNP], 0, [Define to 1 if we use UPnP])
+
+AC_ARG_ENABLE(memleak_log,
+[ --enable-memleak-log enable logging of possible memory leaks [[disabled]]],
+ , enable_memleak_log=no)
+
+if test x$enable_memleak_log = xyes ; then
+ AC_DEFINE([HAVE_MEMLEAK_LOG], 1, [Define to 1 for memory-leak-related logging])
+fi
+
### checks for header files
### -----------------------
AC_HEADER_STDC
1
0
[Freeswitch-svn] [commit] r9416 - freeswitch/trunk/src/mod/applications/mod_fax
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: brian
Date: Wed Sep 3 13:35:09 2008
New Revision: 9416
Modified:
freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
Log:
update header
Modified: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c Wed Sep 3 13:35:09 2008
@@ -1,8 +1,29 @@
/*
- * mod_fax.c (unholy forbidden interface to spandsp)
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct(a)yahoo.com>
*
- * Brian West <brian.west(a)mac.com>
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
*
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct(a)yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Brian West <brian.west(a)mac.com>
*
* mod_fax.c -- Fax Module
*
1
0
[Freeswitch-svn] [commit] r9415 - freeswitch/trunk/src/mod/applications/mod_fax
by Freeswitch SVN 03 Sep '08
by Freeswitch SVN 03 Sep '08
03 Sep '08
Author: anthm
Date: Wed Sep 3 13:08:30 2008
New Revision: 9415
Added:
freeswitch/trunk/src/mod/applications/mod_fax/
freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
Log:
add mod_fax rxfax
Added: freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/mod/applications/mod_fax/mod_fax.c Wed Sep 3 13:08:30 2008
@@ -0,0 +1,206 @@
+/*
+ * mod_fax.c (unholy forbidden interface to spandsp)
+ *
+ * Brian West <brian.west(a)mac.com>
+ *
+ *
+ * mod_fax.c -- Fax Module
+ *
+ */
+
+#include <switch.h>
+#include <spandsp.h>
+
+#define MAX_BLOCK_SIZE 240
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_fax_load);
+SWITCH_MODULE_DEFINITION(mod_fax, mod_fax_load, NULL, NULL);
+
+static void phase_e_handler(t30_state_t *s, void *user_data, int result)
+{
+ t30_stats_t t;
+ char local_ident[21];
+ char far_ident[21];
+
+ if (result == T30_ERR_OK)
+ {
+ t30_get_transfer_statistics(s, &t);
+ t30_get_far_ident(s, far_ident);
+ t30_get_local_ident(s, local_ident);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax successfully received.\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote station id: %s\n", far_ident);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local station id: %s\n", local_ident);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image resolution: %i x %i\n", t.x_resolution, t.y_resolution);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ }
+ else
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Fax receive not successful - result (%d) %s.\n", result, t30_completion_code_to_str(result));
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ }
+}
+
+static void phase_d_handler(t30_state_t *s, void *user_data, int result)
+{
+ t30_stats_t t;
+
+ if (result)
+ {
+ t30_get_transfer_statistics(s, &t);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Pages transferred: %i\n", t.pages_transferred);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image size: %i x %i\n", t.width, t.length);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image resolution %i x %i\n", t.x_resolution, t.y_resolution);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Transfer Rate: %i\n", t.bit_rate);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bad rows %i\n", t.bad_rows);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Longest bad row run %i\n", t.longest_bad_row_run);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compression type %i\n", t.encoding);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Image size (bytes) %i\n", t.image_size);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "==============================================================================\n");
+ }
+}
+
+SWITCH_STANDARD_APP(rxfax_function)
+{
+ switch_channel_t *channel;
+ switch_codec_t *orig_read_codec = NULL;
+ switch_codec_t read_codec = {0};
+ switch_codec_t write_codec = {0};
+ switch_frame_t *read_frame = {0};
+ switch_frame_t write_frame = {0};
+ switch_status_t status;
+ fax_state_t fax;
+ int16_t buf[512];
+ int tx = 0;
+ int calling_party = FALSE;
+ char *file_name = NULL;
+
+ file_name = switch_core_session_strdup(session, data);
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ switch_channel_answer(channel);
+
+ orig_read_codec = switch_core_session_get_read_codec(session);
+
+ if (switch_core_codec_init(&read_codec,
+ "L16",
+ NULL,
+ orig_read_codec->implementation->samples_per_second,
+ orig_read_codec->implementation->microseconds_per_frame / 1000,
+ 1,
+ SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+ NULL,
+ switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Success L16\n");
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16");
+ goto done;
+ }
+
+ if (switch_core_codec_init(&write_codec,
+ "L16",
+ NULL,
+ orig_read_codec->implementation->samples_per_second,
+ orig_read_codec->implementation->microseconds_per_frame / 1000,
+ 1,
+ SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
+ NULL,
+ switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Success L16\n");
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16");
+ goto done;
+ }
+
+ fax_init(&fax, calling_party);
+ t30_set_local_ident(&fax.t30_state, "test");
+ t30_set_header_info(&fax.t30_state, "test");
+ t30_set_rx_file(&fax.t30_state, file_name, -1);
+
+ t30_set_phase_d_handler(&fax.t30_state, phase_d_handler, NULL);
+ t30_set_phase_e_handler(&fax.t30_state, phase_e_handler, NULL);
+
+ t30_set_ecm_capability(&fax.t30_state, TRUE);
+ t30_set_supported_compressions(&fax.t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
+
+ t30_set_supported_image_sizes(&fax.t30_state, T30_SUPPORT_US_LETTER_LENGTH | T30_SUPPORT_US_LEGAL_LENGTH | T30_SUPPORT_UNLIMITED_LENGTH
+ | T30_SUPPORT_215MM_WIDTH | T30_SUPPORT_255MM_WIDTH | T30_SUPPORT_303MM_WIDTH);
+ t30_set_supported_resolutions(&fax.t30_state, T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION
+ | T30_SUPPORT_R8_RESOLUTION | T30_SUPPORT_R16_RESOLUTION);
+
+ write_frame.codec = &write_codec;
+ write_frame.data = buf;
+
+ while(switch_channel_ready(channel)) {
+ status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+ if (!SWITCH_READ_ACCEPTABLE(status)) {
+ goto done;
+ }
+
+ fax_rx(&fax, (int16_t *)read_frame->data, read_frame->samples);
+ if ((tx = fax_tx(&fax, (int16_t *) &buf, write_codec.implementation->samples_per_frame)) < 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fax Error\n");
+ goto done;
+ }
+
+ if (tx) {
+ write_frame.datalen = tx * sizeof(int16_t);
+ write_frame.samples = tx;
+
+ if (switch_core_session_write_frame(session, &write_frame, -1, 0) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Bad Write\n");
+ goto done;
+ }
+ }
+
+ }
+
+ done:
+
+ t30_terminate(&fax.t30_state);
+ fax_release(&fax);
+
+ if (read_codec.implementation) {
+ switch_core_codec_destroy(&read_codec);
+ }
+
+ if (write_codec.implementation) {
+ switch_core_codec_destroy(&write_codec);
+ }
+
+ if (orig_read_codec) {
+ switch_core_session_set_read_codec(session, orig_read_codec);
+ }
+
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_fax_load)
+
+{
+ switch_application_interface_t *app_interface;
+
+ /* connect my internal structure to the blank pointer passed to me */
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+ SWITCH_ADD_APP(app_interface, "rxfax", "Trivial FAX Receive Application", "Trivial FAX Receive Application", rxfax_function, "", SAF_NONE);
+
+ /* indicate that the module should continue to be loaded */
+ return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:nil
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ */
1
0
Author: brian
Date: Wed Sep 3 11:20:21 2008
New Revision: 9414
Modified:
freeswitch/trunk/src/switch_caller.c
Log:
allow you to get the privacy bits in the caller_profile
Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c (original)
+++ freeswitch/trunk/src/switch_caller.c Wed Sep 3 11:20:21 2008
@@ -198,6 +198,15 @@
if (!strcasecmp(name, "rdnis_numplan")) {
return switch_core_sprintf(caller_profile->pool, "%u", caller_profile->rdnis_numplan);
}
+ if (!strcasecmp(name, "screen_bit")) {
+ return switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "true" : "false";
+ }
+ if (!strcasecmp(name, "privacy_hide_name")) {
+ return switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "true" : "false";
+ }
+ if (!strcasecmp(name, "privacy_hide_number")) {
+ return switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "true" : "false";
+ }
return NULL;
}
@@ -273,13 +282,13 @@
}
switch_snprintf(header_name, sizeof(header_name), "%s-Screen-Bit", prefix);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "true" : "false");
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Name", prefix);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "true" : "false");
switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "true" : "false");
}
SWITCH_DECLARE(switch_status_t) switch_caller_extension_clone(switch_caller_extension_t **new_ext, switch_caller_extension_t *orig,
1
0