Commit 6a39ccb7 authored by Pekka Pessi's avatar Pekka Pessi

Plugging memory leaks in nta.

Plugged memory leaks in 100rel code.

darcs-hash:20051102152645-65a35-b5f950e3327f949152a8decba87a6dc1c14e0907.gz
parent 80131a1a
......@@ -1943,7 +1943,7 @@ void agent_recv_request(nta_agent_t *agent,
TAG_END());
}
} else {
nta_msg_discard(agent, msg);
msg_destroy(msg);
if (stream) /* Send FIN */
tport_shutdown(tport, 1);
}
......@@ -3914,6 +3914,10 @@ nta_incoming_t *nta_incoming_create(nta_agent_t *agent,
char const *to_tag = NULL;
tport_t *tport = NULL;
ta_list ta;
nta_incoming_t *irq;
if (msg == NULL)
return NULL;
if (agent == NULL && leg != NULL)
agent = leg->leg_agent;
......@@ -3921,11 +3925,8 @@ nta_incoming_t *nta_incoming_create(nta_agent_t *agent,
if (sip == NULL)
sip = sip_object(msg);
if (agent == NULL || msg == NULL || sip == NULL)
return NULL;
if (!sip->sip_request || !sip->sip_cseq)
return NULL;
if (agent == NULL || sip == NULL || !sip->sip_request || !sip->sip_cseq)
return msg_destroy(msg), NULL;
ta_start(ta, tag, value);
......@@ -3940,7 +3941,12 @@ nta_incoming_t *nta_incoming_create(nta_agent_t *agent,
if (tport == NULL)
tport = tport_delivered_by(agent->sa_tports, msg);
return incoming_create(agent, msg, sip, tport, to_tag);
irq = incoming_create(agent, msg, sip, tport, to_tag);
if (!irq)
msg_destroy(msg);
return irq;
}
/** @internal Create a new incoming transaction object. */
......@@ -3960,8 +3966,8 @@ nta_incoming_t *incoming_create(nta_agent_t *agent,
incoming_queue_t *queue;
sip_method_t method = sip->sip_request->rq_method;
irq->irq_request = msg = msg_ref_create(msg);
irq->irq_home = home = msg_home(msg);
irq->irq_request = msg;
irq->irq_home = home = msg_home(msg_ref_create(msg));
irq->irq_agent = agent;
irq->irq_received = agent_now(agent);
......@@ -4324,6 +4330,7 @@ static inline
void incoming_reclaim(nta_incoming_t *irq)
{
su_home_t *home = irq->irq_home;
nta_reliable_t *rel, *rel_next;
if (irq->irq_request)
msg_destroy(irq->irq_request), irq->irq_request = NULL;
......@@ -4332,6 +4339,13 @@ void incoming_reclaim(nta_incoming_t *irq)
if (irq->irq_response)
msg_destroy(irq->irq_response), irq->irq_response = NULL;
for (rel = irq->irq_reliable; rel; rel = rel_next) {
rel_next = rel->rel_next;
if (rel->rel_unsent)
msg_destroy(rel->rel_unsent);
su_free(irq->irq_agent->sa_home, rel);
}
irq->irq_home = NULL;
su_free(home, irq);
......@@ -4773,10 +4787,11 @@ int incoming_cancel(nta_incoming_t *irq, msg_t *msg, sip_t *sip,
NTATAG_TPORT(tport),
TAG_END());
if (irq->irq_completed || irq->irq_method != sip_method_invite)
if (irq->irq_completed || irq->irq_method != sip_method_invite) {
msg_destroy(msg);
return 0;
}
/* CANCEL */
if (!irq->irq_canceled) {
irq->irq_canceled = 1;
agent->sa_stats->as_canceled_tr++;
......@@ -4977,8 +4992,9 @@ int nta_incoming_treply(nta_incoming_t *irq,
{
int retval = -1;
if (irq && irq->irq_status < 200 || status < 200 ||
(irq->irq_method == sip_method_invite && status < 300)) {
if (irq &&
(irq->irq_status < 200 || status < 200 ||
(irq->irq_method == sip_method_invite && status < 300))) {
ta_list ta;
msg_t *msg = nta_msg_create(irq->irq_agent, 0);
sip_t *sip = sip_object(msg);
......@@ -5008,6 +5024,9 @@ int nta_incoming_treply(nta_incoming_t *irq,
/**
* Return a response message to client.
*
* @note
* The ownership of @a msg is taken over by the function even if the
* function fails.
*/
int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg)
{
......@@ -5055,7 +5074,11 @@ int nta_incoming_mreply(nta_incoming_t *irq, msg_t *msg)
}
/** Sends the response message. */
/** Send the response message.
*
* @note The ownership of msg is handled to incoming_reply().
*/
int incoming_reply(nta_incoming_t *irq, msg_t *msg, sip_t *sip)
{
nta_agent_t *agent = irq->irq_agent;
......@@ -5186,6 +5209,9 @@ int incoming_reply(nta_incoming_t *irq, msg_t *msg, sip_t *sip)
assert(msg_home(msg) != irq->irq_home);
irq->irq_response = msg;
}
else {
msg_destroy(msg);
}
if (sip->sip_cseq->cs_method == irq->irq_method &&
irq->irq_status < 200 && status > irq->irq_status)
......@@ -6977,6 +7003,7 @@ int outgoing_timer(nta_agent_t *sa, su_duration_t now)
int pending = sa->sa_out.trying->q_length + sa->sa_out.inv_calling->q_length;
int completed = sa->sa_out.completed->q_length +
sa->sa_out.inv_completed->q_length;
outgoing_queue_init(sa->sa_out.free = rq, 0);
while ((orq = sa->sa_out.re_list)) {
......@@ -7169,10 +7196,12 @@ int outgoing_terminate(nta_outgoing_t *orq)
if (!orq->orq_destroyed) {
outgoing_queue(orq->orq_agent->sa_out.terminated, orq);
return 0;
} else if (orq->orq_agent->sa_out.free) {
}
else if (orq->orq_agent->sa_out.free) {
outgoing_free_queue(orq->orq_agent->sa_out.free, orq);
return 1;
} else {
}
else {
outgoing_free(orq);
return 1;
}
......@@ -7625,7 +7654,8 @@ msg_t *outgoing_ackmsg(nta_outgoing_t *orq, sip_method_t m, char const *mname,
sip->sip_cseq)
return msg;
nta_msg_discard(orq->orq_agent, msg);
msg_destroy(msg);
return NULL;
}
......@@ -8813,14 +8843,11 @@ nta_reliable_t *reliable_mreply(nta_incoming_t *irq,
if (irq->irq_reliable &&
(irq->irq_reliable->rel_next == NULL ||
irq->irq_reliable->rel_rseq == 0)) {
rel->rel_response = msg_ref_create(msg);
return irq->irq_reliable = rel;
}
rel->rel_response = msg_ref_create(msg);
if (reliable_send(irq, rel, msg, sip) < 0) {
msg_destroy(rel->rel_response), rel->rel_response = NULL;
if (reliable_send(irq, rel, msg_ref_create(msg), sip) < 0) {
msg_destroy(msg);
su_free(agent->sa_home, rel);
return NULL;
}
......@@ -8853,12 +8880,10 @@ int reliable_send(nta_incoming_t *irq,
rel->rel_rseq = rseq->rs_response = irq->irq_rseq;
sip_add_dup(msg, sip, (sip_header_t *)rseq);
if (!sip->sip_rseq) {
if (!sip->sip_rseq || incoming_reply(irq, msg, sip) < 0) {
msg_destroy(msg);
return -1;
}
if (incoming_reply(irq, msg, sip) < 0)
return -1;
irq->irq_rseq++;
......@@ -8872,7 +8897,7 @@ int reliable_send(nta_incoming_t *irq,
return 0;
}
/** Process final response */
/** Queue final response when there are unsent precious preliminary responses */
static
int reliable_final(nta_incoming_t *irq, msg_t *msg, sip_t *sip)
{
......@@ -8940,7 +8965,7 @@ int reliable_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tp)
return -1; /* Process normally */
rel->rel_pracked = 1;
rel->rel_unsent = NULL;
msg_ref_destroy(rel->rel_unsent), rel->rel_unsent = NULL;
pr_irq = incoming_create(irq->irq_agent, msg, sip, tp, irq->irq_tag);
if (!pr_irq) {
......@@ -8951,8 +8976,6 @@ int reliable_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tp)
return 0;
}
msg_ref_destroy(rel->rel_response), rel->rel_response = NULL;
if (irq->irq_status < 200) {
incoming_queue(irq->irq_agent->sa_in.proceeding, irq); /* Reset P1 */
incoming_reset_timer(irq); /* Reset P2 */
......@@ -8987,18 +9010,17 @@ int reliable_recv(nta_incoming_t *irq, msg_t *msg, sip_t *sip, tport_t *tp)
if (sip->sip_status->st_status < 200) {
if (reliable_send(irq, rel, msg_ref_create(msg), sip) < 0) {
msg_ref_destroy(msg);
assert(!"send reliable response");
}
} else {
}
else {
/*
* XXX
* Final response should be delayed until a reliable provisional
* response has been pracked
*/
rel->rel_rseq = (uint32_t)-1;
if (incoming_reply(irq, msg_ref_create(msg), sip) < 0) {
msg_ref_destroy(msg);
rel->rel_unsent = NULL, rel->rel_rseq = (uint32_t)-1;
if (incoming_reply(irq, msg, sip) < 0) {
assert(!"send delayed final response");
}
}
......@@ -9019,8 +9041,7 @@ void reliable_flush(nta_incoming_t *irq)
if (rel) {
rel->rel_pracked = 1;
rel->rel_unsent = NULL;
msg_ref_destroy(rel->rel_response), rel->rel_response = NULL;
msg_ref_destroy(rel->rel_unsent), rel->rel_unsent = NULL;
rel->rel_callback(rel->rel_magic, rel, NULL, NULL);
}
} while (rel);
......@@ -9081,7 +9102,8 @@ int nta_reliable_leg_prack(nta_reliable_magic_t *magic,
method_name, sip->sip_cseq->cs_seq,
"PRACK processed by default callback, too"));
retval = leg->leg_callback(leg->leg_magic, leg, irq, sip);
} else {
}
else {
retval = 500;
}
......@@ -9098,7 +9120,7 @@ int nta_reliable_leg_prack(nta_reliable_magic_t *magic,
*/
void nta_reliable_destroy(nta_reliable_t *rel)
{
if (!rel)
if (rel == NULL || rel == NONE)
return;
if (rel->rel_callback == nta_reliable_destroyed)
......@@ -9135,6 +9157,9 @@ int nta_reliable_destroyed(nta_reliable_magic_t *rmagic,
*prev = rel->rel_next;
if (rel->rel_unsent)
msg_destroy(rel->rel_unsent), rel->rel_unsent = NULL;
su_free(rel->rel_irq->irq_agent->sa_home, rel);
return 200;
......
......@@ -47,6 +47,8 @@ typedef struct agent_t agent_t;
#include <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
......@@ -144,6 +146,8 @@ struct agent_t {
sip_content_type_t *ag_content_type;
sip_payload_t *ag_payload;
msg_t *ag_probe_msg;
/* Dummy servers */
char const *ag_sink_port;
int ag_sink_socket;
......@@ -183,7 +187,8 @@ int agent_callback(agent_t *ag,
}
}
nta_msg_discard(nta, msg);
msg_destroy(msg);
return 0;
}
......@@ -415,10 +420,10 @@ int outgoing_callback_with_api_test(agent_t *ag,
TEST_1(nta_outgoing_delay(orq) < UINT_MAX);
TEST_1(msg = nta_outgoing_getresponse(orq));
nta_msg_discard(ag->ag_agent, msg);
msg_destroy(msg);
TEST_1(msg = nta_outgoing_getrequest(orq));
nta_msg_discard(ag->ag_agent, msg);
msg_destroy(msg);
nta_outgoing_destroy(orq);
nta_outgoing_destroy(orq);
......@@ -531,6 +536,7 @@ int test_init(agent_t *ag, char const *resolv_conf)
SRESTAG_RESOLV_CONF(resolv_conf),
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,
......@@ -719,6 +725,10 @@ int test_deinit(agent_t *ag)
{
BEGIN();
if (ag->ag_request) msg_destroy(ag->ag_request), ag->ag_request = 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);
......@@ -727,6 +737,10 @@ int test_deinit(agent_t *ag)
nta_agent_destroy(ag->ag_agent);
su_root_destroy(ag->ag_root);
su_free(ag->ag_home, (void *)ag->ag_sink_port), ag->ag_sink_port = NULL;
free(ag->ag_mclass), ag->ag_mclass = NULL;
END();
}
......@@ -879,6 +893,7 @@ int test_tports(agent_t *ag)
TEST(nta_outgoing_getresponse_ref(ag->ag_orq), NULL);
TEST_1(msg = nta_outgoing_getrequest_ref(ag->ag_orq));
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);
......@@ -886,8 +901,6 @@ int test_tports(agent_t *ag)
TEST(ag->ag_orq, NULL);
TEST(ag->ag_latest_leg, ag->ag_default_leg);
TEST_1(ag->ag_request);
msg_destroy(msg);
}
#if HAVE_SIGCOMP
......@@ -921,7 +934,8 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST_1(ag->ag_client_compartment);
......@@ -965,6 +979,8 @@ int test_tports(agent_t *ag)
SIPTAG_PAYLOAD(pl),
NTATAG_DEFAULT_PROXY(ag->ag_obp),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -997,6 +1013,8 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1030,6 +1048,8 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1037,6 +1057,7 @@ int test_tports(agent_t *ag)
TEST_1(ag->ag_out_via);
TEST_1(strcasecmp(ag->ag_out_via->v_protocol, "SIP/2.0/TCP") == 0 ||
strcasecmp(ag->ag_out_via->v_protocol, "SIP/2.0/SCTP") == 0);
su_free(ag->ag_home, ag->ag_in_via), ag->ag_in_via = NULL;
}
/* Test 0.4.2:
......@@ -1071,12 +1092,15 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
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_in_via);
TEST_1(strcasecmp(ag->ag_in_via->v_protocol, "SIP/2.0/UDP") == 0);
su_free(ag->ag_home, ag->ag_in_via), ag->ag_in_via = NULL;
}
/* Test 0.5:
......@@ -1108,6 +1132,8 @@ int test_tports(agent_t *ag)
SIPTAG_PAYLOAD(pl),
TPTAG_MTU(0xffffffff),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1190,6 +1216,8 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1224,6 +1252,8 @@ int test_tports(agent_t *ag)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 413);
TEST(ag->ag_orq, NULL);
......@@ -1657,8 +1687,6 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
url->url_params = "transport=tcp";
TEST_1(pl = test_payload(ag->ag_home, size));
ag->ag_expect_leg = ag->ag_server_leg;
TEST_1(ag->ag_orq =
nta_outgoing_tcreate(ag->ag_default_leg, outgoing_callback, ag,
......@@ -1671,6 +1699,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1711,6 +1741,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1743,6 +1775,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1777,6 +1811,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1815,6 +1851,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_PAYLOAD(pl),
TPTAG_MTU(0xffffffff),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1896,6 +1934,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 200);
TEST(ag->ag_orq, NULL);
......@@ -1930,6 +1970,8 @@ int test_resolv(agent_t *ag, char const *resolv_conf)
SIPTAG_CONTACT(ag->ag_m_bob),
SIPTAG_PAYLOAD(pl),
TAG_END()));
su_free(ag->ag_home, pl);
nta_test_run(ag);
TEST(ag->ag_status, 413);
TEST(ag->ag_orq, NULL);
......@@ -2291,6 +2333,16 @@ int bob_leg_callback(agent_t *ag,
if (sip->sip_request->rq_method == sip_method_invite) {
nta_incoming_bind(irq, test_for_ack, ag);
#if 1
nta_incoming_treply(irq,
SIP_180_RINGING,
SIPTAG_CONTACT(ag->ag_m_bob),
TAG_END());
nta_incoming_treply(irq,
SIP_180_RINGING,
SIPTAG_CONTACT(ag->ag_m_bob),
TAG_END());
#endif
nta_incoming_treply(irq,
SIP_200_OK,
SIPTAG_CONTENT_TYPE(ag->ag_content_type),
......@@ -2321,6 +2373,17 @@ int outgoing_invite_callback(agent_t *ag,
sip->sip_status->st_phrase);
}
{
msg_t *msg;
TEST_1(msg = nta_outgoing_getresponse_ref(orq));
TEST_1(msg->m_refs == 2);
TEST_1(sip_object(msg) == sip);
if (ag->ag_probe_msg == NULL)
ag->ag_probe_msg = msg;
msg_destroy(msg);
}
if (status < 200) {
if (sip->sip_require && sip_has_feature(sip->sip_require, "100rel")) {
TEST_1(sip->sip_rseq);
......@@ -2502,10 +2565,11 @@ int test_for_ack_or_timeout(agent_t *ag,
END();
}
/* */
int bob_leg_callback2(agent_t *ag,
nta_leg_t *leg,
nta_incoming_t *irq,
sip_t const *sip)
nta_leg_t *leg,
nta_incoming_t *irq,
sip_t const *sip)
{
BEGIN();
......@@ -2553,6 +2617,13 @@ int bob_leg_callback2(agent_t *ag,
SIPTAG_PAYLOAD(ag->ag_payload),
SIPTAG_CONTACT(ag->ag_m_bob),
TAG_END());
if (0)
nta_incoming_treply(irq,
SIP_180_RINGING,
SIPTAG_CONTENT_TYPE(ag->ag_content_type),
SIPTAG_PAYLOAD(ag->ag_payload),
SIPTAG_CONTACT(ag->ag_m_bob),
TAG_END());
nta_incoming_treply(irq,
SIP_200_OK,
SIPTAG_CONTACT(ag->ag_m_bob),
......@@ -2567,8 +2638,8 @@ int bob_leg_callback2(agent_t *ag,
}
int invite_prack_callback(agent_t *ag,
nta_outgoing_t *orq,
sip_t const *sip)
nta_outgoing_t *orq,
sip_t const *sip)
{
BEGIN();
......@@ -2598,6 +2669,8 @@ int invite_prack_callback(agent_t *ag,
sip->sip_rseq);
TEST_1(tagged);
nta_outgoing_destroy(orq);
if (ag->ag_orq == orq)
ag->ag_orq = tagged;
orq = tagged;
}
......@@ -2609,7 +2682,6 @@ int invite_prack_callback(agent_t *ag,
TAG_END());
TEST_1(prack);
nta_outgoing_destroy(prack);
return 0;
}
......@@ -2639,6 +2711,7 @@ int invite_prack_callback(agent_t *ag,
TAG_END());
TEST_1(ack);
nta_outgoing_destroy(ack);
msg_destroy(msg);
}
else {
ag->ag_status = status;
......@@ -2696,6 +2769,7 @@ int test_prack(agent_t *ag)
TEST(ag->ag_latest_leg, NULL);
}
{
TEST_1(ag->ag_alice_leg = nta_leg_tcreate(ag->ag_agent,
alice_leg_callback,
ag,
......@@ -2708,20 +2782,20 @@ int test_prack(agent_t *ag)
nta_leg_bind(ag->ag_server_leg, bob_leg_callback2, ag);
ag->ag_expect_leg = ag->ag_server_leg;
TEST_1(ag->ag_orq =
nta_outgoing_tcreate(ag->ag_call_leg = ag->ag_alice_leg,
invite_prack_callback, ag,
ag->ag_obp,
SIP_METHOD_INVITE,
(url_string_t *)ag->ag_m_bob->m_url,
SIPTAG_SUBJECT_STR("Call 2"),
SIPTAG_CONTACT(ag->ag_m_alice),
SIPTAG_REQUIRE_STR("100rel"),
SIPTAG_CONTENT_TYPE(c),
SIPTAG_PAYLOAD(sdp),