nta 1.12.11devel
Loading...
Searching...
No Matches
check_nta.h
1/*
2 * This file is part of the Sofia-SIP package
3 *
4 * Copyright (C) 2008 Nokia Corporation.
5 *
6 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef CHECK_NTA_H
25#define CHECK_NTA_H
26
27#include <s2check.h>
28
29#include <sofia-sip/sip.h>
30#include <sofia-sip/tport.h>
31#include <sofia-sip/nta.h>
32
33#include <stdarg.h>
34
35#include "s2sip.h"
36
37extern struct s2nta {
38 su_home_t home[1];
39
40 nta_agent_t *nta;
41
42 su_root_t *root;
43
44 nta_leg_t *default_leg;
45
46 struct event {
47 struct event *next, **prev;
48
49 nta_agent_magic_t *amagic;
50
52 nta_outgoing_t *orq;
53
54 nta_leg_magic_t *lmagic;
55 nta_leg_t *leg;
56
58 nta_incoming_t *irq;
59
60 sip_method_t method;
61 char const *method_name;
62
63 int status;
64 char const *phrase;
65
66 msg_t *msg;
67 sip_t *sip;
68 } *events;
69} *s2;
70
71struct event *s2_nta_remove_event(struct event *e);
72void s2_nta_free_event(struct event *e);
73void s2_nta_flush_events(void);
74struct event *s2_nta_next_event(void);
75
76enum wait_for {
77 wait_for_amagic = 1,
78 wait_for_omagic,
79 wait_for_orq,
80 wait_for_lmagic,
81 wait_for_leg,
82 wait_for_imagic,
83 wait_for_irq,
84 wait_for_method,
85 wait_for_method_name,
86 wait_for_status,
87 wait_for_phrase
88};
89
90struct event *s2_nta_vwait_for(enum wait_for,
91 void const *value,
92 va_list va);
93
94struct event *s2_nta_wait_for(enum wait_for,
95 void const *value,
96 ...);
97
98int s2_nta_check_for(enum wait_for,
99 void const *value,
100 ...);
101
102int s2_nta_msg_callback(nta_agent_magic_t *magic,
103 nta_agent_t *nta,
104 msg_t *msg,
105 sip_t *sip);
106int s2_nta_orq_callback(nta_outgoing_magic_t *magic,
107 nta_outgoing_t *orq,
108 sip_t const *sip);
109int s2_nta_leg_callback(nta_leg_magic_t *magic,
110 nta_leg_t *leg,
111 nta_incoming_t *irq,
112 sip_t const *sip);
113int s2_nta_irq_callback(nta_incoming_magic_t *magic,
114 nta_incoming_t *irq,
115 sip_t const *sip);
116
117void s2_nta_setup_logs(int level);
118void s2_nta_setup(char const *label,
119 char const * const *transports,
120 tag_type_t tag, tag_value_t value, ...);
121
122nta_agent_t *s2_nta_agent_setup(url_string_t const *bind_url,
123 nta_message_f *callback,
124 nta_agent_magic_t *magic,
125 tag_type_t tag, tag_value_t value, ...);
126void s2_nta_teardown(void);
127
128TCase *check_nta_api_1_0(void);
129
130TCase *check_nta_client_2_0(void);
131TCase *check_nta_client_2_1(void);
132TCase *check_nta_client_2_2(void);
133
134TCase *check_nta_server_3_0(void);
135
136#endif
Nokia Transaction API for SIP.
NTA_AGENT_MAGIC_T nta_agent_magic_t
Application context for NTA agents.
Definition nta.h:89
NTA_INCOMING_MAGIC_T nta_incoming_magic_t
Application context for incoming NTA requests.
Definition nta.h:95
struct nta_leg_s nta_leg_t
NTA call leg.
Definition nta.h:57
struct nta_incoming_s nta_incoming_t
NTA incoming request.
Definition nta.h:61
NTA_LEG_MAGIC_T nta_leg_magic_t
Application context for NTA call legs.
Definition nta.h:91
struct nta_agent_s nta_agent_t
NTA agent.
Definition nta.h:55
struct nta_outgoing_s nta_outgoing_t
NTA outgoing request.
Definition nta.h:59
int nta_message_f(nta_agent_magic_t *context, nta_agent_t *agent, msg_t *msg, sip_t *sip)
Callback for incoming messages.
Definition nta.h:120
NTA_OUTGOING_MAGIC_T nta_outgoing_magic_t
Application context for outgoing NTA requests.
Definition nta.h:93
sip_method_t
SU_HOME_T su_home_t
intptr_t tag_value_t
struct tag_type_s const * tag_type_t
struct su_root_t su_root_t

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.