mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-17 14:58:34 +00:00
sync to current darcs tree:
Tue Nov 20 11:46:34 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * nua_register.c: silenced warning with URL_INIT_AS() on Sun CC Tue Nov 20 11:47:06 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * test_register.c: fixed authentication caching issue Tue Nov 20 12:09:19 EST 2007 Pekka.Pessi@nokia.com * tport: tport_name_is_resolved() now uses host_is_ip_address() Tue Nov 20 12:53:54 EST 2007 Pekka.Pessi@nokia.com * tport.c: fixed EXPENSIVE unresolved bug. Wed Nov 21 07:10:40 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * test_tport.c: skipping tests on TLS if send fails. Wed Nov 21 11:46:42 EST 2007 Pekka.Pessi@nokia.com * test_nta.c: removed dead code Thu Nov 22 08:42:14 EST 2007 Pekka.Pessi@nokia.com * test_nta.c: refactored client side tests Thu Nov 22 09:39:45 EST 2007 Pekka.Pessi@nokia.com * nta: added nta_sip_is_internal(). Tue Nov 27 13:43:41 EST 2007 Pekka.Pessi@nokia.com * test_htable2.c: removed conversion warning Conversion of size_t to isize_t when compiled wihout --disable-size-compat. Wed Nov 21 11:16:04 EST 2007 Daniele Rondina <geaaru at gmail dot com> * nta.c: nta_outgoing_*create() now uses NTATAG_TPORT() even if NTATAG_DEFAULT_PROXY() is set Thu Nov 22 09:36:21 EST 2007 Pekka.Pessi@nokia.com * nta.c: always use tport from NTATAG_TPORT() (even if it is bad) Add tests, too. Thu Nov 22 10:01:33 EST 2007 Pekka.Pessi@nokia.com * nta: added nta_msg_is_internal(). Mon Nov 26 17:08:16 EST 2007 Pekka.Pessi@nokia.com * test_proxy.c: removed memory leaks Mon Nov 26 17:08:35 EST 2007 Pekka.Pessi@nokia.com * test_basic_call.c: fixed --no-proxy tests Mon Nov 26 17:12:27 EST 2007 Pekka.Pessi@nokia.com * sofia-sip/su_wait.h: added su_msg_new(), su_msg_send_to(), su_msg_deinitializer() Reduce overhead from message passing. Mon Nov 26 19:15:41 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * configure.ac: defining HAVE_SOFIA_HTTP Mon Nov 26 19:23:05 EST 2007 Pekka.Pessi@nokia.com * nua: moved message passing into nua_stack.c. Recfactored reference counting. This seems to fix the memory leak within 1.12.7. Wed Nov 28 10:15:07 EST 2007 Pekka.Pessi@nokia.com * test_su.c: removed calls of deprecated (and unimplemented) functions su_clone_pause()/su_clone_resume() Thu Nov 22 09:59:13 EST 2007 Pekka.Pessi@nokia.com * nua_stack.c: more logging on bad authentication Mon Nov 26 19:49:34 EST 2007 Pekka.Pessi@nokia.com * tport.h, tport.c: updated tport_create() docs Thu Nov 29 12:17:40 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * tport: collecting statistics Thu Nov 29 12:21:10 EST 2007 Pekka.Pessi@nokia.com * rules/sofia.am: defining INTERNAL_INCLUDES so it can be used from any subdir utils/Makefile.am, libsofia-sip-ua/nua/Makefile.am: using INCLUDES from sofia.am Thu Nov 29 13:03:44 EST 2007 Pekka.Pessi@nokia.com * nua: moved test_nua contents in ltlibraries Thu Nov 29 13:05:25 EST 2007 Pekka.Pessi@nokia.com * Makefile.am, configure.ac: added subdir tests for Check-based module tests Fri Nov 30 09:03:14 EST 2007 Pekka Pessi <Pekka.Pessi@nokia.com> * nua_session.c: avoid NULL nua_session_state_t pointer in nua_update_client_report Thanks to Fabio Margarido for reporting this problem. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6539 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
3c14db6122
commit
058ab862b3
43 files changed
+2508
-2044
No files matched your search
@@ -2780,12 +2780,26 @@ void nta_msg_discard(nta_agent_t *agent, msg_t *msg)
|
||||
msg_destroy(msg);
|
||||
}
|
||||
|
||||
/** Check if the headers are from response generated locally by NTA. */
|
||||
int nta_sip_is_internal(sip_t const *sip)
|
||||
{
|
||||
return
|
||||
sip == NULL /* No message generated */
|
||||
|| (sip->sip_flags & NTA_INTERNAL_MSG) == NTA_INTERNAL_MSG;
|
||||
}
|
||||
|
||||
/** Check if the message is internally generated by NTA. */
|
||||
int nta_is_internal_msg(msg_t const *msg)
|
||||
int nta_msg_is_internal(msg_t const *msg)
|
||||
{
|
||||
return msg_get_flags(msg, NTA_INTERNAL_MSG) == NTA_INTERNAL_MSG;
|
||||
}
|
||||
|
||||
/** Check if the message is internally generated by NTA.
|
||||
*
|
||||
* @deprecated Use nta_msg_is_internal() instead
|
||||
*/
|
||||
int nta_is_internal_msg(msg_t const *msg) { return nta_msg_is_internal(msg); }
|
||||
|
||||
/* ====================================================================== */
|
||||
/* 5) Stateless operation */
|
||||
|
||||
@@ -6343,6 +6357,7 @@ static int outgoing_features(nta_agent_t *agent, nta_outgoing_t *orq,
|
||||
msg_t *msg, sip_t *sip,
|
||||
tagi_t *tags);
|
||||
static void outgoing_prepare_send(nta_outgoing_t *orq);
|
||||
static void outgoing_send_via(nta_outgoing_t *orq, tport_t *tp);
|
||||
static void outgoing_send(nta_outgoing_t *orq, int retransmit);
|
||||
static void outgoing_try_tcp_instead(nta_outgoing_t *orq);
|
||||
static void outgoing_try_udp_instead(nta_outgoing_t *orq);
|
||||
@@ -6884,7 +6899,7 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
|
||||
int invite_100rel = agent->sa_invite_100rel;
|
||||
|
||||
tagi_t const *t;
|
||||
tport_t const *override_tport = NULL;
|
||||
tport_t *override_tport = NULL;
|
||||
|
||||
if (!agent->sa_tport_ip6)
|
||||
res_order = nta_res_ip4_only;
|
||||
@@ -6988,11 +7003,16 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
|
||||
tpn = tport_name(override_tport);
|
||||
orq->orq_user_tport = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (route_url) {
|
||||
if (route_url && !orq->orq_user_tport) {
|
||||
invalid = nta_tpn_by_url(home, orq->orq_tpn, &scheme, &port, route_url);
|
||||
|
||||
if (override_tport) { /* Use transport protocol name from transport */
|
||||
if (strcmp(orq->orq_tpn->tpn_proto, "*") == 0)
|
||||
orq->orq_tpn->tpn_proto = tport_name(override_tport)->tpn_proto;
|
||||
}
|
||||
|
||||
resolved = tport_name_is_resolved(orq->orq_tpn);
|
||||
orq->orq_url = url_hdup(home, sip->sip_request->rq_url);
|
||||
if (route_url != (url_string_t *)agent->sa_default_proxy)
|
||||
@@ -7015,7 +7035,11 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
|
||||
sip_fragment_clear(sip->sip_request->rq_common);
|
||||
}
|
||||
|
||||
orq->orq_tpn->tpn_ident = tp_ident;
|
||||
if (!override_tport)
|
||||
orq->orq_tpn->tpn_ident = tp_ident;
|
||||
else
|
||||
orq->orq_tpn->tpn_ident = tport_name(override_tport)->tpn_ident;
|
||||
|
||||
if (comp == NULL)
|
||||
orq->orq_tpn->tpn_comp = comp;
|
||||
|
||||
@@ -7100,7 +7124,9 @@ nta_outgoing_t *outgoing_create(nta_agent_t *agent,
|
||||
agent->sa_stats->as_client_tr++;
|
||||
orq->orq_hash = NTA_HASH(sip->sip_call_id, sip->sip_cseq->cs_seq);
|
||||
|
||||
if (resolved)
|
||||
if (orq->orq_user_tport)
|
||||
outgoing_send_via(orq, override_tport);
|
||||
else if (resolved)
|
||||
outgoing_prepare_send(orq);
|
||||
#if HAVE_SOFIA_SRESOLV
|
||||
else
|
||||
@@ -7146,7 +7172,6 @@ outgoing_prepare_send(nta_outgoing_t *orq)
|
||||
tpn->tpn_port = "";
|
||||
|
||||
tp = tport_by_name(sa->sa_tports, tpn);
|
||||
orq->orq_tport = tport_ref(tp);
|
||||
|
||||
if (tpn->tpn_port[0] == '\0') {
|
||||
if (sips || tport_has_tls(tp))
|
||||
@@ -7155,17 +7180,28 @@ outgoing_prepare_send(nta_outgoing_t *orq)
|
||||
tpn->tpn_port = "5060";
|
||||
}
|
||||
|
||||
if (!orq->orq_tport) {
|
||||
if (sips) {
|
||||
SU_DEBUG_3(("nta outgoing create: no secure transport\n"));
|
||||
outgoing_reply(orq, SIP_416_UNSUPPORTED_URI, 1);
|
||||
}
|
||||
else {
|
||||
SU_DEBUG_3(("nta outgoing create: no transport protocol\n"));
|
||||
outgoing_reply(orq, 503, "No transport", 1);
|
||||
}
|
||||
return;
|
||||
if (tp) {
|
||||
outgoing_send_via(orq, tp);
|
||||
}
|
||||
else if (sips) {
|
||||
SU_DEBUG_3(("nta outgoing create: no secure transport\n"));
|
||||
outgoing_reply(orq, SIP_416_UNSUPPORTED_URI, 1);
|
||||
}
|
||||
else {
|
||||
SU_DEBUG_3(("nta outgoing create: no transport protocol\n"));
|
||||
outgoing_reply(orq, 503, "No transport", 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** Send request using given transport */
|
||||
static void
|
||||
outgoing_send_via(nta_outgoing_t *orq, tport_t *tp)
|
||||
{
|
||||
tport_t *old_tp = orq->orq_tport;
|
||||
|
||||
orq->orq_tport = tport_ref(tp);
|
||||
|
||||
if (old_tp) tport_unref(old_tp);
|
||||
|
||||
if (outgoing_insert_via(orq, agent_tport_via(tp)) < 0) {
|
||||
SU_DEBUG_3(("nta outgoing create: cannot insert Via line\n"));
|
||||
@@ -7198,13 +7234,14 @@ outgoing_prepare_send(nta_outgoing_t *orq)
|
||||
if (orq->orq_delayed) {
|
||||
SU_DEBUG_5(("nta: delayed sending %s (%u)\n",
|
||||
orq->orq_method_name, orq->orq_cseq->cs_seq));
|
||||
outgoing_queue(sa->sa_out.delayed, orq);
|
||||
outgoing_queue(orq->orq_agent->sa_out.delayed, orq);
|
||||
return;
|
||||
}
|
||||
|
||||
outgoing_send(orq, 0);
|
||||
}
|
||||
|
||||
|
||||
/** Send a request */
|
||||
static void
|
||||
outgoing_send(nta_outgoing_t *orq, int retransmit)
|
||||
@@ -7226,6 +7263,11 @@ outgoing_send(nta_outgoing_t *orq, int retransmit)
|
||||
return;
|
||||
}
|
||||
|
||||
if (orq->orq_user_tport && !tport_is_clear_to_send(orq->orq_tport)) {
|
||||
outgoing_tport_error(agent, orq, NULL, orq->orq_request, EPIPE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!retransmit)
|
||||
orq->orq_sent = now;
|
||||
|
||||
|
||||
@@ -170,7 +170,8 @@ SOFIAPUBFUN int nta_msg_request_complete(msg_t *msg,
|
||||
char const *method_name,
|
||||
url_string_t const *req_url);
|
||||
|
||||
SOFIAPUBFUN int nta_is_internal_msg(msg_t const *msg);
|
||||
SOFIAPUBFUN int nta_msg_is_internal(msg_t const *msg);
|
||||
SOFIAPUBFUN int nta_sip_is_internal(sip_t const *sip);
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* 5) Leg-level prototypes
|
||||
@@ -479,6 +480,8 @@ SOFIAPUBFUN void nta_reliable_destroy(nta_reliable_t *);
|
||||
|
||||
SOFIAPUBFUN void nta_msg_discard(nta_agent_t *agent, msg_t *msg);
|
||||
|
||||
SOFIAPUBFUN int nta_is_internal_msg(msg_t const *msg);
|
||||
|
||||
SOFIA_END_DECLS
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user