Merge branch 'releases.3.5' of ssh://git.sangoma.com/smg_freeswitch into nsg-4.3

Conflicts:
	.gitignore
	conf/insideout/autoload_configs/modules.conf.xml
	conf/vanilla/autoload_configs/modules.conf.xml
	src/mod/endpoints/mod_sofia/mod_sofia.h
	src/switch_rtp.c
This commit is contained in:
David Yat Sin committed 2012-07-25 11:15:18 -04:00
commit 8b0fbe605c
798 files changed
+62919 -81329

No files matched your search

+5 -4
View File
@@ -4165,7 +4165,7 @@ nta_leg_t *nta_leg_tcreate(nta_agent_t *agent,
if (i == NONE) /* Magic value, used for compatibility */
no_dialog = 1;
if (!(leg = su_home_clone(agent->sa_home, sizeof(*leg))))
if (!(leg = su_home_clone(NULL, sizeof(*leg))))
return NULL;
home = leg->leg_home;
@@ -4394,7 +4394,8 @@ void nta_leg_destroy(nta_leg_t *leg)
static
void leg_free(nta_agent_t *sa, nta_leg_t *leg)
{
su_free(sa->sa_home, leg);
//su_free(sa->sa_home, leg);
su_home_unref((su_home_t *)leg);
}
/** Return application context for the leg */
@@ -5327,7 +5328,7 @@ nta_incoming_t *incoming_create(nta_agent_t *agent,
}
irq->irq_branch = sip->sip_via->v_branch;
irq->irq_reliable_tp = tport_is_reliable(tport);
irq->irq_extra_100 = 1; /* Sending extra 100 trying true by default */
irq->irq_extra_100 = 0; /* Sending extra 100 trying false by default */
if (sip->sip_timestamp)
irq->irq_timestamp = sip_timestamp_copy(home, sip->sip_timestamp);
@@ -6068,7 +6069,7 @@ incoming_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tport)
if (irq->irq_status >= 100) {
SU_DEBUG_5(("nta: re-received %s request, retransmitting %u reply\n",
sip->sip_request->rq_method_name, irq->irq_status));
incoming_retransmit_reply(irq, tport);
incoming_retransmit_reply(irq, tport);
}
else if (irq->irq_agent->sa_extra_100 &&
irq->irq_extra_100) {
@@ -1212,10 +1212,12 @@ int nua_base_client_check_restart(nua_client_request_t *cr,
return 1;
}
}
if (0 && 500 <= status && status < 600 &&
/* GriGiu : RFC-3261 status supported Retry-After */
if ( (status == 404 || status == 413 || status == 480 || status == 486 ||
status == 500 || status == 503 ||
status == 600 || status == 603) &&
sip->sip_retry_after &&
sip->sip_retry_after->af_delta < 32) {
sip->sip_retry_after->af_delta < 3200) {
su_timer_t *timer;
char phrase[18]; /* Retry After XXXX\0 */
@@ -109,8 +109,8 @@ nua_handle_t *nh_create_handle(nua_t *nua,
assert(nua->nua_home);
if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) {
//if ((nh = su_home_new(sizeof(*nh)))) {
//if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) {
if ((nh = su_home_new(sizeof(*nh)))) {
nh->nh_valid = nua_valid_handle_cookie;
nh->nh_nua = nua;
nh->nh_magic = hmagic;
@@ -139,6 +139,7 @@ int nua_stack_set_defaults(nua_handle_t *nh,
NHP_SET(nhp, only183_100rel, 0);
NHP_SET(nhp, auto_answer, 0);
NHP_SET(nhp, auto_ack, 1);
NHP_SET(nhp, timer_autorequire, 1);
NHP_SET(nhp, invite_timeout, 120);
nhp->nhp_session_timer = 1800;
@@ -741,6 +742,10 @@ static int nhp_set_tags(su_home_t *home,
else if (tag == nutag_autoack) {
NHP_SET(nhp, auto_ack, value != 0);
}
/* NUTAG_TIMER_AUTOREQUIRE(timer_autorequire) */
else if (tag == nutag_timer_autorequire) {
NHP_SET(nhp, timer_autorequire, value != 0);
}
/* NUTAG_INVITE_TIMER(invite_timeout) */
else if (tag == nutag_invite_timer) {
NHP_SET(nhp, invite_timeout, (unsigned)value);
@@ -1647,6 +1652,7 @@ int nua_stack_get_params(nua_t *nua, nua_handle_t *nh, nua_event_t e,
TIF(NUTAG_ONLY183_100REL, only183_100rel),
TIF(NUTAG_AUTOANSWER, auto_answer),
TIF(NUTAG_AUTOACK, auto_ack),
TIF(NUTAG_TIMER_AUTOREQUIRE, timer_autorequire),
TIF(NUTAG_INVITE_TIMER, invite_timeout),
TIFD(NUTAG_SESSION_TIMER, session_timer),
@@ -109,6 +109,8 @@ struct nua_handle_preferences
/** Always include id with Event: refer */
unsigned nhp_refer_with_id:1;
unsigned nhp_timer_autorequire:1;
unsigned:0;
/* Default lifetime for implicit subscriptions created by REFER */
@@ -207,6 +209,7 @@ struct nua_handle_preferences
unsigned nhb_appl_method:1;
unsigned nhb_initial_route:1;
unsigned nhb_proxy:1;
unsigned nhb_timer_autorequire:1;
unsigned :0;
} set_bits;
unsigned set_unsigned[2];
@@ -261,11 +261,12 @@ int nua_stack_process_request(nua_handle_t *nh,
}
if (sr->sr_status <= 100) {
SR_STATUS1(sr, SIP_100_TRYING);
SR_STATUS1(sr, SIP_100_TRYING);
if (method == sip_method_invite || sip->sip_timestamp) {
nta_incoming_treply(irq, SIP_100_TRYING,
SIPTAG_USER_AGENT_STR(user_agent),
TAG_END());
nta_incoming_treply(irq, SIP_100_TRYING,
SIPTAG_USER_AGENT_STR(user_agent),
TAG_END());
}
}
else {
@@ -370,7 +370,8 @@ static int session_timer_check_min_se(msg_t *msg, sip_t *sip,
static int session_timer_add_headers(struct session_timer *t,
int initial,
msg_t *msg, sip_t *sip);
msg_t *msg, sip_t *sip,
nua_handle_t *nh);
static void session_timer_negotiate(struct session_timer *t, int uas);
@@ -791,7 +792,7 @@ static int nua_invite_client_request(nua_client_request_t *cr,
/* Add session timer headers */
if (session_timer_is_supported(ss->ss_timer))
session_timer_add_headers(ss->ss_timer, ss->ss_state == nua_callstate_init,
msg, sip);
msg, sip, nh);
ss->ss_100rel = NH_PGET(nh, early_media);
ss->ss_precondition = sip_has_feature(sip->sip_require, "precondition");
@@ -2436,7 +2437,7 @@ int nua_invite_server_respond(nua_server_request_t *sr, tagi_t const *tags)
NH_PGET(nh, min_se));
if (session_timer_is_supported(ss->ss_timer))
session_timer_add_headers(ss->ss_timer, 0, msg, sip);
session_timer_add_headers(ss->ss_timer, 0, msg, sip, nh);
}
return nua_base_server_respond(sr, tags);
@@ -3354,7 +3355,7 @@ static int nua_update_client_request(nua_client_request_t *cr,
if (session_timer_is_supported(ss->ss_timer))
session_timer_add_headers(ss->ss_timer, ss->ss_state < nua_callstate_ready,
msg, sip);
msg, sip, nh);
retval = nua_base_client_request(cr, msg, sip, NULL);
@@ -3610,7 +3611,7 @@ int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags)
nua_server_request_t *sr0;
int uas;
session_timer_add_headers(ss->ss_timer, 0, msg, sip);
session_timer_add_headers(ss->ss_timer, 0, msg, sip, nh);
for (sr0 = nh->nh_ds->ds_sr; sr0; sr0 = sr0->sr_next)
if (sr0->sr_method == sip_method_invite)
@@ -4426,18 +4427,24 @@ static int
session_timer_add_headers(struct session_timer *t,
int initial,
msg_t *msg,
sip_t *sip)
sip_t *sip,
nua_handle_t *nh)
{
unsigned long expires, min;
sip_min_se_t min_se[1];
sip_session_expires_t x[1];
int uas;
int autorequire = 1;
enum nua_session_refresher refresher = nua_any_refresher;
static sip_param_t const x_params_uac[] = {"refresher=uac", NULL};
static sip_param_t const x_params_uas[] = {"refresher=uas", NULL};
if ( !NH_PGET(nh, timer_autorequire) && NH_PISSET(nh, timer_autorequire)) {
autorequire = 0;
}
if (!t->local.supported)
return 0;
@@ -4491,7 +4498,7 @@ session_timer_add_headers(struct session_timer *t,
/* Min-SE: 0 is optional with initial INVITE */
|| !initial,
SIPTAG_MIN_SE(min_se)),
//TAG_IF(refresher == nua_remote_refresher && expires != 0, SIPTAG_REQUIRE_STR("timer")),
TAG_IF(autorequire && refresher == nua_remote_refresher && expires != 0, SIPTAG_REQUIRE_STR("timer")),
TAG_END());
return 1;
@@ -1329,6 +1329,8 @@ tag_typedef_t nutag_autoanswer = BOOLTAG_TYPEDEF(autoAnswer);
*/
tag_typedef_t nutag_autoack = BOOLTAG_TYPEDEF(autoACK);
tag_typedef_t nutag_timer_autorequire = BOOLTAG_TYPEDEF(timerAutorequire);
/**@def NUTAG_AUTOACK_REF(x)
* Reference tag for NUTAG_AUTOACK().
*/
@@ -199,6 +199,11 @@ SOFIAPUBVAR tag_typedef_t nutag_autoack;
#define NUTAG_AUTOACK_REF(x) nutag_autoack_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_autoack_ref;
#define NUTAG_TIMER_AUTOREQUIRE(x) nutag_timer_autorequire, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_timer_autorequire;
#define NUTAG_TIMER_AUTOREQUIRE_REF(x) nutag_timer_autorequire_ref, tag_bool_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_timer_autorequire_ref;
#define NUTAG_AUTOANSWER(x) nutag_autoanswer, tag_bool_v(x)
SOFIAPUBVAR tag_typedef_t nutag_autoanswer;
#define NUTAG_AUTOANSWER_REF(x) nutag_autoanswer_ref, tag_bool_vr(&(x))
@@ -409,8 +409,10 @@ static int
li_scope6(struct in6_addr const *ip6)
{
if (IN6_IS_ADDR_V4MAPPED(ip6) || IN6_IS_ADDR_V4COMPAT(ip6)) {
uint32_t ip4 = *(uint32_t *)(ip6->s6_addr + 12);
return li_scope4(ip4);
uint32_t *u = (uint32_t *)(ip6->s6_addr + 12);
uint32_t ip4 = *u;
return li_scope4(ip4);
}
else if (IN6_IS_ADDR_LOOPBACK(ip6))
return LI_SCOPE_HOST;