<param name="sip-ip" value="$${local_ip_v4}"/>
<!--enable to use presense and mwi -->
<param name="manage-presence" value="true"/>
+ <!--max number of open dialogs in proceeding -->
+ <!--<param name="max-proceeding" value="1000"/>-->
+ <!--session timers for all call to expire after the specified seconds -->
+ <!--<param name="session-timeout" value="120"/>-->
<!--<param name="multiple-registrations" value="true"/>-->
<!--set to 'greedy' if you want your codec list to take precedence -->
<param name="inbound-codec-negotiation" value="generous"/>
private_object_t *tech_pvt;
switch_channel_t *channel = NULL;
switch_status_t status;
+ uint32_t session_timeout = 0;
+ char *val;
assert(session != NULL);
}
}
+
+ if ((val = switch_channel_get_variable(channel, SOFIA_SESSION_TIMEOUT))) {
+ int v_session_timeout = atoi(val);
+ if (v_session_timeout >= 0) {
+ session_timeout = v_session_timeout;
+ }
+ }
+
nua_respond(tech_pvt->nh, SIP_200_OK,
+ NUTAG_SESSION_TIMER(session_timeout),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1), TAG_END());
stream->write_function(stream, "CODECS \t%s\n", switch_str_nil(profile->codec_string));
stream->write_function(stream, "TEL-EVENT \t%d\n", profile->te);
stream->write_function(stream, "CNG \t%d\n", profile->cng_pt);
+ stream->write_function(stream, "SESSION-TO \t%d\n", profile->session_timeout);
+ stream->write_function(stream, "MAX-DIALOG \t%d\n", profile->max_proceeding);
stream->write_function(stream, "\nRegistrations:\n%s\n", line);
stream->write_function(stream, "%s", usage_string);
goto done;
}
-
+
if (!strcasecmp(argv[0], "profile")) {
func = cmd_profile;
} else if (!strcasecmp(argv[0], "status")) {
typedef struct private_object private_object_t;
#define NUA_HMAGIC_T sofia_private_t
+#define SOFIA_SESSION_TIMEOUT "sofia_session_timeout"
#define MY_EVENT_REGISTER "sofia::register"
#define MY_EVENT_EXPIRE "sofia::expire"
#define MULTICAST_EVENT "multicast::event"
uint32_t inuse;
uint32_t soft_max;
time_t started;
+ uint32_t session_timeout;
+ uint32_t max_proceeding;
#ifdef SWITCH_HAVE_ODBC
char *odbc_dsn;
char *odbc_user;
NUTAG_ALLOW("INFO"),
NUTAG_ALLOW("NOTIFY"),
NUTAG_ALLOW_EVENTS("talk"),
+ NUTAG_SESSION_TIMER(profile->session_timeout),
+ NTATAG_MAX_PROCEEDING(profile->max_proceeding),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("PUBLISH")),
//TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("NOTIFY")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("SUBSCRIBE")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence.winfo")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("message-summary")),
- SIPTAG_SUPPORTED_STR("100rel, precondition"), SIPTAG_USER_AGENT_STR(SOFIA_USER_AGENT), TAG_END());
+ SIPTAG_SUPPORTED_STR("100rel, precondition, timer"), SIPTAG_USER_AGENT_STR(SOFIA_USER_AGENT), TAG_END());
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set params for %s\n", profile->name);
profile->timer_name = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "hold-music")) {
profile->hold_music = switch_core_strdup(profile->pool, val);
+ } else if (!strcasecmp(var, "session-timeout")) {
+ int v_session_timeout = atoi(val);
+ if (v_session_timeout >= 0) {
+ profile->session_timeout = v_session_timeout;
+ }
+ } else if (!strcasecmp(var, "max-proceeding")) {
+ int v_max_proceeding = atoi(val);
+ if (v_max_proceeding >= 0) {
+ profile->max_proceeding = v_max_proceeding;
+ }
} else if (!strcasecmp(var, "manage-presence")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_PRESENCE;
switch_event_header_t *hi;
char *extra_headers = NULL;
switch_status_t status = SWITCH_STATUS_FALSE;
+ uint32_t session_timeout = 0;
+ char *val;
char *rep;
channel = switch_core_session_get_channel(session);
if (stream.data) {
extra_headers = stream.data;
}
+
+ if ((val = switch_channel_get_variable(channel, SOFIA_SESSION_TIMEOUT))) {
+ int v_session_timeout = atoi(val);
+ if (v_session_timeout >= 0) {
+ session_timeout = v_session_timeout;
+ }
+ }
nua_invite(tech_pvt->nh,
+ NUTAG_SESSION_TIMER(session_timeout),
TAG_IF(!switch_strlen_zero(rpid), SIPTAG_HEADER_STR(rpid)),
TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", codec->implementation->iananame);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", codec->implementation->samples_per_second);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
+ if (codec->implementation->actual_samples_per_second != codec->implementation->samples_per_second) {
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-read-codec-rate", "%d", codec->implementation->samples_per_second);
+ }
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", codec->implementation->samples_per_second);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
+ if (codec->implementation->actual_samples_per_second != codec->implementation->samples_per_second) {
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
+ }
switch_event_fire(&event);
}