freeswitch/libs/sofia-sip/libsofia-sip-ua/nta/test_nta_api.c

1400 lines
39 KiB
C
Raw Normal View History

/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@internal
* @CFILE test_nta_api.c
*
* Test functions for NTA.
*
* @author Pekka Pessi <Pekka.Pessi@nokia.com>
*
* @date Created: Tue Aug 21 15:18:26 2001 ppessi
*/
#include "config.h"
typedef struct agent_t agent_t;
#define SU_ROOT_MAGIC_T agent_t
#include <sofia-sip/su_wait.h>
#include <msg_internal.h>
#define NTA_AGENT_MAGIC_T agent_t
#define NTA_LEG_MAGIC_T agent_t
#define NTA_OUTGOING_MAGIC_T agent_t
#define NTA_INCOMING_MAGIC_T agent_t
#define NTA_RELIABLE_MAGIC_T agent_t
#include "sofia-sip/nta.h"
#include "nta_internal.h"
#include <sofia-sip/sip_header.h>
#include <sofia-sip/sip_tag.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/tport.h>
#include <sofia-sip/htable.h>
#include <sofia-sip/sresolv.h>
#include <sofia-sip/su_log.h>
#include <sofia-sip/msg_mclass.h>
#include <sofia-sip/sofia_features.h>
#include <sofia-sip/hostdomain.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include "sofia-sip/string0.h"
extern su_log_t nta_log[];
extern su_log_t tport_log[];
int tstflags = 0;
#define TSTFLAGS tstflags
char const name[] = "test_nta_api";
#include <sofia-sip/tstdef.h>
#if HAVE_FUNC
#elif HAVE_FUNCTION
#define __func__ __FUNCTION__
#else
#define __func__ name
#endif
#define NONE ((void *)-1)
struct sigcomp_compartment;
struct agent_t {
su_home_t ag_home[1];
int ag_flags;
su_root_t *ag_root;
msg_mclass_t *ag_mclass;
nta_agent_t *ag_agent;
nta_leg_t *ag_default_leg; /**< Leg for rest */
nta_leg_t *ag_server_leg; /**< Leg for <sip:%@%>;methods=<PUBLISH>;events=<presence> */
unsigned ag_drop;
nta_outgoing_t *ag_orq;
int ag_status;
msg_t *ag_response;
/* Server side */
nta_incoming_t *ag_irq;
sip_contact_t const *ag_contact;
sip_from_t *ag_alice;
sip_to_t *ag_bob;
sip_contact_t *ag_m_alice;
sip_contact_t *ag_m_bob;
sip_contact_t *ag_aliases;
nta_leg_t *ag_alice_leg;
nta_leg_t *ag_bob_leg;
msg_t *ag_request;
nta_leg_t *ag_expect_leg;
nta_leg_t *ag_latest_leg;
nta_leg_t *ag_call_leg;
nta_leg_t *ag_tag_remote; /**< If this is set, outgoing_callback()
* tags it with the tag from remote.
*/
int ag_tag_status; /**< Which response established dialog */
msg_param_t ag_call_tag; /**< Tag used to establish dialog */
nta_reliable_t *ag_reliable;
sip_via_t *ag_out_via; /**< Outgoing via */
sip_via_t *ag_in_via; /**< Incoming via */
sip_content_type_t *ag_content_type;
sip_payload_t *ag_payload;
msg_t *ag_probe_msg;
};
static int incoming_callback_1(agent_t *ag,
nta_incoming_t *irq,
sip_t const *sip)
{
return 0;
}
static int incoming_callback_2(agent_t *ag,
nta_incoming_t *irq,
sip_t const *sip)
{
return 0;
}
int agent_callback(agent_t *ag,
nta_agent_t *nta,
msg_t *msg,
sip_t *sip)
{
msg_destroy(msg);
return 0;
}
int leg_callback(agent_t *ag,
nta_leg_t *leg,
nta_incoming_t *irq,
sip_t const *sip)
{
BEGIN();
msg_t *msg;
char const *tag;
if (tstflags & tst_verbatim) {
printf("%s: %s: %s " URL_PRINT_FORMAT " %s\n",
name, __func__, sip->sip_request->rq_method_name,
URL_PRINT_ARGS(sip->sip_request->rq_url),
sip->sip_request->rq_version);
}
TEST_1(sip->sip_content_length);
TEST_1(sip->sip_via);
TEST_1(sip->sip_from && sip->sip_from->a_tag);
TEST_VOID(nta_incoming_bind(irq, incoming_callback_1, ag));
TEST_P(nta_incoming_magic(irq, incoming_callback_1), ag);
TEST_P(nta_incoming_magic(irq, incoming_callback_2), 0);
TEST_1(tag = nta_incoming_tag(irq, "tag=foofaa"));
TEST_S(nta_incoming_gettag(irq), tag);
TEST_S(tag, "foofaa");
TEST_1(tag = nta_incoming_tag(irq, "foofaa"));
TEST(nta_incoming_status(irq), 0);
TEST(nta_incoming_method(irq), sip_method_message);
TEST_S(nta_incoming_method_name(irq), "MESSAGE");
TEST_1(nta_incoming_url(irq) != NULL);
TEST_1(nta_incoming_cseq(irq) != 0);
TEST(nta_incoming_set_params(irq, TAG_END()), 0);
TEST_1(msg = nta_incoming_getrequest(irq)); msg_destroy(msg);
TEST_P(nta_incoming_getrequest_ackcancel(irq), NULL);
TEST_P(nta_incoming_getresponse(irq), NULL);
TEST(nta_incoming_treply(irq, SIP_100_TRYING, TAG_END()), 0);
TEST_1(msg = nta_incoming_getresponse(irq)); msg_destroy(msg);
msg = nta_msg_create(ag->ag_agent, 0);
TEST(nta_incoming_complete_response(irq, msg, SIP_200_OK, TAG_END()), 0);
TEST(nta_incoming_mreply(irq, msg), 0);
END();
}
int outgoing_callback(agent_t *ag,
nta_outgoing_t *orq,
sip_t const *sip)
{
BEGIN();
msg_t *msg;
int status = sip->sip_status->st_status;
if (tstflags & tst_verbatim) {
printf("%s: %s: %s %03d %s\n", name, __func__,
sip->sip_status->st_version,
sip->sip_status->st_status,
sip->sip_status->st_phrase);
}
ag->ag_status = status;
if (status < 200)
return 0;
TEST_1(sip->sip_to && sip->sip_to->a_tag);
/* Test API functions */
TEST(nta_outgoing_status(orq), status);
TEST_1(nta_outgoing_request_uri(orq));
TEST_1(!nta_outgoing_route_uri(orq));
TEST(nta_outgoing_method(orq), sip_method_message);
TEST_S(nta_outgoing_method_name(orq), "MESSAGE");
TEST(nta_outgoing_cseq(orq), sip->sip_cseq->cs_seq);
TEST_1(nta_outgoing_delay(orq) < UINT_MAX);
TEST_1(msg = nta_outgoing_getresponse(orq));
msg_destroy(msg);
TEST_1(msg = nta_outgoing_getrequest(orq));
msg_destroy(msg);
nta_outgoing_destroy(orq);
/* Call it twice */
nta_outgoing_destroy(orq);
ag->ag_orq = NULL;
END();
}
void
nta_test_run(agent_t *ag)
{
time_t now = time(NULL);
for (ag->ag_status = 0; ag->ag_status < 200;) {
if (tstflags & tst_verbatim) {
fputs(".", stdout); fflush(stdout);
}
su_root_step(ag->ag_root, 500L);
if (!getenv("NTA_TEST_DEBUG") && time(NULL) > now + 5) {
fprintf(stderr, "nta_test_run: timeout\n");
return;
}
}
}
int api_test_init(agent_t *ag)
{
BEGIN();
char const *contact = NULL;
if (getenv("SIPCONTACT"))
contact = getenv("SIPCONTACT");
if (contact == NULL || contact[0] == '\0')
contact = "sip:0.0.0.0:*;comp=sigcomp";
TEST_1(ag->ag_root = su_root_create(ag));
TEST_1(ag->ag_mclass = msg_mclass_clone(sip_default_mclass(), 0, 0));
/* Create agent */
TEST_1(ag->ag_agent = nta_agent_create(ag->ag_root,
(url_string_t *)contact,
NULL,
NULL,
NTATAG_MCLASS(ag->ag_mclass),
NTATAG_USE_TIMESTAMP(1),
NTATAG_USE_NAPTR(0),
NTATAG_USE_SRV(0),
NTATAG_PRELOAD(2048),
TAG_END()));
/* Create a default leg */
TEST_1(ag->ag_default_leg = nta_leg_tcreate(ag->ag_agent,
leg_callback,
ag,
NTATAG_NO_DIALOG(1),
TAG_END()));
{
/* Initialize our headers */
sip_from_t from[1];
sip_to_t to[1];
sip_contact_t m[1];
sip_from_init(from);
sip_to_init(to);
sip_contact_init(m);
TEST_1(ag->ag_contact = nta_agent_contact(ag->ag_agent));
*m->m_url = *ag->ag_contact->m_url;
m->m_url->url_user = "bob";
TEST_1(ag->ag_m_bob = sip_contact_dup(ag->ag_home, m));
to->a_display = "Bob";
*to->a_url = *ag->ag_contact->m_url;
to->a_url->url_user = "bob";
to->a_url->url_port = NULL;
TEST_1(ag->ag_bob = sip_to_dup(ag->ag_home, to));
url_strip_transport(ag->ag_bob->a_url);
*m->m_url = *ag->ag_contact->m_url;
m->m_url->url_user = "alice";
TEST_1(ag->ag_m_alice = sip_contact_dup(ag->ag_home, m));
from->a_display = "Alice";
*from->a_url = *ag->ag_contact->m_url;
from->a_url->url_user = "alice";
from->a_url->url_port = NULL;
TEST_1(ag->ag_alice = sip_from_dup(ag->ag_home, from));
url_strip_transport(ag->ag_alice->a_url);
}
{
char const data[] =
"v=0\r\n"
"o=- 425432 423412 IN IP4 127.0.0.1\r\n"
"s= \r\n"
"c=IN IP4 127.0.0.1\r\n"
"m=5004 audio 8 0\r\n";
ag->ag_content_type = sip_content_type_make(ag->ag_home, "application/sdp");
ag->ag_payload = sip_payload_make(ag->ag_home, data);
}
{
sip_contact_t *m;
ag->ag_aliases =
sip_contact_make(ag->ag_home, "sip:127.0.0.1, sip:localhost, sip:[::1]");
TEST_1(ag->ag_aliases);
TEST_1(ag->ag_aliases->m_next);
TEST_1(ag->ag_aliases->m_next->m_next);
TEST_P(ag->ag_aliases->m_next->m_next->m_next, NULL);
for (m = ag->ag_aliases; m; m = m->m_next)
m->m_url->url_port = ag->ag_contact->m_url->url_port;
TEST_1(m = sip_contact_dup(ag->ag_home, ag->ag_contact));
m->m_next = ag->ag_aliases;
ag->ag_aliases = m;
TEST(nta_agent_set_params(ag->ag_agent,
NTATAG_ALIASES(ag->ag_aliases),
NTATAG_REL100(1),
NTATAG_UA(1),
NTATAG_USE_NAPTR(1),
NTATAG_USE_SRV(1),
TAG_END()),
5);
TEST(nta_agent_set_params(ag->ag_agent,
NTATAG_ALIASES(ag->ag_aliases),
NTATAG_DEFAULT_PROXY("sip:127.0.0.1"),
TAG_END()), 2);
TEST(nta_agent_set_params(ag->ag_agent,
NTATAG_ALIASES(ag->ag_aliases),
NTATAG_DEFAULT_PROXY(NULL),
TAG_END()), 2);
TEST(nta_agent_set_params(ag->ag_agent,
NTATAG_DEFAULT_PROXY("tel:+35878008000"),
TAG_END()), -1);
}
{
url_t url[1];
/* Create the server leg */
*url = *ag->ag_aliases->m_url;
url->url_user = "%";
TEST_1(ag->ag_server_leg = nta_leg_tcreate(ag->ag_agent,
leg_callback,
ag,
NTATAG_NO_DIALOG(1),
URLTAG_URL(url),
TAG_END()));
}
END();
}
int api_test_deinit(agent_t *ag)
{
BEGIN();
if (ag->ag_request) msg_destroy(ag->ag_request), ag->ag_request = NULL;
if (ag->ag_response) msg_destroy(ag->ag_response), ag->ag_response = NULL;
su_free(ag->ag_home, ag->ag_in_via), ag->ag_in_via = NULL;
nta_leg_destroy(ag->ag_alice_leg);
nta_leg_destroy(ag->ag_bob_leg);
nta_leg_destroy(ag->ag_default_leg);
nta_leg_destroy(ag->ag_server_leg);
nta_agent_destroy(ag->ag_agent);
su_root_destroy(ag->ag_root);
free(ag->ag_mclass), ag->ag_mclass = NULL;
END();
}
/* Get and check parameters */
int api_test_params(agent_t *ag)
{
BEGIN();
nta_agent_t *nta;
sip_contact_t const *aliases = (void *)-1;
msg_mclass_t *mclass = (void *)-1;
Merge up to the most recent sofia-sip darcs tree. Includes the following patches from darcs: Tue Aug 21 09:38:59 EDT 2007 Pekka.Pessi@nokia.com * tport_type_udp.c: checking error while checking that MSG_TRUNC works. Shall I pull this patch? (1/43) [ynWvpxqadjk], or ? for help: y Tue Aug 21 10:49:33 EDT 2007 Pekka.Pessi@nokia.com * nua_params.c: NUTAG_SIPS_URL() now sets the handle target, too. Problem reported by Jari Tenhunen. Shall I pull this patch? (2/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 11:22:42 EDT 2007 Pekka.Pessi@nokia.com * nta.c: do not destroy INVITE transaction if it has been CANCELed Handle gracefully cases where the INVITE transaction is destroyed immediately after canceling it. The old behaviour was to left it up to the application to ACK the final response returned to INVITE. Thanks for Fabio Margarido for reporting this problem. Shall I pull this patch? (3/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 13:02:01 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added test with user SDP containing already rejected media Shall I pull this patch? (4/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com * nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (5/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com UNDO: nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (6/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:00:10 EDT 2007 Pekka.Pessi@nokia.com * nta.c: disabled nta_msg_ackbye(). Fix for sf.net bug #1750691 Thanks for Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (7/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 06:54:38 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1750691 Shall I pull this patch? (8/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:03:45 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for nua_bye() sending CANCEL Shall I pull this patch? (9/43) [ynWvpxqadjk], or ? for help: y Fri Aug 31 12:08:09 EDT 2007 Pekka.Pessi@nokia.com * url.c: fixed escaping of '/' %2F, ';' %3B and '=' %3D in URL path/params Thanks for Fabio Margarido for reporting this bug. Shall I pull this patch? (10/43) [ynWvpxqadjk], or ? for help: y Mon Sep 3 10:14:55 EDT 2007 Pekka.Pessi@nokia.com * url.c: do not un-escape %40 in URI parameters. Do not unescape %2C, %3B, %3D, or %40 in URI parameters, nor %2C, %2F, %3B, %3D, or %40 in URI path. The @ sign can be ambiguous in the SIP URL, e.g., <sip:test.info;p=value@test.com> can be parsed in two ways: 1) username contains test.info;param=value and host part has test.com 2) empty username, host part test.info, URI parameter p=value@test.com Previously Sofia URL parser converted escaped '@' at signs (%40) in the URI parameters to the unescaped form. The resulting URI could be ambiguous and sometimes fail the syntax check if there was no '@' sign before the unescaped one. Thanks for Jan van den Bosch and Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (11/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 04:59:57 EDT 2007 Pekka.Pessi@nokia.com * tport.c: fixed indenting, logging Shall I pull this patch? (12/43) [ynWvpxqadjk], or ? for help: y Fri Jul 13 12:47:33 EDT 2007 Pekka.Pessi@nokia.com * nua/test_proxy.h, nua/test_proxy.c: added support for multiple domains Each domain has its own registrar and authentication module. Shall I pull this patch? (13/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:19:33 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: added timestamp to event logging Shall I pull this patch? (14/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:20:12 EDT 2007 Pekka.Pessi@nokia.com * test_nua: fixed timing problems in testing. Shall I pull this patch? (15/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:04 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: reduce su_root_step() delay to 0.1 seconds Shall I pull this patch? (16/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:22 EDT 2007 Pekka.Pessi@nokia.com * test_register.c: fixed timing problem Shall I pull this patch? (17/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 17:03:46 EDT 2007 Pekka.Pessi@nokia.com * test_100rel.c: fixed timing problems resulting in events being reordered Shall I pull this patch? (18/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:40:53 EDT 2007 Pekka.Pessi@nokia.com * nua (test_init.c, test_register.c): using test_proxy domains Shall I pull this patch? (19/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 12:12:32 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added cleanup code Shall I pull this patch? (20/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:35:35 EDT 2007 Pekka.Pessi@nokia.com * nta.c: increase lifetime of ACK transaction from T4 to T1 x 64 nta.c creates a ACK transaction in order to restransmit ACK requests when ever a retransmitted 2XX response to INVITE is received. The UAS retransmits the 2XX responses for 64 x T1 (32 second by default). Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (21/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 10:21:04 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: generating libsofia-sip-ua/docs/Doxyfile.rfc before making manpages Shall I pull this patch? (22/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:05:33 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING() Shall I pull this patch? (23/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:09:06 EDT 2007 Pekka.Pessi@nokia.com * tport: added ping-pong keepalive on TCP. replaced single tick with connection-specific timer Now detecting closed connections on TLS, too. Added tests for idle timeout, receive timeout, ping-pong timeout. Shall I pull this patch? (24/43) [ynWvpxqadjk], or ? for help: y Fri Jul 6 10:19:32 EDT 2007 Pekka.Pessi@nokia.com * nta.c: added nta_incoming_received() Shall I pull this patch? (25/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:29:56 EDT 2007 Pekka.Pessi@nokia.com * nua_session.c: delay transition to ready when O/A is incomplete Delay sending ACK and subsequent transition of call to the ready state when the 200 OK response to the INVITE is received if the SDP Offer/Answer exchange using UPDATE/PRACK was still incomplete. Previously, if the O/A using UPDATE or PRACK was incomplete and an 200 OK was received, the call setup logic regarded this as a fatal error and terminated the call. Thanks for Mike Jerris for detecting and reporting this bug. Shall I pull this patch? (26/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:22:46 EDT 2007 Pekka.Pessi@nokia.com * test_call_reject.c: testing Retry-After Shall I pull this patch? (27/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:42:51 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using rudimentary outbound support in B's proxy. Shall I pull this patch? (28/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:48:33 EDT 2007 Pekka.Pessi@nokia.com * nua_register.c: added some logging to nua_register_connection_closed() Shall I pull this patch? (29/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:43:57 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C C is now challenged every time. Shall I pull this patch? (30/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 11:05:19 EDT 2007 Pekka.Pessi@nokia.com * nua/test_100rel.c: fixed timing problem re response to PRACK and ACK Shall I pull this patch? (31/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 06:02:50 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * DIST_SUBDIRS must include everything unconditionally Shall I pull this patch? (32/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:53:04 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: silenced warnings Shall I pull this patch? (33/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com * nua: refactored dialog refresh code Shall I pull this patch? (34/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com UNDO: nua: refactored dialog refresh code Shall I pull this patch? (35/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:01:25 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc]: renamed functions setting refresh interval Shall I pull this patch? (36/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:15:03 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc], nua_stack.c: added nua_dialog_repeat_shutdown() Shall I pull this patch? (37/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:19:20 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.h: renamed nua_remote_t as nua_dialog_peer_info_t Shall I pull this patch? (38/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:23:04 EDT 2007 Pekka.Pessi@nokia.com * nua_stack.c: added timer to client request in order to implement Retry-After Shall I pull this patch? (39/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:33:53 EDT 2007 Pekka.Pessi@nokia.com * nua: added backpointers to nua_dialog_usage_t and nua_dialog_state_t Shall I pull this patch? (40/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:56:48 EDT 2007 Pekka.Pessi@nokia.com * test_nua.c: abort() in timeout alarm function if -a is given Shall I pull this patch? (41/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 17:13:18 EDT 2007 Pekka.Pessi@nokia.com * nua_subnotref.c: include SIPTAG_EVENT() in the nua_i_notify tag list Shall I pull this patch? (42/43) [ynWvpxqadjk], or ? for help: y Mon Sep 10 12:27:53 EDT 2007 Pekka.Pessi@nokia.com * nua: save Contact from target refresh request or response. Save the Contact header which the application has added to the target refresh requests or responses and use the saved contact in subsequent target refresh requests or responses. Previously the application had no way of specifying the Contact included in the automatic responses to target refresh requests. Thanks for Anthony Minessale for reporting this problem. Shall I pull this patch? (43/43) [ynWvpxqadjk], or ? for help: y git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5692 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-09-10 20:45:25 +00:00
sip_contact_t const *contact = (void *)-1;
url_string_t const *default_proxy = (void *)-1;
void *smime = (void *)-1;
unsigned blacklist = -1;
unsigned debug_drop_prob = -1;
unsigned max_forwards = -1;
unsigned maxsize = -1;
unsigned preload = -1;
unsigned progress = -1;
unsigned sip_t1 = -1;
unsigned sip_t2 = -1;
unsigned sip_t4 = -1;
unsigned timer_c = -1;
unsigned udp_mtu = -1;
int cancel_2543 = -1;
int cancel_487 = -1;
int client_rport = -1;
int extra_100 = -1;
int merge_482 = -1;
int pass_100 = -1;
int pass_408 = -1;
int rel100 = -1;
int server_rport = -1;
int stateless = -1;
int tag_3261 = -1;
int timeout_408 = -1;
int ua = -1;
int use_naptr = -1;
int use_srv = -1;
int use_timestamp = -1;
int user_via = -1;
char const *s = NONE;
TEST_1(nta = nta_agent_create(ag->ag_root, (url_string_t *)"sip:*:*",
NULL, NULL, TAG_END()));
TEST(nta_agent_get_params(nta,
NTATAG_ALIASES_REF(aliases),
NTATAG_BLACKLIST_REF(blacklist),
NTATAG_CANCEL_2543_REF(cancel_2543),
NTATAG_CANCEL_487_REF(cancel_487),
NTATAG_CLIENT_RPORT_REF(client_rport),
NTATAG_CONTACT_REF(contact),
NTATAG_DEBUG_DROP_PROB_REF(debug_drop_prob),
NTATAG_DEFAULT_PROXY_REF(default_proxy),
NTATAG_EXTRA_100_REF(extra_100),
NTATAG_MAXSIZE_REF(maxsize),
NTATAG_MAX_FORWARDS_REF(max_forwards),
NTATAG_MCLASS_REF(mclass),
NTATAG_MERGE_482_REF(merge_482),
NTATAG_PASS_100_REF(pass_100),
NTATAG_PASS_408_REF(pass_408),
NTATAG_PRELOAD_REF(preload),
NTATAG_PROGRESS_REF(progress),
NTATAG_REL100_REF(rel100),
NTATAG_SERVER_RPORT_REF(server_rport),
NTATAG_SIP_T1_REF(sip_t1),
NTATAG_SIP_T2_REF(sip_t2),
NTATAG_SIP_T4_REF(sip_t4),
NTATAG_SMIME_REF(smime),
NTATAG_STATELESS_REF(stateless),
NTATAG_TAG_3261_REF(tag_3261),
NTATAG_TIMEOUT_408_REF(timeout_408),
NTATAG_TIMER_C_REF(timer_c),
NTATAG_UA_REF(ua),
NTATAG_UDP_MTU_REF(udp_mtu),
NTATAG_USER_VIA_REF(user_via),
NTATAG_USE_NAPTR_REF(use_naptr),
NTATAG_USE_SRV_REF(use_srv),
NTATAG_USE_TIMESTAMP_REF(use_timestamp),
TAG_END()),
/* Number of parameters */ 33);
TEST_P(mclass, sip_default_mclass());
TEST_P(aliases, NULL);
TEST_1(contact != (void *)-1 && contact != NULL);
TEST_1(default_proxy == NULL);
TEST_1(smime == NULL);
TEST_1(blacklist != -1);
TEST(debug_drop_prob, 0);
TEST_1(max_forwards >= 20);
TEST_1(maxsize >= 65536);
TEST_1(preload != -1);
TEST_1(progress <= 60 * 1000);
TEST(sip_t1, NTA_SIP_T1);
TEST(sip_t2, NTA_SIP_T2);
TEST(sip_t4, NTA_SIP_T4);
TEST_1(timer_c > 180 * 1000);
TEST(udp_mtu, 1300);
TEST_1(cancel_2543 != -1);
TEST_1(cancel_487 != -1);
TEST_1(client_rport != -1);
TEST_1(extra_100 != -1);
TEST_1(merge_482 != -1);
TEST_1(pass_100 != -1);
TEST_1(pass_408 != -1);
TEST_1(rel100 != -1);
TEST_1(server_rport != -1);
TEST_1(stateless == 0);
TEST_1(timeout_408 != -1);
TEST_1(ua == 0);
TEST_1(use_naptr != -1);
TEST_1(use_srv != -1);
TEST_1(use_timestamp != -1);
TEST_1(user_via == 0);
TEST(nta_agent_set_params(NULL,
NTATAG_PRELOAD(2048),
TAG_END()), -1);
TEST(nta_agent_get_params(NULL,
NTATAG_PRELOAD_REF(preload),
TAG_END()), -1);
TEST(nta_agent_set_params(nta,
NTATAG_PRELOAD(2048),
TAG_END()), 1);
TEST(nta_agent_get_params(nta,
NTATAG_PRELOAD_REF(preload),
TAG_END()), 1);
TEST(preload, 2048);
TEST(nta_agent_set_params(nta,
NTATAG_SIGCOMP_OPTIONS("sip"),
TAG_END()), 1);
TEST(nta_agent_set_params(nta,
NTATAG_SIGCOMP_OPTIONS(","),
TAG_END()), -1);
TEST(nta_agent_set_params(nta,
NTATAG_SIGCOMP_OPTIONS("sip;dms=16384"),
TAG_END()), 1);
s = NONE;
TEST(nta_agent_get_params(nta,
NTATAG_SIGCOMP_OPTIONS_REF(s),
TAG_END()), 1);
TEST_S(s, "sip;dms=16384");
TEST_VOID(nta_agent_destroy(nta));
END();
}
int api_test_stats(agent_t *ag)
{
BEGIN();
nta_agent_t *nta;
usize_t irq_hash = -1, orq_hash = -1, leg_hash = -1;
usize_t recv_msg = -1, sent_msg = -1;
usize_t recv_request = -1, recv_response = -1;
usize_t bad_message = -1, bad_request = -1, bad_response = -1;
usize_t drop_request = -1, drop_response = -1;
usize_t client_tr = -1, server_tr = -1, dialog_tr = -1;
usize_t acked_tr = -1, canceled_tr = -1;
usize_t trless_request = -1, trless_to_tr = -1, trless_response = -1;
usize_t trless_200 = -1, merged_request = -1;
usize_t sent_request = -1, sent_response = -1;
usize_t retry_request = -1, retry_response = -1, recv_retry = -1;
usize_t tout_request = -1, tout_response = -1;
TEST_1(nta = nta_agent_create(ag->ag_root, (url_string_t *)"sip:*:*",
NULL, NULL, TAG_END()));
TEST(nta_agent_get_stats(NULL,
NTATAG_S_TOUT_REQUEST_REF(tout_request),
NTATAG_S_TOUT_RESPONSE_REF(tout_response),
TAG_END()), -1);
TEST(nta_agent_get_stats(nta,
NTATAG_S_IRQ_HASH_REF(irq_hash),
NTATAG_S_ORQ_HASH_REF(orq_hash),
NTATAG_S_LEG_HASH_REF(leg_hash),
NTATAG_S_RECV_MSG_REF(recv_msg),
NTATAG_S_SENT_MSG_REF(sent_msg),
NTATAG_S_RECV_REQUEST_REF(recv_request),
NTATAG_S_RECV_RESPONSE_REF(recv_response),
NTATAG_S_BAD_MESSAGE_REF(bad_message),
NTATAG_S_BAD_REQUEST_REF(bad_request),
NTATAG_S_BAD_RESPONSE_REF(bad_response),
NTATAG_S_DROP_REQUEST_REF(drop_request),
NTATAG_S_DROP_RESPONSE_REF(drop_response),
NTATAG_S_CLIENT_TR_REF(client_tr),
NTATAG_S_SERVER_TR_REF(server_tr),
NTATAG_S_DIALOG_TR_REF(dialog_tr),
NTATAG_S_ACKED_TR_REF(acked_tr),
NTATAG_S_CANCELED_TR_REF(canceled_tr),
NTATAG_S_TRLESS_REQUEST_REF(trless_request),
NTATAG_S_TRLESS_TO_TR_REF(trless_to_tr),
NTATAG_S_TRLESS_RESPONSE_REF(trless_response),
NTATAG_S_TRLESS_200_REF(trless_200),
NTATAG_S_MERGED_REQUEST_REF(merged_request),
NTATAG_S_SENT_REQUEST_REF(sent_request),
NTATAG_S_SENT_RESPONSE_REF(sent_response),
NTATAG_S_RETRY_REQUEST_REF(retry_request),
NTATAG_S_RETRY_RESPONSE_REF(retry_response),
NTATAG_S_RECV_RETRY_REF(recv_retry),
NTATAG_S_TOUT_REQUEST_REF(tout_request),
NTATAG_S_TOUT_RESPONSE_REF(tout_response),
TAG_END()), 29);
TEST_1(irq_hash == HTABLE_MIN_SIZE);
TEST_1(orq_hash == HTABLE_MIN_SIZE);
TEST_1(leg_hash == HTABLE_MIN_SIZE);
TEST_1(recv_msg == 0);
TEST_1(sent_msg == 0);
TEST_1(recv_request == 0);
TEST_1(recv_response == 0);
TEST_1(bad_message == 0);
TEST_1(bad_request == 0);
TEST_1(bad_response == 0);
TEST_1(drop_request == 0);
TEST_1(drop_response == 0);
TEST_1(client_tr == 0);
TEST_1(server_tr == 0);
TEST_1(dialog_tr == 0);
TEST_1(acked_tr == 0);
TEST_1(canceled_tr == 0);
TEST_1(trless_request == 0);
TEST_1(trless_to_tr == 0);
TEST_1(trless_response == 0);
TEST_1(trless_200 == 0);
TEST_1(merged_request == 0);
TEST_1(sent_request == 0);
TEST_1(sent_response == 0);
TEST_1(retry_request == 0);
TEST_1(retry_response == 0);
TEST_1(recv_retry == 0);
TEST_1(tout_request == 0);
TEST_1(tout_response == 0);
TEST_VOID(nta_agent_destroy(nta));
END();
}
/* Test handling transports */
int api_test_tport(agent_t *ag)
{
sip_via_t const *v;
url_t url[1];
BEGIN();
nta_agent_t *agent;
sip_contact_t const *m;
*url = *ag->ag_contact->m_url;
url->url_port = "*";
url->url_params = "transport=tcp";
TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
TEST_1(!nta_agent_via(agent));
TEST_1(!nta_agent_public_via(agent));
TEST_1(!nta_agent_contact(agent));
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
TEST_1(v = nta_agent_via(agent)); TEST_1(!v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
TEST_1(m = nta_agent_contact(agent));
TEST_S(m->m_url->url_params, "transport=tcp");
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url,
TPTAG_SERVER(0), TAG_END()) == 0);
TEST_1(v = nta_agent_public_via(agent)); TEST_1(!v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
TEST_1(host_has_domain_invalid(v->v_host));
TEST_1(m = nta_agent_contact(agent));
TEST_S(m->m_url->url_params, "transport=tcp");
url->url_params = "transport=udp";
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
TEST_1(v = nta_agent_via(agent)); TEST_1(v = v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
TEST_VOID(nta_agent_destroy(agent));
TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
TEST_1(v = nta_agent_via(agent)); TEST_1(!v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
TEST_1(m = nta_agent_contact(agent));
TEST_S(m->m_url->url_params, "transport=udp");
TEST_VOID(nta_agent_destroy(agent));
url->url_params = "transport=tcp,udp";
TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
TEST_1(v = nta_agent_via(agent));
TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
TEST_1(v = v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
TEST_1(m = nta_agent_contact(agent));
TEST_1(!m->m_url->url_params);
TEST_VOID(nta_agent_destroy(agent));
url->url_params = NULL;
TEST_1(agent = nta_agent_create(ag->ag_root, NONE, NULL, NULL, TAG_END()));
TEST_1(nta_agent_add_tport(agent, (url_string_t *)url, TAG_END()) == 0);
TEST_1(v = nta_agent_via(agent));
TEST(strcasecmp(v->v_protocol, sip_transport_udp), 0);
TEST_1(v = v->v_next);
TEST(strcasecmp(v->v_protocol, sip_transport_tcp), 0);
TEST_1(m = nta_agent_contact(agent));
TEST_1(!m->m_url->url_params);
TEST_VOID(nta_agent_destroy(agent));
END();
}
static int api_test_dialogs(agent_t *ag)
{
BEGIN();
#if 0
{
/* Test 0.1
* Send a message from default leg to default leg
*/
char const p_acid[] = "P-Access-Network-Info: IEEE-802.11g\n";
msg_t *msg;
ag->ag_expect_leg = ag->ag_default_leg;
TEST_1(ag->ag_orq =
nta_outgoing_tcreate(ag->ag_default_leg,
outgoing_callback, ag,
ag->ag_obp,
SIP_METHOD_MESSAGE,
(url_string_t *)ag->ag_contact->m_url,
SIPTAG_SUBJECT_STR("Test 0.1"),
SIPTAG_FROM(ag->ag_alice),
SIPTAG_TO(ag->ag_bob),
SIPTAG_CONTACT(ag->ag_m_alice),
SIPTAG_HEADER_STR(p_acid),
TAG_END()));
TEST(nta_outgoing_getresponse(ag->ag_orq), NULL);
TEST_1(msg = nta_outgoing_getrequest(ag->ag_orq));
TEST(nta_outgoing_method(ag->ag_orq), sip_method_message);
TEST_S(nta_outgoing_method_name(ag->ag_orq), "MESSAGE");
msg_destroy(msg);
TEST(nta_outgoing_delay(ag->ag_orq), UINT_MAX);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
TEST(ag->ag_latest_leg, ag->ag_default_leg);
TEST_1(ag->ag_request);
nta_leg_bind(ag->ag_default_leg, leg_callback_200, ag);
}
#endif
END();
}
int outgoing_default(agent_t *ag,
nta_outgoing_t *orq,
sip_t const *sip)
{
BEGIN();
msg_t *msg;
int status = sip->sip_status->st_status;
ag->ag_status = status;
if (status < 200)
return 0;
/* Test API functions */
TEST(nta_outgoing_status(orq), status);
TEST_1(!nta_outgoing_request_uri(orq));
TEST_1(!nta_outgoing_route_uri(orq));
TEST(nta_outgoing_method(orq), sip_method_invalid);
TEST_S(nta_outgoing_method_name(orq), "*");
TEST(nta_outgoing_cseq(orq), 0);
TEST_1(nta_outgoing_delay(orq) == UINT_MAX);
TEST_1(msg = nta_outgoing_getresponse(orq));
if (ag->ag_response == NULL)
ag->ag_response = msg;
else
msg_destroy(msg);
TEST_1(!nta_outgoing_getrequest(orq));
END();
}
/* Test default incoming and outgoing */
static int api_test_default(agent_t *ag)
{
BEGIN();
nta_agent_t *nta;
nta_incoming_t *irq;
nta_outgoing_t *orq;
sip_via_t via[1];
Merge up to the most recent sofia-sip darcs tree. Includes the following patches from darcs: Tue Aug 21 09:38:59 EDT 2007 Pekka.Pessi@nokia.com * tport_type_udp.c: checking error while checking that MSG_TRUNC works. Shall I pull this patch? (1/43) [ynWvpxqadjk], or ? for help: y Tue Aug 21 10:49:33 EDT 2007 Pekka.Pessi@nokia.com * nua_params.c: NUTAG_SIPS_URL() now sets the handle target, too. Problem reported by Jari Tenhunen. Shall I pull this patch? (2/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 11:22:42 EDT 2007 Pekka.Pessi@nokia.com * nta.c: do not destroy INVITE transaction if it has been CANCELed Handle gracefully cases where the INVITE transaction is destroyed immediately after canceling it. The old behaviour was to left it up to the application to ACK the final response returned to INVITE. Thanks for Fabio Margarido for reporting this problem. Shall I pull this patch? (3/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 13:02:01 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added test with user SDP containing already rejected media Shall I pull this patch? (4/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com * nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (5/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com UNDO: nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (6/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:00:10 EDT 2007 Pekka.Pessi@nokia.com * nta.c: disabled nta_msg_ackbye(). Fix for sf.net bug #1750691 Thanks for Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (7/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 06:54:38 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1750691 Shall I pull this patch? (8/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:03:45 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for nua_bye() sending CANCEL Shall I pull this patch? (9/43) [ynWvpxqadjk], or ? for help: y Fri Aug 31 12:08:09 EDT 2007 Pekka.Pessi@nokia.com * url.c: fixed escaping of '/' %2F, ';' %3B and '=' %3D in URL path/params Thanks for Fabio Margarido for reporting this bug. Shall I pull this patch? (10/43) [ynWvpxqadjk], or ? for help: y Mon Sep 3 10:14:55 EDT 2007 Pekka.Pessi@nokia.com * url.c: do not un-escape %40 in URI parameters. Do not unescape %2C, %3B, %3D, or %40 in URI parameters, nor %2C, %2F, %3B, %3D, or %40 in URI path. The @ sign can be ambiguous in the SIP URL, e.g., <sip:test.info;p=value@test.com> can be parsed in two ways: 1) username contains test.info;param=value and host part has test.com 2) empty username, host part test.info, URI parameter p=value@test.com Previously Sofia URL parser converted escaped '@' at signs (%40) in the URI parameters to the unescaped form. The resulting URI could be ambiguous and sometimes fail the syntax check if there was no '@' sign before the unescaped one. Thanks for Jan van den Bosch and Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (11/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 04:59:57 EDT 2007 Pekka.Pessi@nokia.com * tport.c: fixed indenting, logging Shall I pull this patch? (12/43) [ynWvpxqadjk], or ? for help: y Fri Jul 13 12:47:33 EDT 2007 Pekka.Pessi@nokia.com * nua/test_proxy.h, nua/test_proxy.c: added support for multiple domains Each domain has its own registrar and authentication module. Shall I pull this patch? (13/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:19:33 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: added timestamp to event logging Shall I pull this patch? (14/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:20:12 EDT 2007 Pekka.Pessi@nokia.com * test_nua: fixed timing problems in testing. Shall I pull this patch? (15/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:04 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: reduce su_root_step() delay to 0.1 seconds Shall I pull this patch? (16/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:22 EDT 2007 Pekka.Pessi@nokia.com * test_register.c: fixed timing problem Shall I pull this patch? (17/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 17:03:46 EDT 2007 Pekka.Pessi@nokia.com * test_100rel.c: fixed timing problems resulting in events being reordered Shall I pull this patch? (18/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:40:53 EDT 2007 Pekka.Pessi@nokia.com * nua (test_init.c, test_register.c): using test_proxy domains Shall I pull this patch? (19/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 12:12:32 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added cleanup code Shall I pull this patch? (20/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:35:35 EDT 2007 Pekka.Pessi@nokia.com * nta.c: increase lifetime of ACK transaction from T4 to T1 x 64 nta.c creates a ACK transaction in order to restransmit ACK requests when ever a retransmitted 2XX response to INVITE is received. The UAS retransmits the 2XX responses for 64 x T1 (32 second by default). Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (21/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 10:21:04 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: generating libsofia-sip-ua/docs/Doxyfile.rfc before making manpages Shall I pull this patch? (22/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:05:33 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING() Shall I pull this patch? (23/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:09:06 EDT 2007 Pekka.Pessi@nokia.com * tport: added ping-pong keepalive on TCP. replaced single tick with connection-specific timer Now detecting closed connections on TLS, too. Added tests for idle timeout, receive timeout, ping-pong timeout. Shall I pull this patch? (24/43) [ynWvpxqadjk], or ? for help: y Fri Jul 6 10:19:32 EDT 2007 Pekka.Pessi@nokia.com * nta.c: added nta_incoming_received() Shall I pull this patch? (25/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:29:56 EDT 2007 Pekka.Pessi@nokia.com * nua_session.c: delay transition to ready when O/A is incomplete Delay sending ACK and subsequent transition of call to the ready state when the 200 OK response to the INVITE is received if the SDP Offer/Answer exchange using UPDATE/PRACK was still incomplete. Previously, if the O/A using UPDATE or PRACK was incomplete and an 200 OK was received, the call setup logic regarded this as a fatal error and terminated the call. Thanks for Mike Jerris for detecting and reporting this bug. Shall I pull this patch? (26/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:22:46 EDT 2007 Pekka.Pessi@nokia.com * test_call_reject.c: testing Retry-After Shall I pull this patch? (27/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:42:51 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using rudimentary outbound support in B's proxy. Shall I pull this patch? (28/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:48:33 EDT 2007 Pekka.Pessi@nokia.com * nua_register.c: added some logging to nua_register_connection_closed() Shall I pull this patch? (29/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:43:57 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C C is now challenged every time. Shall I pull this patch? (30/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 11:05:19 EDT 2007 Pekka.Pessi@nokia.com * nua/test_100rel.c: fixed timing problem re response to PRACK and ACK Shall I pull this patch? (31/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 06:02:50 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * DIST_SUBDIRS must include everything unconditionally Shall I pull this patch? (32/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:53:04 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: silenced warnings Shall I pull this patch? (33/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com * nua: refactored dialog refresh code Shall I pull this patch? (34/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com UNDO: nua: refactored dialog refresh code Shall I pull this patch? (35/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:01:25 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc]: renamed functions setting refresh interval Shall I pull this patch? (36/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:15:03 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc], nua_stack.c: added nua_dialog_repeat_shutdown() Shall I pull this patch? (37/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:19:20 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.h: renamed nua_remote_t as nua_dialog_peer_info_t Shall I pull this patch? (38/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:23:04 EDT 2007 Pekka.Pessi@nokia.com * nua_stack.c: added timer to client request in order to implement Retry-After Shall I pull this patch? (39/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:33:53 EDT 2007 Pekka.Pessi@nokia.com * nua: added backpointers to nua_dialog_usage_t and nua_dialog_state_t Shall I pull this patch? (40/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:56:48 EDT 2007 Pekka.Pessi@nokia.com * test_nua.c: abort() in timeout alarm function if -a is given Shall I pull this patch? (41/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 17:13:18 EDT 2007 Pekka.Pessi@nokia.com * nua_subnotref.c: include SIPTAG_EVENT() in the nua_i_notify tag list Shall I pull this patch? (42/43) [ynWvpxqadjk], or ? for help: y Mon Sep 10 12:27:53 EDT 2007 Pekka.Pessi@nokia.com * nua: save Contact from target refresh request or response. Save the Contact header which the application has added to the target refresh requests or responses and use the saved contact in subsequent target refresh requests or responses. Previously the application had no way of specifying the Contact included in the automatic responses to target refresh requests. Thanks for Anthony Minessale for reporting this problem. Shall I pull this patch? (43/43) [ynWvpxqadjk], or ? for help: y git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5692 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-09-10 20:45:25 +00:00
su_nanotime_t nano;
TEST_1(nta = ag->ag_agent);
TEST_1(irq = nta_incoming_default(nta));
TEST_VOID(nta_incoming_bind(irq, incoming_callback_1, ag));
TEST_P(nta_incoming_magic(irq, incoming_callback_1), ag);
TEST_P(nta_incoming_magic(irq, incoming_callback_2), 0);
TEST_P(nta_incoming_tag(irq, NULL), NULL);
TEST_P(nta_incoming_gettag(irq), NULL);
TEST(nta_incoming_status(irq), 0);
TEST(nta_incoming_method(irq), sip_method_invalid);
TEST_S(nta_incoming_method_name(irq), "*");
TEST_P(nta_incoming_url(irq), NULL);
TEST(nta_incoming_cseq(irq), 0);
Merge up to the most recent sofia-sip darcs tree. Includes the following patches from darcs: Tue Aug 21 09:38:59 EDT 2007 Pekka.Pessi@nokia.com * tport_type_udp.c: checking error while checking that MSG_TRUNC works. Shall I pull this patch? (1/43) [ynWvpxqadjk], or ? for help: y Tue Aug 21 10:49:33 EDT 2007 Pekka.Pessi@nokia.com * nua_params.c: NUTAG_SIPS_URL() now sets the handle target, too. Problem reported by Jari Tenhunen. Shall I pull this patch? (2/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 11:22:42 EDT 2007 Pekka.Pessi@nokia.com * nta.c: do not destroy INVITE transaction if it has been CANCELed Handle gracefully cases where the INVITE transaction is destroyed immediately after canceling it. The old behaviour was to left it up to the application to ACK the final response returned to INVITE. Thanks for Fabio Margarido for reporting this problem. Shall I pull this patch? (3/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 13:02:01 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added test with user SDP containing already rejected media Shall I pull this patch? (4/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com * nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (5/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com UNDO: nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (6/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:00:10 EDT 2007 Pekka.Pessi@nokia.com * nta.c: disabled nta_msg_ackbye(). Fix for sf.net bug #1750691 Thanks for Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (7/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 06:54:38 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1750691 Shall I pull this patch? (8/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:03:45 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for nua_bye() sending CANCEL Shall I pull this patch? (9/43) [ynWvpxqadjk], or ? for help: y Fri Aug 31 12:08:09 EDT 2007 Pekka.Pessi@nokia.com * url.c: fixed escaping of '/' %2F, ';' %3B and '=' %3D in URL path/params Thanks for Fabio Margarido for reporting this bug. Shall I pull this patch? (10/43) [ynWvpxqadjk], or ? for help: y Mon Sep 3 10:14:55 EDT 2007 Pekka.Pessi@nokia.com * url.c: do not un-escape %40 in URI parameters. Do not unescape %2C, %3B, %3D, or %40 in URI parameters, nor %2C, %2F, %3B, %3D, or %40 in URI path. The @ sign can be ambiguous in the SIP URL, e.g., <sip:test.info;p=value@test.com> can be parsed in two ways: 1) username contains test.info;param=value and host part has test.com 2) empty username, host part test.info, URI parameter p=value@test.com Previously Sofia URL parser converted escaped '@' at signs (%40) in the URI parameters to the unescaped form. The resulting URI could be ambiguous and sometimes fail the syntax check if there was no '@' sign before the unescaped one. Thanks for Jan van den Bosch and Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (11/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 04:59:57 EDT 2007 Pekka.Pessi@nokia.com * tport.c: fixed indenting, logging Shall I pull this patch? (12/43) [ynWvpxqadjk], or ? for help: y Fri Jul 13 12:47:33 EDT 2007 Pekka.Pessi@nokia.com * nua/test_proxy.h, nua/test_proxy.c: added support for multiple domains Each domain has its own registrar and authentication module. Shall I pull this patch? (13/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:19:33 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: added timestamp to event logging Shall I pull this patch? (14/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:20:12 EDT 2007 Pekka.Pessi@nokia.com * test_nua: fixed timing problems in testing. Shall I pull this patch? (15/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:04 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: reduce su_root_step() delay to 0.1 seconds Shall I pull this patch? (16/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:22 EDT 2007 Pekka.Pessi@nokia.com * test_register.c: fixed timing problem Shall I pull this patch? (17/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 17:03:46 EDT 2007 Pekka.Pessi@nokia.com * test_100rel.c: fixed timing problems resulting in events being reordered Shall I pull this patch? (18/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:40:53 EDT 2007 Pekka.Pessi@nokia.com * nua (test_init.c, test_register.c): using test_proxy domains Shall I pull this patch? (19/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 12:12:32 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added cleanup code Shall I pull this patch? (20/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:35:35 EDT 2007 Pekka.Pessi@nokia.com * nta.c: increase lifetime of ACK transaction from T4 to T1 x 64 nta.c creates a ACK transaction in order to restransmit ACK requests when ever a retransmitted 2XX response to INVITE is received. The UAS retransmits the 2XX responses for 64 x T1 (32 second by default). Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (21/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 10:21:04 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: generating libsofia-sip-ua/docs/Doxyfile.rfc before making manpages Shall I pull this patch? (22/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:05:33 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING() Shall I pull this patch? (23/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:09:06 EDT 2007 Pekka.Pessi@nokia.com * tport: added ping-pong keepalive on TCP. replaced single tick with connection-specific timer Now detecting closed connections on TLS, too. Added tests for idle timeout, receive timeout, ping-pong timeout. Shall I pull this patch? (24/43) [ynWvpxqadjk], or ? for help: y Fri Jul 6 10:19:32 EDT 2007 Pekka.Pessi@nokia.com * nta.c: added nta_incoming_received() Shall I pull this patch? (25/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:29:56 EDT 2007 Pekka.Pessi@nokia.com * nua_session.c: delay transition to ready when O/A is incomplete Delay sending ACK and subsequent transition of call to the ready state when the 200 OK response to the INVITE is received if the SDP Offer/Answer exchange using UPDATE/PRACK was still incomplete. Previously, if the O/A using UPDATE or PRACK was incomplete and an 200 OK was received, the call setup logic regarded this as a fatal error and terminated the call. Thanks for Mike Jerris for detecting and reporting this bug. Shall I pull this patch? (26/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:22:46 EDT 2007 Pekka.Pessi@nokia.com * test_call_reject.c: testing Retry-After Shall I pull this patch? (27/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:42:51 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using rudimentary outbound support in B's proxy. Shall I pull this patch? (28/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:48:33 EDT 2007 Pekka.Pessi@nokia.com * nua_register.c: added some logging to nua_register_connection_closed() Shall I pull this patch? (29/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:43:57 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C C is now challenged every time. Shall I pull this patch? (30/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 11:05:19 EDT 2007 Pekka.Pessi@nokia.com * nua/test_100rel.c: fixed timing problem re response to PRACK and ACK Shall I pull this patch? (31/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 06:02:50 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * DIST_SUBDIRS must include everything unconditionally Shall I pull this patch? (32/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:53:04 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: silenced warnings Shall I pull this patch? (33/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com * nua: refactored dialog refresh code Shall I pull this patch? (34/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com UNDO: nua: refactored dialog refresh code Shall I pull this patch? (35/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:01:25 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc]: renamed functions setting refresh interval Shall I pull this patch? (36/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:15:03 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc], nua_stack.c: added nua_dialog_repeat_shutdown() Shall I pull this patch? (37/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:19:20 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.h: renamed nua_remote_t as nua_dialog_peer_info_t Shall I pull this patch? (38/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:23:04 EDT 2007 Pekka.Pessi@nokia.com * nua_stack.c: added timer to client request in order to implement Retry-After Shall I pull this patch? (39/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:33:53 EDT 2007 Pekka.Pessi@nokia.com * nua: added backpointers to nua_dialog_usage_t and nua_dialog_state_t Shall I pull this patch? (40/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:56:48 EDT 2007 Pekka.Pessi@nokia.com * test_nua.c: abort() in timeout alarm function if -a is given Shall I pull this patch? (41/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 17:13:18 EDT 2007 Pekka.Pessi@nokia.com * nua_subnotref.c: include SIPTAG_EVENT() in the nua_i_notify tag list Shall I pull this patch? (42/43) [ynWvpxqadjk], or ? for help: y Mon Sep 10 12:27:53 EDT 2007 Pekka.Pessi@nokia.com * nua: save Contact from target refresh request or response. Save the Contact header which the application has added to the target refresh requests or responses and use the saved contact in subsequent target refresh requests or responses. Previously the application had no way of specifying the Contact included in the automatic responses to target refresh requests. Thanks for Anthony Minessale for reporting this problem. Shall I pull this patch? (43/43) [ynWvpxqadjk], or ? for help: y git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5692 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-09-10 20:45:25 +00:00
TEST(nta_incoming_received(irq, &nano), nano / 1000000000);
TEST(nta_incoming_set_params(irq, TAG_END()), 0);
TEST_P(nta_incoming_getrequest(irq), NULL);
TEST_P(nta_incoming_getrequest_ackcancel(irq), NULL);
TEST_P(nta_incoming_getresponse(irq), NULL);
TEST(nta_incoming_complete_response(irq, NULL, SIP_200_OK, TAG_END()), -1);
TEST(nta_incoming_treply(irq, SIP_200_OK, TAG_END()), -1);
TEST(nta_incoming_mreply(irq, NULL), -1);
TEST_VOID(nta_incoming_destroy(irq));
TEST_1(orq = nta_outgoing_default(nta, outgoing_default, ag));
TEST(nta_outgoing_status(orq), 0);
TEST(nta_outgoing_method(orq), sip_method_invalid);
TEST_S(nta_outgoing_method_name(orq), "*");
TEST(nta_outgoing_cseq(orq), 0);
TEST(nta_outgoing_delay(orq), UINT_MAX);
TEST_P(nta_outgoing_request_uri(orq), NULL);
TEST_P(nta_outgoing_route_uri(orq), NULL);
TEST_P(nta_outgoing_getresponse(orq), NULL);
TEST_P(nta_outgoing_getrequest(orq), NULL);
TEST_P(nta_outgoing_tagged(orq, NULL, NULL, NULL, NULL), NULL);
TEST(nta_outgoing_cancel(orq), -1);
TEST_P(nta_outgoing_tcancel(orq, NULL, NULL, TAG_END()), NULL);
TEST_VOID(nta_outgoing_destroy(orq));
TEST_1(irq = nta_incoming_default(nta));
TEST_1(orq = nta_outgoing_default(nta, outgoing_default, ag));
via[0] = nta_agent_via(nta)[0];
via->v_next = NULL;
TEST_1(nta_incoming_treply
(irq,
SIP_200_OK,
SIPTAG_VIA(via),
SIPTAG_CALL_ID_STR("oishciucnkrcoihciunskcisj"),
SIPTAG_CSEQ_STR("1 MESSAGE"),
SIPTAG_FROM_STR("Arska <sip:arska@example.com>;tag=aiojcidscd0i"),
SIPTAG_TO_STR("Jaska <sip:jaska@example.net>;tag=iajf8wru"),
TAG_END()) == 0);
for (ag->ag_status = 0; ag->ag_status < 200; ) {
su_root_step(ag->ag_root, 200);
}
TEST(nta_outgoing_status(orq), 0);
TEST_VOID(nta_outgoing_destroy(orq));
TEST_VOID(nta_incoming_destroy(irq));
END();
}
/** Test API for errors */
static int api_test_errors(agent_t *ag)
{
nta_agent_t *nta;
su_root_t *root;
su_home_t home[1];
Merge up to the most recent sofia-sip darcs tree. Includes the following patches from darcs: Tue Aug 21 09:38:59 EDT 2007 Pekka.Pessi@nokia.com * tport_type_udp.c: checking error while checking that MSG_TRUNC works. Shall I pull this patch? (1/43) [ynWvpxqadjk], or ? for help: y Tue Aug 21 10:49:33 EDT 2007 Pekka.Pessi@nokia.com * nua_params.c: NUTAG_SIPS_URL() now sets the handle target, too. Problem reported by Jari Tenhunen. Shall I pull this patch? (2/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 11:22:42 EDT 2007 Pekka.Pessi@nokia.com * nta.c: do not destroy INVITE transaction if it has been CANCELed Handle gracefully cases where the INVITE transaction is destroyed immediately after canceling it. The old behaviour was to left it up to the application to ACK the final response returned to INVITE. Thanks for Fabio Margarido for reporting this problem. Shall I pull this patch? (3/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 13:02:01 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added test with user SDP containing already rejected media Shall I pull this patch? (4/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com * nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (5/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com UNDO: nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (6/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:00:10 EDT 2007 Pekka.Pessi@nokia.com * nta.c: disabled nta_msg_ackbye(). Fix for sf.net bug #1750691 Thanks for Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (7/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 06:54:38 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1750691 Shall I pull this patch? (8/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:03:45 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for nua_bye() sending CANCEL Shall I pull this patch? (9/43) [ynWvpxqadjk], or ? for help: y Fri Aug 31 12:08:09 EDT 2007 Pekka.Pessi@nokia.com * url.c: fixed escaping of '/' %2F, ';' %3B and '=' %3D in URL path/params Thanks for Fabio Margarido for reporting this bug. Shall I pull this patch? (10/43) [ynWvpxqadjk], or ? for help: y Mon Sep 3 10:14:55 EDT 2007 Pekka.Pessi@nokia.com * url.c: do not un-escape %40 in URI parameters. Do not unescape %2C, %3B, %3D, or %40 in URI parameters, nor %2C, %2F, %3B, %3D, or %40 in URI path. The @ sign can be ambiguous in the SIP URL, e.g., <sip:test.info;p=value@test.com> can be parsed in two ways: 1) username contains test.info;param=value and host part has test.com 2) empty username, host part test.info, URI parameter p=value@test.com Previously Sofia URL parser converted escaped '@' at signs (%40) in the URI parameters to the unescaped form. The resulting URI could be ambiguous and sometimes fail the syntax check if there was no '@' sign before the unescaped one. Thanks for Jan van den Bosch and Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (11/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 04:59:57 EDT 2007 Pekka.Pessi@nokia.com * tport.c: fixed indenting, logging Shall I pull this patch? (12/43) [ynWvpxqadjk], or ? for help: y Fri Jul 13 12:47:33 EDT 2007 Pekka.Pessi@nokia.com * nua/test_proxy.h, nua/test_proxy.c: added support for multiple domains Each domain has its own registrar and authentication module. Shall I pull this patch? (13/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:19:33 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: added timestamp to event logging Shall I pull this patch? (14/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:20:12 EDT 2007 Pekka.Pessi@nokia.com * test_nua: fixed timing problems in testing. Shall I pull this patch? (15/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:04 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: reduce su_root_step() delay to 0.1 seconds Shall I pull this patch? (16/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:22 EDT 2007 Pekka.Pessi@nokia.com * test_register.c: fixed timing problem Shall I pull this patch? (17/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 17:03:46 EDT 2007 Pekka.Pessi@nokia.com * test_100rel.c: fixed timing problems resulting in events being reordered Shall I pull this patch? (18/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:40:53 EDT 2007 Pekka.Pessi@nokia.com * nua (test_init.c, test_register.c): using test_proxy domains Shall I pull this patch? (19/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 12:12:32 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added cleanup code Shall I pull this patch? (20/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:35:35 EDT 2007 Pekka.Pessi@nokia.com * nta.c: increase lifetime of ACK transaction from T4 to T1 x 64 nta.c creates a ACK transaction in order to restransmit ACK requests when ever a retransmitted 2XX response to INVITE is received. The UAS retransmits the 2XX responses for 64 x T1 (32 second by default). Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (21/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 10:21:04 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: generating libsofia-sip-ua/docs/Doxyfile.rfc before making manpages Shall I pull this patch? (22/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:05:33 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING() Shall I pull this patch? (23/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:09:06 EDT 2007 Pekka.Pessi@nokia.com * tport: added ping-pong keepalive on TCP. replaced single tick with connection-specific timer Now detecting closed connections on TLS, too. Added tests for idle timeout, receive timeout, ping-pong timeout. Shall I pull this patch? (24/43) [ynWvpxqadjk], or ? for help: y Fri Jul 6 10:19:32 EDT 2007 Pekka.Pessi@nokia.com * nta.c: added nta_incoming_received() Shall I pull this patch? (25/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:29:56 EDT 2007 Pekka.Pessi@nokia.com * nua_session.c: delay transition to ready when O/A is incomplete Delay sending ACK and subsequent transition of call to the ready state when the 200 OK response to the INVITE is received if the SDP Offer/Answer exchange using UPDATE/PRACK was still incomplete. Previously, if the O/A using UPDATE or PRACK was incomplete and an 200 OK was received, the call setup logic regarded this as a fatal error and terminated the call. Thanks for Mike Jerris for detecting and reporting this bug. Shall I pull this patch? (26/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:22:46 EDT 2007 Pekka.Pessi@nokia.com * test_call_reject.c: testing Retry-After Shall I pull this patch? (27/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:42:51 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using rudimentary outbound support in B's proxy. Shall I pull this patch? (28/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:48:33 EDT 2007 Pekka.Pessi@nokia.com * nua_register.c: added some logging to nua_register_connection_closed() Shall I pull this patch? (29/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:43:57 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C C is now challenged every time. Shall I pull this patch? (30/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 11:05:19 EDT 2007 Pekka.Pessi@nokia.com * nua/test_100rel.c: fixed timing problem re response to PRACK and ACK Shall I pull this patch? (31/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 06:02:50 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * DIST_SUBDIRS must include everything unconditionally Shall I pull this patch? (32/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:53:04 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: silenced warnings Shall I pull this patch? (33/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com * nua: refactored dialog refresh code Shall I pull this patch? (34/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com UNDO: nua: refactored dialog refresh code Shall I pull this patch? (35/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:01:25 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc]: renamed functions setting refresh interval Shall I pull this patch? (36/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:15:03 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc], nua_stack.c: added nua_dialog_repeat_shutdown() Shall I pull this patch? (37/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:19:20 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.h: renamed nua_remote_t as nua_dialog_peer_info_t Shall I pull this patch? (38/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:23:04 EDT 2007 Pekka.Pessi@nokia.com * nua_stack.c: added timer to client request in order to implement Retry-After Shall I pull this patch? (39/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:33:53 EDT 2007 Pekka.Pessi@nokia.com * nua: added backpointers to nua_dialog_usage_t and nua_dialog_state_t Shall I pull this patch? (40/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:56:48 EDT 2007 Pekka.Pessi@nokia.com * test_nua.c: abort() in timeout alarm function if -a is given Shall I pull this patch? (41/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 17:13:18 EDT 2007 Pekka.Pessi@nokia.com * nua_subnotref.c: include SIPTAG_EVENT() in the nua_i_notify tag list Shall I pull this patch? (42/43) [ynWvpxqadjk], or ? for help: y Mon Sep 10 12:27:53 EDT 2007 Pekka.Pessi@nokia.com * nua: save Contact from target refresh request or response. Save the Contact header which the application has added to the target refresh requests or responses and use the saved contact in subsequent target refresh requests or responses. Previously the application had no way of specifying the Contact included in the automatic responses to target refresh requests. Thanks for Anthony Minessale for reporting this problem. Shall I pull this patch? (43/43) [ynWvpxqadjk], or ? for help: y git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5692 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-09-10 20:45:25 +00:00
su_nanotime_t nano;
BEGIN();
memset(home, 0, sizeof home);
home->suh_size = sizeof home;
su_home_init(home);
TEST_P(nta_agent_create(NULL,
(url_string_t *)"sip:*:*",
NULL,
NULL,
TAG_END()), NULL);
TEST_1(root = su_root_create(NULL));
TEST_P(nta_agent_create(root,
(url_string_t *)"http://localhost:*/invalid/bind/url",
NULL,
NULL,
TAG_END()), NULL);
TEST_P(nta_agent_create(root,
(url_string_t *)"sip:*:*;transport=XXX",
NULL,
NULL,
TAG_END()), NULL);
TEST_1(nta = nta_agent_create(root,
(url_string_t *)"sip:*:*",
NULL,
NULL,
TAG_END()));
TEST_VOID(nta_agent_destroy(NULL));
TEST_VOID(nta_agent_destroy(nta));
TEST_1(nta = nta_agent_create(root,
(url_string_t *)"sip:*:*",
agent_callback,
ag,
TAG_END()));
TEST_P(nta_agent_contact(NULL), NULL);
TEST_P(nta_agent_via(NULL), NULL);
TEST_S(nta_agent_version(nta), nta_agent_version(NULL));
TEST_P(nta_agent_magic(NULL), NULL);
TEST_P(nta_agent_magic(nta), (void *)ag);
TEST(nta_agent_add_tport(NULL, NULL, TAG_END()), -1);
TEST_P(nta_agent_newtag(home, "tag=%s", NULL), NULL);
TEST_1(nta_agent_newtag(home, "tag=%s", nta));
{
msg_t *msg;
TEST_1(nta_msg_create(NULL, 0) == NULL);
TEST(nta_msg_complete(NULL), -1);
TEST_1(msg = nta_msg_create(nta, 0));
TEST(nta_msg_complete(msg), -1);
TEST(nta_msg_request_complete(msg, NULL,
sip_method_unknown, "FOO", NULL), -1);
TEST(nta_is_internal_msg(NULL), 0);
TEST(nta_is_internal_msg(msg), 0);
TEST_1(msg_set_flags(msg, NTA_INTERNAL_MSG));
TEST(nta_is_internal_msg(msg), 1);
TEST_VOID(msg_destroy(msg));
}
TEST_P(nta_leg_tcreate(NULL, NULL, NULL, TAG_END()), NULL);
TEST_VOID(nta_leg_destroy(NULL));
TEST_P(nta_leg_magic(NULL, NULL), NULL);
TEST_VOID(nta_leg_bind(NULL, NULL, NULL));
TEST_P(nta_leg_tag(NULL, "fidsafsa"), NULL);
TEST_P(nta_leg_rtag(NULL, "fidsafsa"), NULL);
TEST_P(nta_leg_get_tag(NULL), NULL);
TEST(nta_leg_client_route(NULL, NULL, NULL), -1);
TEST(nta_leg_server_route(NULL, NULL, NULL), -1);
TEST_P(nta_leg_by_uri(NULL, NULL), NULL);
TEST_P(nta_leg_by_dialog(NULL, NULL, NULL, NULL, NULL, NULL, NULL), NULL);
TEST_P(nta_leg_by_dialog(nta, NULL, NULL, NULL, NULL, NULL, NULL), NULL);
TEST_P(nta_leg_make_replaces(NULL, NULL, 1), NULL);
TEST_P(nta_leg_by_replaces(NULL, NULL), NULL);
TEST_P(nta_incoming_create(NULL, NULL, NULL, NULL, TAG_END()), NULL);
TEST_P(nta_incoming_create(nta, NULL, NULL, NULL, TAG_END()), NULL);
TEST_VOID(nta_incoming_bind(NULL, NULL, NULL));
TEST_P(nta_incoming_magic(NULL, NULL), NULL);
TEST_P(nta_incoming_find(NULL, NULL, NULL), NULL);
TEST_P(nta_incoming_find(nta, NULL, NULL), NULL);
TEST_P(nta_incoming_tag(NULL, NULL), NULL);
TEST_P(nta_incoming_gettag(NULL), NULL);
TEST(nta_incoming_status(NULL), 400);
TEST(nta_incoming_method(NULL), sip_method_invalid);
TEST_P(nta_incoming_method_name(NULL), NULL);
TEST_P(nta_incoming_url(NULL), NULL);
TEST(nta_incoming_cseq(NULL), 0);
Merge up to the most recent sofia-sip darcs tree. Includes the following patches from darcs: Tue Aug 21 09:38:59 EDT 2007 Pekka.Pessi@nokia.com * tport_type_udp.c: checking error while checking that MSG_TRUNC works. Shall I pull this patch? (1/43) [ynWvpxqadjk], or ? for help: y Tue Aug 21 10:49:33 EDT 2007 Pekka.Pessi@nokia.com * nua_params.c: NUTAG_SIPS_URL() now sets the handle target, too. Problem reported by Jari Tenhunen. Shall I pull this patch? (2/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 11:22:42 EDT 2007 Pekka.Pessi@nokia.com * nta.c: do not destroy INVITE transaction if it has been CANCELed Handle gracefully cases where the INVITE transaction is destroyed immediately after canceling it. The old behaviour was to left it up to the application to ACK the final response returned to INVITE. Thanks for Fabio Margarido for reporting this problem. Shall I pull this patch? (3/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 13:02:01 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added test with user SDP containing already rejected media Shall I pull this patch? (4/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com * nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (5/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:41:20 EDT 2007 Pekka.Pessi@nokia.com UNDO: nta: added option for processing orphan responses matching with a dialog The orphan responses matching with the dialog can now be processed by the response callback.The dialog leg can be created with NTATAG_RESPONSE_CALLBACK() or a response callback can be later bound to the leg with nta_leg_bind_response(). This is practically useful only with 200 OK responses to the INVITE that are retransmitted by the UAS. By default, the retransmission are catched by the ACK transaction (which then retransmits the ACK request message). However, after ACK transaction times out, the retransmitted 200 OK indicates most probably that the ACK request messages do not reach UAS. Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (6/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:00:10 EDT 2007 Pekka.Pessi@nokia.com * nta.c: disabled nta_msg_ackbye(). Fix for sf.net bug #1750691 Thanks for Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (7/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 06:54:38 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for sf.net bug #1750691 Shall I pull this patch? (8/43) [ynWvpxqadjk], or ? for help: y Thu Aug 30 07:03:45 EDT 2007 Pekka.Pessi@nokia.com * test_nua: added test for nua_bye() sending CANCEL Shall I pull this patch? (9/43) [ynWvpxqadjk], or ? for help: y Fri Aug 31 12:08:09 EDT 2007 Pekka.Pessi@nokia.com * url.c: fixed escaping of '/' %2F, ';' %3B and '=' %3D in URL path/params Thanks for Fabio Margarido for reporting this bug. Shall I pull this patch? (10/43) [ynWvpxqadjk], or ? for help: y Mon Sep 3 10:14:55 EDT 2007 Pekka.Pessi@nokia.com * url.c: do not un-escape %40 in URI parameters. Do not unescape %2C, %3B, %3D, or %40 in URI parameters, nor %2C, %2F, %3B, %3D, or %40 in URI path. The @ sign can be ambiguous in the SIP URL, e.g., <sip:test.info;p=value@test.com> can be parsed in two ways: 1) username contains test.info;param=value and host part has test.com 2) empty username, host part test.info, URI parameter p=value@test.com Previously Sofia URL parser converted escaped '@' at signs (%40) in the URI parameters to the unescaped form. The resulting URI could be ambiguous and sometimes fail the syntax check if there was no '@' sign before the unescaped one. Thanks for Jan van den Bosch and Mikhail Zabaluev for reporting this bug. Shall I pull this patch? (11/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 04:59:57 EDT 2007 Pekka.Pessi@nokia.com * tport.c: fixed indenting, logging Shall I pull this patch? (12/43) [ynWvpxqadjk], or ? for help: y Fri Jul 13 12:47:33 EDT 2007 Pekka.Pessi@nokia.com * nua/test_proxy.h, nua/test_proxy.c: added support for multiple domains Each domain has its own registrar and authentication module. Shall I pull this patch? (13/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:19:33 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: added timestamp to event logging Shall I pull this patch? (14/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:20:12 EDT 2007 Pekka.Pessi@nokia.com * test_nua: fixed timing problems in testing. Shall I pull this patch? (15/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:04 EDT 2007 Pekka.Pessi@nokia.com * test_ops.c: reduce su_root_step() delay to 0.1 seconds Shall I pull this patch? (16/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:31:22 EDT 2007 Pekka.Pessi@nokia.com * test_register.c: fixed timing problem Shall I pull this patch? (17/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 17:03:46 EDT 2007 Pekka.Pessi@nokia.com * test_100rel.c: fixed timing problems resulting in events being reordered Shall I pull this patch? (18/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:40:53 EDT 2007 Pekka.Pessi@nokia.com * nua (test_init.c, test_register.c): using test_proxy domains Shall I pull this patch? (19/43) [ynWvpxqadjk], or ? for help: y Thu Aug 23 12:12:32 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: added cleanup code Shall I pull this patch? (20/43) [ynWvpxqadjk], or ? for help: y Fri Aug 24 09:35:35 EDT 2007 Pekka.Pessi@nokia.com * nta.c: increase lifetime of ACK transaction from T4 to T1 x 64 nta.c creates a ACK transaction in order to restransmit ACK requests when ever a retransmitted 2XX response to INVITE is received. The UAS retransmits the 2XX responses for 64 x T1 (32 second by default). Partially fixes the sf.net bug #1750691 reported by Mikhail Zabaluev. Shall I pull this patch? (21/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 10:21:04 EDT 2007 Pekka.Pessi@nokia.com * Makefile.am: generating libsofia-sip-ua/docs/Doxyfile.rfc before making manpages Shall I pull this patch? (22/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:05:33 EDT 2007 Pekka.Pessi@nokia.com * sofia-sip/tport_tag.h: added TPTAG_KEEPALIVE(), TPTAG_PINGPONG(), TPTAG_PONG2PING() Shall I pull this patch? (23/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:09:06 EDT 2007 Pekka.Pessi@nokia.com * tport: added ping-pong keepalive on TCP. replaced single tick with connection-specific timer Now detecting closed connections on TLS, too. Added tests for idle timeout, receive timeout, ping-pong timeout. Shall I pull this patch? (24/43) [ynWvpxqadjk], or ? for help: y Fri Jul 6 10:19:32 EDT 2007 Pekka.Pessi@nokia.com * nta.c: added nta_incoming_received() Shall I pull this patch? (25/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 11:29:56 EDT 2007 Pekka.Pessi@nokia.com * nua_session.c: delay transition to ready when O/A is incomplete Delay sending ACK and subsequent transition of call to the ready state when the 200 OK response to the INVITE is received if the SDP Offer/Answer exchange using UPDATE/PRACK was still incomplete. Previously, if the O/A using UPDATE or PRACK was incomplete and an 200 OK was received, the call setup logic regarded this as a fatal error and terminated the call. Thanks for Mike Jerris for detecting and reporting this bug. Shall I pull this patch? (26/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:22:46 EDT 2007 Pekka.Pessi@nokia.com * test_call_reject.c: testing Retry-After Shall I pull this patch? (27/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:42:51 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using rudimentary outbound support in B's proxy. Shall I pull this patch? (28/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:48:33 EDT 2007 Pekka.Pessi@nokia.com * nua_register.c: added some logging to nua_register_connection_closed() Shall I pull this patch? (29/43) [ynWvpxqadjk], or ? for help: y Wed Jul 25 12:43:57 EDT 2007 Pekka.Pessi@nokia.com * test_nua: using AUTHTAG_MAX_NCOUNT(1) for Mr. C C is now challenged every time. Shall I pull this patch? (30/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 11:05:19 EDT 2007 Pekka.Pessi@nokia.com * nua/test_100rel.c: fixed timing problem re response to PRACK and ACK Shall I pull this patch? (31/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 06:02:50 EDT 2007 Mikhail Zabaluev <mikhail.zabaluev@nokia.com> * DIST_SUBDIRS must include everything unconditionally Shall I pull this patch? (32/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:53:04 EDT 2007 Pekka.Pessi@nokia.com * test_soa.c: silenced warnings Shall I pull this patch? (33/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com * nua: refactored dialog refresh code Shall I pull this patch? (34/43) [ynWvpxqadjk], or ? for help: y Mon Jul 23 16:59:48 EDT 2007 Pekka.Pessi@nokia.com UNDO: nua: refactored dialog refresh code Shall I pull this patch? (35/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:01:25 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc]: renamed functions setting refresh interval Shall I pull this patch? (36/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:15:03 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.[hc], nua_stack.c: added nua_dialog_repeat_shutdown() Shall I pull this patch? (37/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:19:20 EDT 2007 Pekka.Pessi@nokia.com * nua_dialog.h: renamed nua_remote_t as nua_dialog_peer_info_t Shall I pull this patch? (38/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:23:04 EDT 2007 Pekka.Pessi@nokia.com * nua_stack.c: added timer to client request in order to implement Retry-After Shall I pull this patch? (39/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 12:33:53 EDT 2007 Pekka.Pessi@nokia.com * nua: added backpointers to nua_dialog_usage_t and nua_dialog_state_t Shall I pull this patch? (40/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 13:56:48 EDT 2007 Pekka.Pessi@nokia.com * test_nua.c: abort() in timeout alarm function if -a is given Shall I pull this patch? (41/43) [ynWvpxqadjk], or ? for help: y Thu Sep 6 17:13:18 EDT 2007 Pekka.Pessi@nokia.com * nua_subnotref.c: include SIPTAG_EVENT() in the nua_i_notify tag list Shall I pull this patch? (42/43) [ynWvpxqadjk], or ? for help: y Mon Sep 10 12:27:53 EDT 2007 Pekka.Pessi@nokia.com * nua: save Contact from target refresh request or response. Save the Contact header which the application has added to the target refresh requests or responses and use the saved contact in subsequent target refresh requests or responses. Previously the application had no way of specifying the Contact included in the automatic responses to target refresh requests. Thanks for Anthony Minessale for reporting this problem. Shall I pull this patch? (43/43) [ynWvpxqadjk], or ? for help: y git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5692 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-09-10 20:45:25 +00:00
TEST(nta_incoming_received(NULL, &nano), 0);
TEST64(nano, 0);
TEST(nta_incoming_set_params(NULL, TAG_END()), -1);
TEST_P(nta_incoming_getrequest(NULL), NULL);
TEST_P(nta_incoming_getrequest_ackcancel(NULL), NULL);
TEST_P(nta_incoming_getresponse(NULL), NULL);
TEST(nta_incoming_complete_response(NULL, NULL, 800, "foo", TAG_END()), -1);
TEST(nta_incoming_treply(NULL, SIP_200_OK, TAG_END()), -1);
TEST(nta_incoming_mreply(NULL, NULL), -1);
TEST_VOID(nta_incoming_destroy(NULL));
TEST_P(nta_outgoing_tcreate(NULL, outgoing_callback, ag,
URL_STRING_MAKE("sip:localhost"),
SIP_METHOD_MESSAGE,
URL_STRING_MAKE("sip:localhost"),
TAG_END()), NULL);
TEST_P(nta_outgoing_mcreate(NULL, outgoing_callback, ag,
URL_STRING_MAKE("sip:localhost"),
NULL,
TAG_END()), NULL);
TEST_P(nta_outgoing_default(NULL, NULL, NULL), NULL);
TEST(nta_outgoing_status(NULL), 500);
TEST(nta_outgoing_method(NULL), sip_method_invalid);
TEST_P(nta_outgoing_method_name(NULL), NULL);
TEST(nta_outgoing_cseq(NULL), 0);
TEST(nta_outgoing_delay(NULL), UINT_MAX);
TEST_P(nta_outgoing_request_uri(NULL), NULL);
TEST_P(nta_outgoing_route_uri(NULL), NULL);
TEST_P(nta_outgoing_getresponse(NULL), NULL);
TEST_P(nta_outgoing_getrequest(NULL), NULL);
TEST_P(nta_outgoing_tagged(NULL, NULL, NULL, NULL, NULL), NULL);
TEST(nta_outgoing_cancel(NULL), -1);
TEST_P(nta_outgoing_tcancel(NULL, NULL, NULL, TAG_END()), NULL);
TEST_VOID(nta_outgoing_destroy(NULL));
TEST_P(nta_outgoing_find(NULL, NULL, NULL, NULL), NULL);
TEST_P(nta_outgoing_find(nta, NULL, NULL, NULL), NULL);
TEST(nta_outgoing_status(NONE), 500);
TEST(nta_outgoing_method(NONE), sip_method_invalid);
TEST_P(nta_outgoing_method_name(NONE), NULL);
TEST(nta_outgoing_cseq(NONE), 0);
TEST(nta_outgoing_delay(NONE), UINT_MAX);
TEST_P(nta_outgoing_request_uri(NONE), NULL);
TEST_P(nta_outgoing_route_uri(NONE), NULL);
TEST_P(nta_outgoing_getresponse(NONE), NULL);
TEST_P(nta_outgoing_getrequest(NONE), NULL);
TEST_P(nta_outgoing_tagged(NONE, NULL, NULL, NULL, NULL), NULL);
TEST(nta_outgoing_cancel(NONE), -1);
TEST_P(nta_outgoing_tcancel(NONE, NULL, NULL, TAG_END()), NULL);
TEST_VOID(nta_outgoing_destroy(NONE));
#if 0
nta_reliable_t *nta_reliable_treply(nta_incoming_t *ireq,
nta_prack_f *callback,
nta_reliable_magic_t *rmagic,
int status, char const *phrase,
tag_type_t tag,
tag_value_t value, ...);
nta_reliable_t *nta_reliable_mreply(nta_incoming_t *irq,
nta_prack_f *callback,
nta_reliable_magic_t *rmagic,
msg_t *msg);
void nta_reliable_destroy(nta_reliable_t *);
#endif
TEST_VOID(nta_agent_destroy(nta));
TEST_VOID(su_root_destroy(root));
TEST_VOID(su_home_deinit(home));
END();
}
static int api_test_dialog_matching(agent_t *ag)
{
nta_agent_t *nta;
su_root_t *root;
su_home_t home[1];
nta_leg_t *leg, *dialog1, *dialog2, *dst, *defdst;
sip_from_t *a1, *a2;
sip_call_id_t *i;
BEGIN();
memset(home, 0, sizeof home);
home->suh_size = sizeof home;
su_home_init(home);
TEST_1(root = su_root_create(NULL));
TEST_1(nta = nta_agent_create(root,
(url_string_t *)"sip:*:*",
NULL,
NULL,
TAG_END()));
TEST_1(dst = nta_leg_tcreate(nta, NULL, NULL,
NTATAG_NO_DIALOG(1),
URLTAG_URL("sip:joe@localhost"),
TAG_END()));
TEST_1(defdst = nta_leg_tcreate(nta, NULL, NULL,
NTATAG_NO_DIALOG(1),
TAG_END()));
TEST_1(dialog1 =
nta_leg_tcreate(nta, NULL, NULL,
URLTAG_URL("sip:pc.al.us"),
SIPTAG_CALL_ID_STR("foobarbaz"),
/* local */
SIPTAG_FROM_STR("<sip:me.myself.i@foo.com>;tag=foo"),
/* remote */
SIPTAG_TO_STR("<sip:joe.boy@al.us>"),
TAG_END()));
TEST_1(a1 = sip_from_make(home, "<sip:me.myself.i@foo.com>;tag=foo"));
TEST_1(a2 = sip_from_make(home, "<sip:joe.boy@al.us>;tag=al"));
TEST_1(i = sip_call_id_make(home, "foobarbaz"));
TEST_1(dialog2 =
nta_leg_tcreate(nta, NULL, NULL,
SIPTAG_CALL_ID(i),
/* local */
SIPTAG_FROM(a2),
/* remote */
SIPTAG_TO(a1),
TAG_END()));
TEST_1(!nta_leg_by_dialog(nta, NULL, NULL,
a1->a_tag, a1->a_url, a2->a_tag, a2->a_url));
TEST_1(!nta_leg_by_dialog(NULL, NULL, i,
a1->a_tag, a1->a_url, a2->a_tag, a2->a_url));
TEST_1(!nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url));
TEST_1(!nta_leg_by_dialog(nta, a2->a_url, i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url));
TEST_P(leg = nta_leg_by_dialog(nta, NULL, i,
/* local */ a1->a_tag, a1->a_url,
/* remote */ a2->a_tag, a2->a_url),
dialog2);
TEST_P(leg = nta_leg_by_dialog(nta, (void *)"sip:no.such.url", i,
/* local */ a1->a_tag, a1->a_url,
/* remote */ a2->a_tag, a2->a_url),
dialog2);
TEST_P(leg = nta_leg_by_dialog(nta, a2->a_url, i,
a1->a_tag, a1->a_url, a2->a_tag, a2->a_url),
dialog2);
TEST_P(leg = nta_leg_by_dialog(nta, NULL, i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
dialog1);
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
dialog1);
/* local tag is required because there is tag */
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, "xyzzy", a1->a_url),
NULL);
/* local URI is ignored because we have tag */
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, a1->a_tag, a2->a_url),
dialog1);
/* remote tag is ignored because there is no tag */
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
"xyzzy", a2->a_url, a1->a_tag, a1->a_url),
dialog1);
/* remote url is required */
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a1->a_url, a1->a_tag, a1->a_url),
NULL);
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, NULL, a1->a_tag, a1->a_url),
dialog1);
/* local url is used if there is no local tag */
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, NULL, NULL),
NULL);
nta_leg_tag(dialog1, "al");
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
dialog1);
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, "xyzzy", a1->a_url),
NULL);
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, a1->a_tag, a1->a_url),
dialog1);
TEST_P(leg = nta_leg_by_dialog(nta, (url_t *)"sip:pc.al.us", i,
a2->a_tag, a2->a_url, NULL, a1->a_url),
NULL);
nta_leg_destroy(defdst);
nta_leg_destroy(dst);
nta_leg_destroy(dialog1);
nta_leg_destroy(dialog2);
TEST_VOID(nta_agent_destroy(nta));
TEST_VOID(su_root_destroy(root));
TEST_VOID(su_home_deinit(home));
END();
}
#if HAVE_ALARM
#include <unistd.h>
#include <signal.h>
static RETSIGTYPE sig_alarm(int s)
{
fprintf(stderr, "%s: FAIL! test timeout!\n", name);
exit(1);
}
#endif
static
char const nta_test_api_usage[] =
"usage: %s OPTIONS\n"
"where OPTIONS are\n"
" -v | --verbose be verbose\n"
" -a | --abort abort() on error\n"
" -q | --quiet be quiet\n"
" -1 quit on first error\n"
" -l level set logging level (0 by default)\n"
" --attach print pid, wait for a debugger to be attached\n"
#if HAVE_ALARM
" --no-alarm don't ask for guard ALARM\n"
#endif
;
void usage(int exitcode)
{
fprintf(stderr, nta_test_api_usage, name);
exit(exitcode);
}
int main(int argc, char *argv[])
{
int retval = 0, quit_on_single_failure = 0;
int i, o_attach = 0, o_alarm = 1;
agent_t ag[1] = {{ { SU_HOME_INIT(ag) }, 0, NULL }};
for (i = 1; argv[i]; i++) {
if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--verbose") == 0)
tstflags |= tst_verbatim;
else if (strcmp(argv[i], "-a") == 0 || strcmp(argv[i], "--abort") == 0)
tstflags |= tst_abort;
else if (strcmp(argv[i], "-q") == 0 || strcmp(argv[i], "--quiet") == 0)
tstflags &= ~tst_verbatim;
else if (strcmp(argv[i], "-1") == 0)
quit_on_single_failure = 1;
else if (strncmp(argv[i], "-l", 2) == 0) {
int level = 3;
char *rest = NULL;
if (argv[i][2])
level = strtol(argv[i] + 2, &rest, 10);
else if (argv[i + 1])
level = strtol(argv[i + 1], &rest, 10), i++;
else
level = 3, rest = "";
if (rest == NULL || *rest)
usage(1);
su_log_set_level(nta_log, level);
su_log_set_level(tport_log, level);
}
else if (strcmp(argv[i], "--attach") == 0) {
o_attach = 1;
}
else if (strcmp(argv[i], "--no-alarm") == 0) {
o_alarm = 0;
}
else if (strcmp(argv[i], "-") == 0) {
i++; break;
}
else if (argv[i][0] != '-') {
break;
}
else
usage(1);
}
if (o_attach) {
char *response, line[10];
printf("nua_test: pid %lu\n", (unsigned long)getpid());
printf("<Press RETURN to continue>\n");
response = fgets(line, sizeof line, stdin);
}
#if HAVE_ALARM
else if (o_alarm) {
alarm(60);
signal(SIGALRM, sig_alarm);
}
#endif
su_init();
if (!(TSTFLAGS & tst_verbatim)) {
su_log_soft_set_level(nta_log, 0);
su_log_soft_set_level(tport_log, 0);
}
#define SINGLE_FAILURE_CHECK() \
do { fflush(stderr); fflush(stdout); \
if (retval && quit_on_single_failure) { su_deinit(); return retval; } \
} while(0)
retval |= api_test_init(ag); fflush(stdout); SINGLE_FAILURE_CHECK();
if (retval == 0) {
retval |= api_test_errors(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_params(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_stats(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_dialog_matching(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_tport(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_dialogs(ag); SINGLE_FAILURE_CHECK();
retval |= api_test_default(ag); SINGLE_FAILURE_CHECK();
}
retval |= api_test_deinit(ag); fflush(stdout);
su_home_deinit(ag->ag_home);
su_deinit();
return retval;
}