Commit 9b2911d1 authored by Pekka Pessi's avatar Pekka Pessi

nta.c: added nta_incoming_received()

darcs-hash:20070706141932-65a35-db8298cbd3f6d73ecd3215aa7ad13b8295034d04.gz
parent d65fd637
......@@ -5127,6 +5127,21 @@ nta_incoming_magic_t *nta_incoming_magic(nta_incoming_t *irq,
return irq && irq->irq_callback == callback ? irq->irq_magic : NULL;
}
/** When received */
sip_time_t nta_incoming_received(nta_incoming_t *irq,
su_nanotime_t *return_nano)
{
su_time_t tv = { 0, 0 };
if (irq)
tv = irq->irq_received;
if (return_nano)
*return_nano = (su_nanotime_t)tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
return tv.tv_sec;
}
/** Find incoming transaction. */
nta_incoming_t *nta_incoming_find(nta_agent_t const *agent,
sip_t const *sip,
......
......@@ -284,6 +284,7 @@ SOFIAPUBFUN sip_method_t nta_incoming_method(nta_incoming_t const *irq);
SOFIAPUBFUN char const *nta_incoming_method_name(nta_incoming_t const *irq);
SOFIAPUBFUN url_t const *nta_incoming_url(nta_incoming_t const *irq);
SOFIAPUBFUN uint32_t nta_incoming_cseq(nta_incoming_t const *irq);
SOFIAPUBFUN sip_time_t nta_incoming_received(nta_incoming_t *irq, su_nanotime_t *nano);
SOFIAPUBFUN int nta_incoming_set_params(nta_incoming_t *irq,
tag_type_t tag, tag_value_t value, ...);
......
......@@ -453,7 +453,7 @@ int api_test_params(agent_t *ag)
sip_contact_t const *aliases = (void *)-1;
msg_mclass_t *mclass = (void *)-1;
sip_contact_t *contact = (void *)-1;
sip_contact_t const *contact = (void *)-1;
url_string_t const *default_proxy = (void *)-1;
void *smime = (void *)-1;
......@@ -859,6 +859,7 @@ static int api_test_default(agent_t *ag)
nta_incoming_t *irq;
nta_outgoing_t *orq;
sip_via_t via[1];
su_nanotime_t nano;
TEST_1(nta = ag->ag_agent);
......@@ -876,7 +877,9 @@ static int api_test_default(agent_t *ag)
TEST_S(nta_incoming_method_name(irq), "*");
TEST_P(nta_incoming_url(irq), NULL);
TEST(nta_incoming_cseq(irq), 0);
TEST(nta_incoming_received(irq, &nano), nano / 1000000000);
TEST(nta_incoming_set_params(irq, TAG_END()), 0);
TEST_P(nta_incoming_getrequest(irq), NULL);
......@@ -944,6 +947,7 @@ static int api_test_errors(agent_t *ag)
nta_agent_t *nta;
su_root_t *root;
su_home_t home[1];
su_nanotime_t nano;
BEGIN();
......@@ -1044,6 +1048,8 @@ static int api_test_errors(agent_t *ag)
TEST_P(nta_incoming_method_name(NULL), NULL);
TEST_P(nta_incoming_url(NULL), NULL);
TEST(nta_incoming_cseq(NULL), 0);
TEST(nta_incoming_received(NULL, &nano), 0);
TEST64(nano, 0);
TEST(nta_incoming_set_params(NULL, TAG_END()), -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment