<param name="log-level" value="0"/>
<!-- <param name="auto-restart" value="false"/> -->
<param name="debug-presence" value="0"/>
+ <!-- <param name="capture-server" value="udp:homer.domain.com:5060"/> -->
</global_settings>
<!--
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<param name="sip-trace" value="no"/>
+ <param name="sip-capture" value="no"/>
<param name="rfc2833-pt" value="101"/>
<param name="sip-port" value="$${external_sip_port}"/>
<param name="dialplan" value="XML"/>
<!-- If you want FreeSWITCH to shutdown if this profile fails to load, uncomment the next line. -->
<!-- <param name="shutdown-on-fail" value="true"/> -->
<param name="sip-trace" value="no"/>
-
+ <param name="sip-capture" value="no"/>
+
<!-- Don't be picky about negotiated DTMF just always offer 2833 and accept both 2833 and INFO -->
<!--<param name="liberal-dtmf" value="true"/>-->
goto done;
}
+ if (!strcasecmp(argv[1], "capture")) {
+ if (argc > 2) {
+ int value = switch_true(argv[2]);
+ nua_set_params(profile->nua, TPTAG_CAPT(value ? mod_sofia_globals.capture_server : NULL), TAG_END());
+ stream->write_function(stream, "%s sip capturing on %s", value ? "Enabled" : "Disabled", profile->name);
+ } else {
+ stream->write_function(stream, "Usage: sofia profile <name> capture <on/off>\n");
+ }
+ goto done;
+ }
+
if (!strcasecmp(argv[1], "watchdog")) {
if (argc > 2) {
int value = switch_true(argv[2]);
static const char usage_string[] = "USAGE:\n"
"--------------------------------------------------------------------------------\n"
"sofia global siptrace <on|off>\n"
+ "sofia capture <on|off>\n"
" watchdog <on|off>\n\n"
"sofia profile <name> [start | stop | restart | rescan]\n"
" flush_inbound_reg [<call_id> | <[user]@domain>] [reboot]\n"
" killgw <gateway name>\n"
" [stun-auto-disable | stun-enabled] [true | false]]\n"
" siptrace <on|off>\n"
+ " capture <on|off>\n"
" watchdog <on|off>\n\n"
"sofia <status|xmlstatus> profile <name> [reg <contact str>] | [pres <pres str>] | [user <user@domain>]\n"
"sofia <status|xmlstatus> gateway <name>\n\n"
goto done;
} else if (!strcasecmp(argv[0], "global")) {
int ston = -1;
+ int cton = -1;
int wdon = -1;
if (argc > 1) {
}
}
+ if (!strcasecmp(argv[1], "capture")) {
+ if (argc > 2) {
+ cton = switch_true(argv[2]);
+ }
+ }
+
if (!strcasecmp(argv[1], "watchdog")) {
if (argc > 2) {
wdon = switch_true(argv[2]);
if (ston != -1) {
sofia_glue_global_siptrace(ston);
stream->write_function(stream, "+OK Global siptrace %s", ston ? "on" : "off");
+ } else if (cton != -1) {
+ sofia_glue_global_capture(cton);
+ stream->write_function(stream, "+OK Global capture %s", cton ? "on" : "off");
} else if (wdon != -1) {
sofia_glue_global_watchdog(wdon);
stream->write_function(stream, "+OK Global watchdog %s", wdon ? "on" : "off");
} else {
- stream->write_function(stream, "-ERR Usage: siptrace <on|off>|watchdog <on|off>|debug <sla|presence|none");
+ stream->write_function(stream, "-ERR Usage: siptrace <on|off>|capture <on|off>|watchdog <on|off>|debug <sla|presence|none");
}
goto done;
switch_console_set_complete("add sofia tracelevel ::[console:alert:crit:err:warning:notice:info:debug");
switch_console_set_complete("add sofia global siptrace ::[on:off");
+ switch_console_set_complete("add sofia global capture ::[on:off");
switch_console_set_complete("add sofia global watchdog ::[on:off");
switch_console_set_complete("add sofia global debug ::[presence:sla:none");
switch_console_set_complete("add sofia profile ::sofia::list_profiles killgw ::sofia::list_profile_gateway");
switch_console_set_complete("add sofia profile ::sofia::list_profiles siptrace on");
switch_console_set_complete("add sofia profile ::sofia::list_profiles siptrace off");
+ switch_console_set_complete("add sofia profile ::sofia::list_profiles capture on");
+ switch_console_set_complete("add sofia profile ::sofia::list_profiles capture off");
switch_console_set_complete("add sofia profile ::sofia::list_profiles watchdog on");
switch_console_set_complete("add sofia profile ::sofia::list_profiles watchdog off");
TFLAG_NOREPLY,
TFLAG_LIBERAL_DTMF,
TFLAG_GOT_ACK,
+ TFLAG_CAPTURE,
/* No new flags below this line */
TFLAG_MAX
} TFLAGS;
int auto_restart;
int auto_nat;
int tracelevel;
+ char *capture_server;
int rewrite_multicasted_fs_path;
};
extern struct mod_sofia_globals mod_sofia_globals;
switch_console_callback_match_t *sofia_reg_find_reg_url_multi(sofia_profile_t *profile, const char *user, const char *host);
switch_bool_t sofia_glue_profile_exists(const char *key);
void sofia_glue_global_siptrace(switch_bool_t on);
+void sofia_glue_global_capture(switch_bool_t on);
void sofia_glue_global_watchdog(switch_bool_t on);
void sofia_glue_proxy_codec(switch_core_session_t *session, const char *r_sdp);
switch_status_t sofia_glue_sdp_map(const char *r_sdp, switch_event_t **fmtp, switch_event_t **pt);
NTATAG_SERVER_RPORT(profile->server_rport_level),
NTATAG_CLIENT_RPORT(profile->client_rport_level),
TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)),
+ TPTAG_CAPT(sofia_test_flag(profile, TFLAG_CAPTURE) ? mod_sofia_globals.capture_server : NULL),
TAG_IF(sofia_test_pflag(profile, PFLAG_SIPCOMPACT),
NTATAG_SIPFLAGS(MSG_DO_COMPACT)),
TAG_IF(profile->timer_t1, NTATAG_SIP_T1(profile->timer_t1)),
mod_sofia_globals.rewrite_multicasted_fs_path = SWITCH_FALSE;
}
}
+ else if (!strcasecmp(var, "capture-server")) {
+ mod_sofia_globals.capture_server = switch_core_strdup(mod_sofia_globals.pool, val);
+ }
}
}
sofia_clear_flag(profile, TFLAG_TPORT_LOG);
}
nua_set_params(profile->nua, TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), TAG_END());
+ } else if (!strcasecmp(var, "sip-capture")) {
+ if (switch_true(val)) {
+ sofia_set_flag(profile, TFLAG_CAPTURE);
+ } else {
+ sofia_clear_flag(profile, TFLAG_CAPTURE);
+ }
+ nua_set_params(profile->nua, TPTAG_CAPT(sofia_test_flag(profile, TFLAG_CAPTURE) ? mod_sofia_globals.capture_server : NULL), TAG_END());
} else if (!strcasecmp(var, "send-message-query-on-register")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
mod_sofia_globals.rewrite_multicasted_fs_path = SWITCH_FALSE;
}
}
+ else if (!strcasecmp(var, "capture-server")) {
+ mod_sofia_globals.capture_server = switch_core_strdup(mod_sofia_globals.pool, val);
+ }
}
}
profile->shutdown_type = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "sip-trace") && switch_true(val)) {
sofia_set_flag(profile, TFLAG_TPORT_LOG);
+ } else if (!strcasecmp(var, "sip-capture") && switch_true(val)) {
+ sofia_set_flag(profile, TFLAG_CAPTURE);
+ nua_set_params(profile->nua, TPTAG_CAPT(mod_sofia_globals.capture_server), TAG_END());
} else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
if (switch_odbc_available()) {
profile->odbc_dsn = switch_core_strdup(profile->pool, val);
}
+void sofia_glue_global_capture(switch_bool_t on)
+{
+ switch_hash_index_t *hi;
+ const void *var;
+ void *val;
+ sofia_profile_t *pptr;
+
+ switch_mutex_lock(mod_sofia_globals.hash_mutex);
+ if (mod_sofia_globals.profile_hash) {
+ for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
+ switch_hash_this(hi, &var, NULL, &val);
+ if ((pptr = (sofia_profile_t *) val)) {
+ nua_set_params(pptr->nua, TPTAG_CAPT(on ? mod_sofia_globals.capture_server : NULL), TAG_END());
+ }
+ }
+ }
+ switch_mutex_unlock(mod_sofia_globals.hash_mutex);
+
+}
+
+
void sofia_glue_global_watchdog(switch_bool_t on)
{
switch_hash_index_t *hi;