nta_tag.h 63.1 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7
/*
 * This file is part of the Sofia-SIP package
 *
 * Copyright (C) 2005 Nokia Corporation.
 *
 * Contact: Pekka Pessi <pekka.pessi@nokia.com>
 *
8
 * This library is free software; you can redistribute it and/or
Pekka Pessi's avatar
Pekka Pessi committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * 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
 *
 */

Pekka Pessi's avatar
Pekka Pessi committed
25 26
#ifndef NTA_TAG_H
/** Defined when <sofia-sip/nta_tag.h> has been included. */
Pekka Pessi's avatar
Pekka Pessi committed
27
#define NTA_TAG_H
Pekka Pessi's avatar
Pekka Pessi committed
28

Pekka Pessi's avatar
Pekka Pessi committed
29
/**@file sofia-sip/nta_tag.h   
Pekka Pessi's avatar
Pekka Pessi committed
30 31 32 33 34 35 36 37
 * @brief NTA tags
 *
 * @author Pekka Pessi <Pekka.Pessi@nokia.com>
 *
 * @date Created: Tue Sep  4 15:54:57 2001 ppessi
 */

#ifndef SU_TAG_H
38
#include <sofia-sip/su_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
39 40 41
#endif

#ifndef SIP_TAG_H
42
#include <sofia-sip/sip_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
43 44 45
#endif

#ifndef URL_TAG_H
46
#include <sofia-sip/url_tag.h>
Pekka Pessi's avatar
Pekka Pessi committed
47 48
#endif

49
SOFIA_BEGIN_DECLS
50

51 52 53
/** List of all nta tags. */
NTA_DLL extern tag_type_t nta_tag_list[];

54 55 56
/** Filter tag matching any nta tag. */
#define NTATAG_ANY()         ntatag_any, ((tag_value_t)0)
NTA_DLL extern tag_typedef_t ntatag_any;
Pekka Pessi's avatar
Pekka Pessi committed
57 58 59 60

/* Tags for parameters */

NTA_DLL extern tag_typedef_t ntatag_mclass;
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
/** Message class used by NTA. 
 *
 * The nta can use a custom or extended parser created with
 * msg_mclass_clone().
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    pointer to #msg_mclass_t.
 *
 * @par Values
 *    - custom or extended parser created with msg_mclass_clone()
 *    - NULL - use default parser
 *
 * @sa NTATAG_SIPFLAGS()
 */
80
#define NTATAG_MCLASS(x) ntatag_mclass, tag_cptr_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
81 82

NTA_DLL extern tag_typedef_t ntatag_mclass_ref;
83
#define NTATAG_MCLASS_REF(x) ntatag_mclass_ref, tag_cptr_vr(&(x), (x))
Pekka Pessi's avatar
Pekka Pessi committed
84 85 86 87 88

NTA_DLL extern tag_typedef_t ntatag_bad_req_mask;
/** Mask for bad request messages. 
 * 
 * If an incoming request has erroneous headers matching with the mask, nta
89 90 91 92 93
 * automatically returns a 400 Bad Message response to them. 
 *
 * If mask ~0U (all bits set) is specified, all requests with any bad header
 * are dropped. By default only the requests with bad headers essential for
 * request processing or proxying are dropped.
Pekka Pessi's avatar
Pekka Pessi committed
94
 * 
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - bitwise or of enum #sip_bad_mask values
 *
 * @sa enum #sip_bad_mask, NTATAG_BAD_RESP_MASK()
 *
 * @note
 * The following headers are considered essential by default:
 * - @ref sip_request \"request line\"", @From, @To, @CSeq, @CallID,
 *   @ContentLength, @Via, @ContentType, @ContentDisposition,
 *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
 *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires,
 *   @MinSE, @SIPEtag, and @SIPIfMatch.
 *  
Pekka Pessi's avatar
Pekka Pessi committed
116 117 118 119 120 121 122 123 124 125
 */
#define NTATAG_BAD_REQ_MASK(x) ntatag_bad_req_mask, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_bad_req_mask_ref;
#define NTATAG_BAD_REQ_MASK_REF(x) ntatag_bad_req_mask_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_bad_resp_mask;
/** Mask for bad response messages. 
 * 
 * If an incoming response has erroneous headers matching with the mask, nta
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
 * drops the response message. 
 *
 * If mask ~0U (all bits set) is specified, all responses with any bad header
 * are dropped. By default only the responses with bad headers essential for
 * response processing or proxying are dropped.
 * 
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - bitwise or of enum #sip_bad_mask values
 *
 * @sa enum #sip_bad_mask, NTATAG_BAD_REQ_MASK()
 *
 * @note
 * The following headers are considered essential by default:
 * - @ref sip_status \"status line\"", @From, @To, @CSeq, @CallID,
 *   @ContentLength, @Via, @ContentType, @ContentDisposition,
 *   @ContentEncoding, @Supported, @Contact, @Require, @RecordRoute, @RAck,
 *   @RSeq, @Event, @Expires, @SubscriptionState, @SessionExpires, 
 *   @MinSE, @SIPEtag, and @SIPIfMatch.
Pekka Pessi's avatar
Pekka Pessi committed
152 153 154 155 156 157 158
 */
#define NTATAG_BAD_RESP_MASK(x) ntatag_bad_resp_mask, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_bad_resp_mask_ref;
#define NTATAG_BAD_RESP_MASK_REF(x) ntatag_bad_resp_mask_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_default_proxy;
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
/** URL for (default) proxy.
 *
 * The requests are sent towards the <i>default outbound proxy</i> regardless
 * the values of request-URI or @Route headers in the request. The URL of
 * the default proxy is not added to the request in the @Route header or in
 * the request-URI (against the recommendation of @RFC3261 section 8.1.2).
 *
 * The outbound proxy set by NTATAG_DEFAULT_PROXY() is used even if the
 * dialog had an established route set or registration provided User-Agent
 * with a @ServiceRoute set.
 *
 * @par Used with
 *    nua_create(), nta_agent_create(), nta_agent_set_params() \n
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
 *
 * @par Parameter type
 *    Pointer to a url_t structure or a string containg a SIP or SIPS URI
 *
 * @par Values
 *    - Valid SIP or SIPS URI
 */
#define NTATAG_DEFAULT_PROXY(x) ntatag_default_proxy, urltag_url_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
182 183 184 185 186 187

NTA_DLL extern tag_typedef_t ntatag_default_proxy_ref;
#define NTATAG_DEFAULT_PROXY_REF(x) \
ntatag_default_proxy_ref, urltag_url_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_contact;
188 189
/** Contact used by NTA. */
#define NTATAG_CONTACT(x) ntatag_contact, siptag_contact_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
190 191 192 193 194 195

NTA_DLL extern tag_typedef_t ntatag_contact_ref;
#define NTATAG_CONTACT_REF(x) \
ntatag_contact_ref, siptag_contact_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_target;
196
/** Dialog target (contact) used by NTA. @HI */
Pekka Pessi's avatar
Pekka Pessi committed
197 198 199 200 201 202 203 204
#define NTATAG_TARGET(x) \
ntatag_target, siptag_contact_v((x))

NTA_DLL extern tag_typedef_t ntatag_target_ref;
#define NTATAG_TARGET_REF(x) \
ntatag_target_ref, siptag_contact_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_aliases;
205
/** Aliases used by NTA. @HI @deprecated */
Pekka Pessi's avatar
Pekka Pessi committed
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
#define NTATAG_ALIASES(x) \
ntatag_aliases, siptag_contact_v((x))

NTA_DLL extern tag_typedef_t ntatag_aliases_ref;
#define NTATAG_ALIASES_REF(x) \
ntatag_aliases_ref, siptag_contact_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_branch_key;
/** Branch key. @HI */
#define NTATAG_BRANCH_KEY(x) \
ntatag_branch_key, tag_str_v((x))

NTA_DLL extern tag_typedef_t ntatag_branch_key_ref;
#define NTATAG_BRANCH_KEY_REF(x) \
ntatag_branch_key_ref, tag_str_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_ack_branch;
/** Branch for ACKed transaction. @HI */
224
#define NTATAG_ACK_BRANCH(x) ntatag_ack_branch, tag_str_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
225 226

NTA_DLL extern tag_typedef_t ntatag_ack_branch_ref;
227
#define NTATAG_ACK_BRANCH_REF(x) ntatag_ack_branch_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
228 229

NTA_DLL extern tag_typedef_t ntatag_comp;
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
/** Compression algorithm. 
 *
 * Set compression algorithm for request as described in @RFC3486.
 *
 * @note This tag is has no effect without a compression plugin.
 *
 * @par Used with
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
 *
 * @par
 * Note that NTATAG_COMP(NULL) can be used with nta_incoming_set_params()
 * and nta_incoming_treply(), too. It indicates that the response is sent
 * uncompressed, no matter what the client has in @a comp parameter of @Via
 * header.
 *
 * @par Parameter type
 *    string
 *
 * @par Values
 *    - name of the compression algorithm ("sigcomp")
 *
 * @sa @RFC3320, @RFC3486, TPTAG_COMPARTMENT(),
 * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
 * NTATAG_SIGCOMP_CLOSE(), NTATAG_SIGCOMP_OPTIONS()
 */
#define NTATAG_COMP(x) ntatag_comp, tag_str_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
257 258

NTA_DLL extern tag_typedef_t ntatag_comp_ref;
259
#define NTATAG_COMP_REF(x) ntatag_comp_ref, tag_str_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289

NTA_DLL extern tag_typedef_t ntatag_msg;
/** Pass a SIP message to treply()/tcreate() functions. @HI */
#define NTATAG_MSG(x)     ntatag_msg, tag_ptr_v((x))

NTA_DLL extern tag_typedef_t ntatag_msg_ref;
#define NTATAG_MSG_REF(x) ntatag_msg_ref, tag_ptr_vr(&(x), (x))

NTA_DLL extern tag_typedef_t ntatag_tport;
/** Pass a transport object to msg_tsend/msg_treply. @HI */
#define NTATAG_TPORT(x)     ntatag_tport, tag_ptr_v((x))

NTA_DLL extern tag_typedef_t ntatag_tport_ref;
#define NTATAG_TPORT_REF(x) ntatag_tport_ref, tag_ptr_vr(&(x), (x))

NTA_DLL extern tag_typedef_t ntatag_remote_cseq;
/** Remote CSeq number. @HI */
#define NTATAG_REMOTE_CSEQ(x) ntatag_remote_cseq, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_remote_cseq_ref;
#define NTATAG_REMOTE_CSEQ_REF(x) ntatag_remote_cseq_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_smime;
/** Provide S/MIME context to NTA. @HI */
#define NTATAG_SMIME(x)     ntatag_smime, tag_ptr_v((x))

NTA_DLL extern tag_typedef_t ntatag_smime_ref;
#define NTATAG_SMIME_REF(x) ntatag_smime_ref, tag_ptr_vr(&(x), (x))
 
NTA_DLL extern tag_typedef_t ntatag_maxsize;
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
/** Maximum size of incoming message. @HI 
 *
 * If the size of an incoming request message would exceed the
 * given limit, the stack will automatically respond with <i>413 Request
 * Entity Too Large</i>.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    usize_t 
 *
 * @par Values
 *    - Maximum acceptable size of an incoming request message.
 *      Default value is 2 megabytes (2097152 bytes).
 *
 * @sa msg_maxsize()
 */
Pekka Pessi's avatar
Pekka Pessi committed
310
#define NTATAG_MAXSIZE(x) ntatag_maxsize, tag_usize_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
311 312

NTA_DLL extern tag_typedef_t ntatag_maxsize_ref;
Pekka Pessi's avatar
Pekka Pessi committed
313
#define NTATAG_MAXSIZE_REF(x) ntatag_maxsize_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
314 315

NTA_DLL extern tag_typedef_t ntatag_udp_mtu;
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
/** Maximum size of outgoing UDP request. @HI 
 *
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    
 *
 * @par Values
 *    - 
 *
 * @sa
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
333
#define NTATAG_UDP_MTU(x) ntatag_udp_mtu, tag_usize_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
334 335

NTA_DLL extern tag_typedef_t ntatag_udp_mtu_ref;
Pekka Pessi's avatar
Pekka Pessi committed
336
#define NTATAG_UDP_MTU_REF(x) ntatag_udp_mtu_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
337

338 339
NTA_DLL extern tag_typedef_t ntatag_max_forwards;
/** Default value for @MaxForwards header. 
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354
 *
 * The default value of @MaxForwards header added to the requests. The
 * initial value recommended by @RFC3261 is 70, but usually SIP proxies use
 * much lower default value, such as 24.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned
 *
 * @par Values
 *    - Default value added to the @MaxForwards header in the sent requests
355 356 357 358 359 360 361 362
 *
 * @since New in @VERSION_1_12_2.
 */
#define NTATAG_MAX_FORWARDS(x) ntatag_max_forwards, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_max_forwards_ref;
#define NTATAG_MAX_FORWARDS_REF(x) ntatag_max_forwards_ref, tag_uint_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
363
NTA_DLL extern tag_typedef_t ntatag_sip_t1;
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
/** Initial retransmission interval (in milliseconds) @HI 
 *
 * Set the T1 retransmission interval used by the SIP transaction engine. The
 * T1 is the initial duration used by request retransmission timers A and E
 * (UDP) as well as response retransmission timer G.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - Value of SIP T1 in milliseconds 
 *
381
 * @sa @RFC3261 appendix A, NTATAG_SIP_T1X4(), NTATAG_SIP_T1(), NTATAG_SIP_T4()
382
 */
Pekka Pessi's avatar
Pekka Pessi committed
383 384 385 386 387 388
#define NTATAG_SIP_T1(x) ntatag_sip_t1, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_sip_t1_ref;
#define NTATAG_SIP_T1_REF(x) ntatag_sip_t1_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sip_t1x64;
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
/** Transaction timeout (defaults to T1 * 64). @HI 
 *
 * Set the T1x64  timeout value used by the SIP transaction engine. The T1x64 is
 * duration used for timers B, F, H, and J (UDP) by the SIP transaction engine. 
 * The timeout value T1x64 can be adjusted separately from the initial
 * retransmission interval T1, which is set with NTATAG_SIP_T1().
 * 
 * The default value for T1x64 is 64 times value of T1, or 32000 milliseconds.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - Value of T1x64 in milliseconds
 *
409
 * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
410 411
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
412 413 414 415 416 417
#define NTATAG_SIP_T1X64(x) ntatag_sip_t1x64, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_sip_t1x64_ref;
#define NTATAG_SIP_T1X64_REF(x) ntatag_sip_t1x64_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sip_t2;
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
/** Maximum retransmission interval (in milliseconds) @HI 
 *
 * Set the maximum retransmission interval used by the SIP transaction
 * engine. The T2 is the maximum duration used for the timers E (UDP) and G
 * by the SIP transaction engine. Note that the timer A is not capped by T2. 
 * Retransmission interval of INVITE requests grows exponentially until the
 * timer B fires.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - Value of SIP T2 in milliseconds 
 *
437
 * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T4()
438
 */
Pekka Pessi's avatar
Pekka Pessi committed
439 440 441 442 443 444
#define NTATAG_SIP_T2(x) ntatag_sip_t2, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_sip_t2_ref;
#define NTATAG_SIP_T2_REF(x) ntatag_sip_t2_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sip_t4;
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
/** Transaction lifetime (in milliseconds) @HI 
 *
 * Set the lifetime for completed transactions used by the SIP transaction
 * engine. A completed transaction is kept around for the duration of T4 in
 * order to catch late responses. The T4 is the maximum duration for the
 * messages to stay in the network and the duration of SIP timer K.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    - Value of SIP T4 in milliseconds
 *
463
 * @sa @RFC3261 appendix A, NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2()
464
 */
Pekka Pessi's avatar
Pekka Pessi committed
465 466 467 468 469 470
#define NTATAG_SIP_T4(x)    ntatag_sip_t4, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_sip_t4_ref;
#define NTATAG_SIP_T4_REF(x) ntatag_sip_t4_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_progress;
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
/** Progress timer for User-Agents (interval for retranmitting 1XXs) @HI.
 *
 * The UAS should retransmit preliminary responses to the INVITE
 * transactions every minute in order to re-set the timer C within the
 * intermediate proxies.
 *
 * The default value for the progress timer is 60000.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    Value of progress timer in milliseconds.
 *
490 491
 * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8, NTATAG_TIMER_C(),
 * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
492
 */
Pekka Pessi's avatar
Pekka Pessi committed
493 494 495 496 497
#define NTATAG_PROGRESS(x)    ntatag_progress, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_progress_ref;
#define NTATAG_PROGRESS_REF(x) ntatag_progress_ref, tag_uint_vr(&(x))

498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
NTA_DLL extern tag_typedef_t ntatag_timer_c;
/** Value for timer C in milliseconds. @HI
 *
 * By default the INVITE transaction will not timeout after a preliminary
 * response has been received. However, an intermediate proxy can timeout
 * the transaction using timer C. Timer C is reset every time a response
 * belonging to the transaction is received.
 *
 * The default value for the timer C is 185000 milliseconds (3 minutes and 5
 * seconds). By default, timer C is not run on user agents (if NTATAG_UA(1)
 * without NTATAG_TIMER_C() is fgiven).
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int
 *
 * @par Values
 *    Value of SIP timer C in milliseconds. The default value is used
 *    instead if NTATAG_TIMER_C(0) is given.
 *
 * @sa @RFC3261 sections 13.3.1.1, 16.7 and 16.8,
 * NTATAG_UA(1), NTATAG_TIMER_C(),
 * NTATAG_SIP_T1(), NTATAG_SIP_T1X4(), NTATAG_SIP_T2(), NTATAG_SIP_T4()
 */
#define NTATAG_TIMER_C(x)    ntatag_timer_c, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_timer_c_ref;
#define NTATAG_TIMER_C_REF(x) ntatag_timer_c_ref, tag_uint_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
531
NTA_DLL extern tag_typedef_t ntatag_blacklist;
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
/** Add Retry-After header to internally-generated error messages. @HI 
 *
 * The NTATAG_BLACKLIST() provides a default value for @RetryAfter header
 * added to the internally generated responses such as <i>503 DNS Error</i>
 * or <i>408 Timeout</i>. The idea is that the application can retain its
 * current state and retry the operation after a while.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *     unsigned int
 *
 * @par Values
 *    - Value of @RetryAfter header (in seconds)
 *
 * @sa NTATAG_TIMEOUT_408()
 */
Pekka Pessi's avatar
Pekka Pessi committed
552 553 554 555 556 557 558 559
#define NTATAG_BLACKLIST(x)  ntatag_blacklist, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_blacklist_ref;
#define NTATAG_BLACKLIST_REF(x) ntatag_blacklist_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_debug_drop_prob;
/** Packet drop probability for debugging. 
 *
560
 * The packet drop probability parameter is useful mainly for debugging
561 562 563
 * purposes. The stack drops an incoming message received over an unreliable
 * transport (such as UDP) with the given probability. The range is in 0 .. 
 * 1000, 500 means p=0.5.
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned integer
 *
 * @par Values
 *    - Valid values are in range 0 ... 1000
 *    - Probablity to drop a given message is value / 1000.
 *
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
579 580 581 582 583 584
#define NTATAG_DEBUG_DROP_PROB(x) ntatag_debug_drop_prob, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_debug_drop_prob_ref;
#define NTATAG_DEBUG_DROP_PROB_REF(x) ntatag_debug_drop_prob_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_options;
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
/** Semicolon-separated SigComp options.
 *
 * @note This tag is has no effect without a SigComp plugin.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *    nta_agent_add_tport() \n
 *
 * @par Parameter type
 *    string 
 *
 * @par Values
 *    - semicolon-separated parameter-value pairs, passed to the SigComp plugin
 *
 * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
 * NTATAG_SIGCOMP_CLOSE(), @RFC3320
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
605 606 607 608 609 610
#define NTATAG_SIGCOMP_OPTIONS(x)    ntatag_sigcomp_options, tag_str_v((x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_options_ref;
#define NTATAG_SIGCOMP_OPTIONS_REF(x) ntatag_sigcomp_options_ref, tag_str_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_close;
611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
/** Close SigComp compartment after completing transaction.
 *
 * @note This tag is has no effect without a SigComp plugin.
 *
 * @par Used with
 *    nta_incoming_set_params(), nta_incoming_treply()
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tmcreate(), nta_outgoing_tcancel()
 *    nta_outgoing_prack(), nta_msg_tsend(), nta_msg_treply()
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - application takes care of compartment management
 *    - false - stack manages compartments
 *
 * @sa NTATAG_COMP(), TPTAG_COMPARTMENT(),
 * NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_AWARE(),
 * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
634 635 636 637 638 639
#define NTATAG_SIGCOMP_CLOSE(x)  ntatag_sigcomp_close, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_close_ref;
#define NTATAG_SIGCOMP_CLOSE_REF(x) ntatag_sigcomp_close_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_aware;
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
/** Indicate that the application is SigComp-aware. 
 *
 * @note This tag is has no effect without a SigComp plugin.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - application takes care of compartment management
 *    - false - stack manages compartments
 *
 * @sa NTATAG_COMP(), NTATAG_SIGCOMP_ALGORITHM(), NTATAG_SIGCOMP_CLOSE(),
 * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
 * 
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
662 663 664 665 666 667
#define NTATAG_SIGCOMP_AWARE(x) ntatag_sigcomp_aware, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_aware_ref;
#define NTATAG_SIGCOMP_AWARE_REF(x) ntatag_sigcomp_aware_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_algorithm;
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
/** Specify SigComp algorithm.  
 *
 * @note This tag is has no effect without a SigComp plugin.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *    nta_agent_add_tport() \n
 *
 * @par Parameter type
 *    string 
 *
 * @par Values
 *    - opaque string passed to the SigComp plugin
 *
 * @sa NTATAG_COMP(), NTATAG_SIGCOMP_AWARE(), NTATAG_SIGCOMP_CLOSE(),
 * NTATAG_SIGCOMP_OPTIONS(), @RFC3320
 * 
 * @HI
Pekka Pessi's avatar
Pekka Pessi committed
688 689 690 691 692 693 694 695
 */
#define NTATAG_SIGCOMP_ALGORITHM(x) ntatag_sigcomp_algorithm, tag_str_v((x))

NTA_DLL extern tag_typedef_t ntatag_sigcomp_algorithm_ref;
#define NTATAG_SIGCOMP_ALGORITHM_REF(x) \
ntatag_sigcomp_algorithm_ref, tag_str_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_ua;
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710
/** If true, NTA acts as User Agent Server or Client by default.
 *
 * When acting as an UA, the NTA stack will
 * - respond with 481 to a PRACK request with no matching "100rel" response
 * - check for out-of-order CSeq headers for each #nta_leg_t dialog object
 * - if NTATAG_MERGE_482(1) is also used, return <i>482 Request Merged</i> to
 *   a duplicate request with same @CallID, @CSeq, @From tag but different
 *   topmost @Via header (see @RFC3261 section 8.2.2.2 Merged Requests)
 * - silently discard duplicate final responses to INVITE
 * - retransmit preliminary responses (101..199) to INVITE request in regular
 *   intervals ("timer N2")
 * - retransmit 2XX response to INVITE request with exponential intervals 
 * - handle ACK sent in 2XX response to an INVITE using the
 *   #nta_ack_cancel_f callback bound to #nta_incoming_t with
 *   nta_incoming_bind()
711
 * - not use timer C unless its value has been explicitly set
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729
 *
 * @note This NUTAG_UA(1) is set internally by nua_create()
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - act as an UA 
 *    - false - act as an proxy 
 *
 * @sa NTATAG_MERGE_482()
 */
Pekka Pessi's avatar
Pekka Pessi committed
730 731 732 733 734 735
#define NTATAG_UA(x) ntatag_ua, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_ua_ref;
#define NTATAG_UA_REF(x) ntatag_ua_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_stateless;
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770
/** Enable stateless processing. @HI 
 *
 * @par Server side
 * The incoming requests are processed statefully if there is a default leg
 * (created with nta_leg_default()). This option is provided for proxies or
 * other server elements that process requests statelessly.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Values
 *    - true - do not pass incoming requests to default leg
 *    - false - pass incoming requests to default leg, if it exists
 *
 * @par Client side
 * The outgoing requests can be sent statelessly, too, if the
 * NTATAG_STATELESS(1) is included in the tag list of nta_outgoing_tcreate().
 *
 * @par Used with
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tcancel(), nta_outgoing_prack()
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - create only a transient #nta_outgoing_t transaction object
 *    - false - create an ordinary client transaction object
 *
 * @sa NTATAG_IS_UA(), nta_incoming_default(), nta_outgoing_default(),
 * nta_leg_default()
 */
Pekka Pessi's avatar
Pekka Pessi committed
771 772 773 774 775 776
#define NTATAG_STATELESS(x) ntatag_stateless, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_stateless_ref;
#define NTATAG_STATELESS_REF(x) ntatag_stateless_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_user_via;
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795
/** Allow application to insert Via headers. @HI 
 *
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - 
 *    - false - 
 *
 * @sa
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
796 797 798 799 800 801
#define NTATAG_USER_VIA(x) ntatag_user_via, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_user_via_ref;
#define NTATAG_USER_VIA_REF(x) ntatag_user_via_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_extra_100;
802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
/** Respond with "100 Trying" if application has not responded.
 *
 * As per recommended by @RFC4320, the stack can generate a 100 Trying
 * response to the non-INVITE requests if the application has not responded
 * to a request within half of the SIP T2 (the default value for T2 is 4000
 * milliseconds, so the extra <i>100 Trying<i/> would be sent after 2 seconds).
 *
 * @par Used with	
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - send extra 100 Trying if application does not respond
 *    - false - do not send 100 Trying (default)
 *
 * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_TIMEOUT_408()
 */
Pekka Pessi's avatar
Pekka Pessi committed
824 825 826 827 828 829
#define NTATAG_EXTRA_100(x)    ntatag_extra_100, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_extra_100_ref;
#define NTATAG_EXTRA_100_REF(x) ntatag_extra_100_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_pass_100;
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853
/** Pass "100 Trying" provisional answers to the application. @HI 
 *
 * By default, the stack silently processes the <i>100 Trying</i> responses
 * from the server. Usually the <i>100 Trying</i> responses are not
 * important to the application but rather sent by the outgoing proxy
 * immediately after it has received the request. However, the application
 * can ask nta for them by setting NTATAG_PASS_100(1) if, for instance, the
 * <i>100 Trying</i> responses are needed for user feedback.
 *
 * @par Used with
 *    nua_create(), nta_agent_create(), nta_agent_set_params() \n
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tcancel(), nta_outgoing_prack(), nta_msg_tsend()
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - pass <i>100 Trying</i> to application
 *    - false - silently process <i>100 Trying</i> responses
 *
 * @sa NTATAG_EXTRA_100(), NTATAG_DEFAULT_PROXY()
 */
Pekka Pessi's avatar
Pekka Pessi committed
854 855 856 857 858 859
#define NTATAG_PASS_100(x) ntatag_pass_100, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_pass_100_ref;
#define NTATAG_PASS_100_REF(x) ntatag_pass_100_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_timeout_408;
860 861
/** Generate "408 Request Timeout" response when request times out. @HI 
 *
862 863 864 865 866 867
 * This tag is used to prevent stack from generating extra 408 response
 * messages to non-INVITE requests upon timeout. As per recommended by
 * @RFC4320, the <i>408 Request Timeout</i> responses to non-INVITE
 * transaction are not sent over the network to the client by default. The
 * application can ask stack to pass the 408 responses with
 * NTATAG_PASS_408(1).
868 869 870 871 872 873 874 875 876 877 878
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
879 880 881
 *    - true - generate 408 response
 *    - false - invoke #nta_response_f callback with NULL sip pointer
 *              when a non-INVITE transaction times out
882
 *
883
 * @sa @RFC4320, NTATAG_PASS_408(), NTATAG_EXTRA_100(),
884
 */
Pekka Pessi's avatar
Pekka Pessi committed
885 886 887 888 889 890
#define NTATAG_TIMEOUT_408(x)  ntatag_timeout_408, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_timeout_408_ref;
#define NTATAG_TIMEOUT_408_REF(x) ntatag_timeout_408_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_pass_408;
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916
/** Pass "408 Request Timeout" responses to the client. @HI 
 *
 * As per recommended by @RFC4320, the <i>408 Request Timeout</i> responses
 * to non-INVITE transaction are not sent over the network to the client by
 * default. The application can ask stack to pass the 408 responses with
 * NTATAG_PASS_408(1). 
 *
 * Note that unlike NTATAG_PASS_100(), this tags changes the way server side
 * works.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - pass superfluous 408 responses 
 *    - false - discard superfluous 408 responses
 *
 * @sa @RFC4320, NTATAG_EXTRA_100(), NTATAG_TIMEOUT_408()
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
917 918 919 920 921 922 923 924 925 926 927 928 929
#define NTATAG_PASS_408(x)  ntatag_pass_408, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_pass_408_ref;
#define NTATAG_PASS_408_REF(x) ntatag_pass_408_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_no_dialog;
/** Create a leg without dialog. @HI */
#define NTATAG_NO_DIALOG(x)       ntatag_no_dialog, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_no_dialog_ref;
#define NTATAG_NO_DIALOG_REF(x)   ntatag_no_dialog_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_merge_482;
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962
/** Merge requests, send 482 to other requests. @HI 
 *
 * If an User-Agent receives a duplicate request with same @CallID, @CSeq,
 * @From tag but different topmost @Via header (see @RFC3261 section 8.2.2.2
 * Merged Requests), it should return <i>482 Request Merged</i> response to
 * the duplicate request. Such a duplicate request has been originally
 * generated by a forking proxy and usually routed via different route to
 * the User-Agent. The User-Agent should only respond meaningfully to the
 * first request and return the 482 response to the following forked
 * requests.
 *
 * Note that also NTATAG_UA(1) should be set before nta detects merges and
 * responds with 482 to them.
 *
 * @note If your application is an multi-lined user-agent, you may consider
 * disabling request merging. However, you have to somehow handle merging
 * within a single line.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - detect duplicate requests and respond with 482 to them
 *    - false - process duplicate requests separately
 *
 * @sa NTATAG_UA(1)
 */
Pekka Pessi's avatar
Pekka Pessi committed
963 964 965 966 967 968
#define NTATAG_MERGE_482(x)       ntatag_merge_482, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_merge_482_ref;
#define NTATAG_MERGE_482_REF(x)   ntatag_merge_482_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_cancel_2543;
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
/**Follow @RFC2543 semantics with CANCEL.
 *
 * By default, the nta follows "@RFC3261" semantics when CANCELing a
 * request. The CANCEL does not terminate transaction, rather, it is just a
 * hint to the server that it should respond immediately (with <i>487
 * Request Terminated</i> if it has no better response). Also, if the
 * original request was sent over unreliable transport such as UDP, the
 * CANCEL is delayed until the server has sent a preliminary response to the
 * original request.
 *
 * If NTATAG_CANCEL_2543(1) is given, the transaction is canceled
 * immediately internally (a 487 response is generated locally) and the
 * CANCEL request is sent without waiting for an provisional response.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *    nta_outgoing_tcancel()
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - follow "RFC 2543" semantics with CANCEL
 *    - false - follow "RFC 3261" semantics with CANCEL
 *
 * @sa NTATAG_CANCEL_408()
 * 
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
1001 1002 1003 1004 1005 1006
#define NTATAG_CANCEL_2543(x)     ntatag_cancel_2543, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_cancel_2543_ref;
#define NTATAG_CANCEL_2543_REF(x) ntatag_cancel_2543_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_cancel_408;
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026
/** Do not send a CANCEL but just timeout the request. 
 *
 * Calling nta_outgoing_tcancel() with this tag set marks request as
 * canceled but does not actually send a CANCEL request. If
 * NTATAG_CANCEL_2543(1) is also included, a 487 response is generated
 * internally.
 *
 * @par Used with
 *    nta_outgoing_tcancel() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - do not send CANCEL
 *    - false - let request to timeout
 *
 * @sa NTATAG_CANCEL_2543()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1027 1028 1029 1030 1031 1032
#define NTATAG_CANCEL_408(x)     ntatag_cancel_408, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_cancel_408_ref;
#define NTATAG_CANCEL_408_REF(x) ntatag_cancel_408_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_tag_3261;
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
/** When responding to requests, use unique tags. @HI 
 *
 * If set the UA would generate an unique @From/@To tag for all dialogs. If
 * unset UA would reuse same tag in order to make it easier to re-establish
 * dialog state after a reboot.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - use different tag for each dialog
 *    - false - use same tag for all dialogs
 *
 * @sa @RFC3261 section 12.2.2
 */
Pekka Pessi's avatar
Pekka Pessi committed
1054 1055 1056 1057 1058 1059
#define NTATAG_TAG_3261(x)        ntatag_tag_3261, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_tag_3261_ref;
#define NTATAG_TAG_3261_REF(x)    ntatag_tag_3261_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_use_timestamp;
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082
/** Use @Timestamp header. @HI 
 *
 * If set, a @Timestamp header would be added to stateful requests. The
 * header can be used to calculate the roundtrip transport latency between
 * client and server.
 *
 * @par Used with
 *    nua_create(), 
 *    nta_agent_create(),
 *    nta_agent_set_params(),
 *    nta_outgoing_mcreate(), nta_outgoing_tcreate(),
 *    nta_outgoing_tcancel(), and nta_outgoing_prack().
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - Add @Timestamp header
 *    - false - do not add @Timestamp header
 *
 * @sa @RFC3261 section 8.2.6
 */
Pekka Pessi's avatar
Pekka Pessi committed
1083 1084 1085 1086 1087 1088
#define NTATAG_USE_TIMESTAMP(x) ntatag_use_timestamp, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_use_timestamp_ref;
#define NTATAG_USE_TIMESTAMP_REF(x) ntatag_use_timestamp_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_method;
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103
/**Method name. @HI 
 *
 * Create a dialogless #nta_leg_t object matching only requests with
 * the specified method.
 *
 * @par Used with
 *   nta_leg_tcreate()
 *
 * @par Parameter type
 *    String containing method name.
 *
 * @par Values
 *    SIP method name (e.g., "SUBSCRIBE").
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
1104 1105 1106 1107 1108 1109
#define NTATAG_METHOD(x)          ntatag_method, tag_str_v((x))

NTA_DLL extern tag_typedef_t ntatag_method_ref;
#define NTATAG_METHOD_REF(x)      ntatag_method_ref, tag_str_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_cancel_487;
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139
/** When a CANCEL is received, automatically return 487 response to original request.
 *
 * When the CANCEL is received for an ongoing server transaction
 * #nta_incoming_t, the stack will automatically return a <i>487 Request
 * Terminated</i> response to the client after returning from the
 * #nta_incoming_f callback bound to the transaction with
 * nta_incoming_bind()
 * 
 * The application can delay sending the response to the original request
 * when NTATAG_CANCEL_408(0) is used. This is useful, for instance, with a
 * proxy that forwards the CANCEL downstream and the forwards the response
 * back to upstream.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - respond automatically to the CANCELed transaction
 *    - false - application takes care of responding
 *
 * @sa NTATAG_CANCEL_2543(), nta_incoming_bind()
 *
 * @HI
 */
Pekka Pessi's avatar
Pekka Pessi committed
1140 1141 1142 1143 1144 1145
#define NTATAG_CANCEL_487(x)     ntatag_cancel_487, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_cancel_487_ref;
#define NTATAG_CANCEL_487_REF(x) ntatag_cancel_487_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_rel100;
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164
/** Include rel100 in INVITE requests. @HI 
 *
 * Include feature tag "100rel" in @Supported header of the INVITE requests.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - include "100rel"
 *    - false - do not include "100rel"
 *
 * @sa nta_outgoing_prack(), nta_reliable_treply(), nta_reliable_mreply()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1165 1166 1167 1168 1169 1170
#define NTATAG_REL100(x)     ntatag_rel100, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_rel100_ref;
#define NTATAG_REL100_REF(x) ntatag_rel100_ref, tag_bool_vr(&(x))
 
NTA_DLL extern tag_typedef_t ntatag_sipflags;
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
/** Set SIP parser flags. @HI 
 *
 * The SIP parser flags affect how the messages are parsed and the result
 * presented to the application. They also control encoding of messages.
 * The most important flags are as follows:
 * - MSG_FLG_COMPACT - use compact form 
 *                     (single-letter header names, minimum whitespace)
 * - MSG_FLG_EXTRACT_COPY - cache printable copy of headers when parsing. 
 *   Using this flag can speed up proxy processing considerably. It is
 *   implied when the parsed messages are logged (because #TPORT_LOG
 *   environment variable is set, or TPTAG_LOG() is used.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned int 
 *
 * @par Values
 *    - Bitwise OR of SIP parser flags (enum #msg_flg_user)
 *
 * @sa NTATAG_PRELOAD(), enum #msg_flg_user, sip_s::sip_flags
 */
Pekka Pessi's avatar
Pekka Pessi committed
1196 1197 1198 1199 1200
#define NTATAG_SIPFLAGS(x)     ntatag_sipflags, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_sipflags_ref;
#define NTATAG_SIPFLAGS_REF(x) ntatag_sipflags_ref, tag_uint_vr(&(x))
 
1201
NTA_DLL extern tag_typedef_t ntatag_client_rport;
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
/** Enable client-side "rport". @HI 
 *
 * This tag controls @RFC3581 support on client side. The "rport" parameter
 * is used when the response has to be routed symmetrically through a NAT box.
 *
 * The client-side support involves just adding the "rport" parameter to the topmost
 * @Via header before the request is sent. 
 *
 * @note By default, the client "rport" is disabled when nta is used, and
 * enabled when nua is used.
 *
 * @par Used with
 *    nua_create() (nua uses NTATAG_CLIENT_RPORT(1) by default) \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - add "rport" parameter
 *    - false - do not add "rport" parameter
 *
 * @note The NTATAG_RPORT() is a synonym for this.
 *
 * @sa @RFC3581, NTATAG_SERVER_RPORT(), @Via
 */
1230
#define NTATAG_CLIENT_RPORT(x) ntatag_client_rport, tag_bool_v((x))
Pekka Pessi's avatar
Pekka Pessi committed
1231

1232 1233 1234 1235 1236
NTA_DLL extern tag_typedef_t ntatag_client_rport_ref;
#define NTATAG_CLIENT_RPORT_REF(x) ntatag_client_rport_ref, tag_bool_vr(&(x))

#define NTATAG_RPORT(x) ntatag_client_rport, tag_bool_v((x))
#define NTATAG_RPORT_REF(x) ntatag_client_rport_ref, tag_bool_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1237 1238

NTA_DLL extern tag_typedef_t ntatag_server_rport;
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
/** Use rport parameter at server.
 *
 * This tag controls @RFC3581 support on server side. The "rport" parameter
 * is used when the response has to be routed symmetrically through a NAT
 * box.
 *
 * If the topmost @Via header has an "rport" parameter, the server stores
 * the port number from which the request was sent in it. When sending the
 * response back to the client, the server uses the port number in the
 * "rport" parameter rather than the client-supplied port number in @Via
 * header.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - use "rport" parameter (default)
 *    - false - do not use "rport" parameterx
 *
 * @sa @RFC3581, NTATAG_CLIENT_RPORT(), @Via
 */
Pekka Pessi's avatar
Pekka Pessi committed
1266 1267 1268 1269 1270
#define NTATAG_SERVER_RPORT(x) ntatag_server_rport, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_server_rport_ref;
#define NTATAG_SERVER_RPORT_REF(x) ntatag_server_rport_ref, tag_bool_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
1271
NTA_DLL extern tag_typedef_t ntatag_tcp_rport;
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290
/** Use rport with TCP, too. @HI 
 *
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - 
 *    - false - 
 *
 * @sa
 *
 */
Pekka Pessi's avatar
Pekka Pessi committed
1291 1292 1293 1294 1295
#define NTATAG_TCP_RPORT(x) ntatag_tcp_rport, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_tcp_rport_ref;
#define NTATAG_TCP_RPORT_REF(x) ntatag_tcp_rport_ref, tag_bool_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
1296
NTA_DLL extern tag_typedef_t ntatag_preload;
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318
/** Preload by N bytes. @HI 
 *
 * When the memory block is allocated for an incoming request by the stack,
 * the stack can allocate some extra memory for the parser in addition to
 * the memory used by the actual message contents. 
 * 
 * While wasting some memory, this can speed up parsing considerably.
 * Recommended amount of preloading per packet is 1500 bytes.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    unsigned
 *
 * @par Values
 *    Amount of extra per-message memory allocated for parser.
 *
 * @sa NTATAG_SIPFLAGS() and #MSG_FLG_EXTRACT_COPY
 */
Pekka Pessi's avatar
Pekka Pessi committed
1319 1320 1321 1322 1323 1324
#define NTATAG_PRELOAD(x) ntatag_preload, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_preload_ref;
#define NTATAG_PRELOAD_REF(x) ntatag_preload_ref, tag_uint_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_use_naptr;
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346
/** If true, try to use NAPTR records when resolving. @HI 
 *
 * The application can disable NTA from using NAPTR records when resolving
 * SIP URIs.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - enable NAPTR resolving
 *    - false - disable NAPTR resolving
 *
 * @bug NAPTRs are not used with SIPS URIs in any case.
 *
 * @sa @RFC3263, NTATAG_USE_SRV()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1347 1348 1349 1350 1351 1352
#define NTATAG_USE_NAPTR(x) ntatag_use_naptr, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_use_naptr_ref;
#define NTATAG_USE_NAPTR_REF(x) ntatag_use_naptr_ref, tag_bool_vr(&(x))

NTA_DLL extern tag_typedef_t ntatag_use_srv;
1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372
/** If true, try to use SRV records when resolving.
 *
 * The application can disable NTA from using SRV records when resolving
 * SIP URIs.
 *
 * @par Used with
 *    nua_create() \n
 *    nta_agent_create() \n
 *    nta_agent_set_params() \n
 *
 * @par Parameter type
 *    boolean: true (non-zero or non-NULL pointer)
 *          or false (zero or NULL pointer)
 *
 * @par Values
 *    - true - enable SRV resolving
 *    - false - disable SRV resolving
 *
 * @sa @RFC3263, NTATAG_USE_NAPTR()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1373 1374 1375 1376 1377
#define NTATAG_USE_SRV(x) ntatag_use_srv, tag_bool_v((x))

NTA_DLL extern tag_typedef_t ntatag_use_srv_ref;
#define NTATAG_USE_SRV_REF(x) ntatag_use_srv_ref, tag_bool_vr(&(x))

1378
NTA_DLL extern tag_typedef_t ntatag_rseq;
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390

/** @RSeq value for nta_outgoing_prack(). @HI 
 *
 * @par Used with
 *    nta_outgoing_prack()
 *
 * @par Parameter type
 *    @c unsigned @c int
 *
 * @par Values
 *    Response sequence number from the @RSeq header.
*/
1391 1392 1393 1394 1395
#define NTATAG_RSEQ(x)    ntatag_rseq, tag_uint_v((x))

NTA_DLL extern tag_typedef_t ntatag_rseq_ref;
#define NTATAG_RSEQ_REF(x) ntatag_rseq_ref, tag_uint_vr(&(x))

Pekka Pessi's avatar
Pekka Pessi committed
1396 1397 1398 1399
/* ====================================================================== */
/* Tags for statistics. */

NTA_DLL extern tag_typedef_t ntatag_s_irq_hash;
Michael Jerris's avatar
Michael Jerris committed
1400
#define NTATAG_S_IRQ_HASH(x) ntatag_s_irq_hash, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1401 1402

NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_ref;
1403 1404 1405 1406 1407 1408 1409 1410
/** Get size of hash table for server-side transactions.
 *
 * Return number of transactions that fit in the hash table for server-side
 * transactions.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_USED_REF(),
 * NTATAG_S_ORQ_HASH_REFxs(), NTATAG_S_LEG_HASH_REF()
 */
Michael Jerris's avatar
Michael Jerris committed
1411
#define NTATAG_S_IRQ_HASH_REF(x) ntatag_s_irq_hash_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1412 1413

NTA_DLL extern tag_typedef_t ntatag_s_orq_hash;
Michael Jerris's avatar
Michael Jerris committed
1414
#define NTATAG_S_ORQ_HASH(x) ntatag_s_orq_hash, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1415 1416

NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_ref;
1417 1418 1419 1420 1421 1422 1423 1424
/** Get size of hash table for client-side transactions.
 *
 * Return number of transactions that fit in the hash table for client-side
 * transactions.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_USED_REF(),
 * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_LEG_HASH_REF()
 */
Michael Jerris's avatar
Michael Jerris committed
1425
#define NTATAG_S_ORQ_HASH_REF(x) ntatag_s_orq_hash_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1426 1427

NTA_DLL extern tag_typedef_t ntatag_s_leg_hash;
Michael Jerris's avatar
Michael Jerris committed
1428
#define NTATAG_S_LEG_HASH(x) ntatag_s_leg_hash, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1429 1430

NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_ref;
1431 1432 1433 1434 1435 1436 1437
/** Get size of hash table for dialogs.
 *
 * Return number of dialog objects that fit in the hash table for dialogs.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_USED_REF(),
 * NTATAG_S_IRQ_HASH_REF(), NTATAG_S_ORQ_HASH_REF()
 */
Michael Jerris's avatar
Michael Jerris committed
1438
#define NTATAG_S_LEG_HASH_REF(x) ntatag_s_leg_hash_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1439 1440

NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_used;
Michael Jerris's avatar
Michael Jerris committed
1441
#define NTATAG_S_IRQ_HASH_USED(x) ntatag_s_irq_hash_used, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1442 1443

NTA_DLL extern tag_typedef_t ntatag_s_irq_hash_used_ref;
1444 1445 1446 1447 1448 1449 1450 1451 1452
/** Get number of server-side transactions in the hash table.
 *
 * Return number of server-side transactions objects in the hash table. The
 * number includes all transactions destroyed by the application which have
 * not expired yet.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_IRQ_HASH_REF(),
 * NTATAG_S_ORQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1453
#define NTATAG_S_IRQ_HASH_USED_REF(x) \
Michael Jerris's avatar
Michael Jerris committed
1454
ntatag_s_irq_hash_used_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1455 1456

NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_used;
Michael Jerris's avatar
Michael Jerris committed
1457
#define NTATAG_S_ORQ_HASH_USED(x) ntatag_s_orq_hash_used, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1458 1459

NTA_DLL extern tag_typedef_t ntatag_s_orq_hash_used_ref;
1460 1461 1462 1463 1464 1465 1466 1467 1468
/** Get number of client-side transactions in the hash table.
 *
 * Return number of client-side transactions objects in the hash table. The
 * number includes all transactions destroyed by the application which have
 * not expired yet.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_ORQ_HASH_REF(),
 * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_LEG_HASH_USED_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1469
#define NTATAG_S_ORQ_HASH_USED_REF(x) \
Michael Jerris's avatar
Michael Jerris committed
1470
ntatag_s_orq_hash_used_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1471 1472

NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_used;
Michael Jerris's avatar
Michael Jerris committed
1473
#define NTATAG_S_LEG_HASH_USED(x) ntatag_s_leg_hash_used, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1474 1475

NTA_DLL extern tag_typedef_t ntatag_s_leg_hash_used_ref;
1476 1477 1478 1479 1480 1481 1482 1483 1484
/** Get number of dialogs in the hash table.
 *
 * Return number of dialog objects in the hash table. Note that the
 * nta_leg_t objects created with NTATAG_NO_DIALOG(1) and this not
 * corresponding to a dialog are not included in the number.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_LEG_HASH_REF(),
 * NTATAG_S_IRQ_HASH_USED_REF(), NTATAG_S_ORQ_HASH_USED_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1485
#define NTATAG_S_LEG_HASH_USED_REF(x) \
Michael Jerris's avatar
Michael Jerris committed
1486
ntatag_s_leg_hash_used_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1487 1488

NTA_DLL extern tag_typedef_t ntatag_s_recv_msg;
1489
#define NTATAG_S_RECV_MSG(x) ntatag_s_recv_msg, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1490 1491

NTA_DLL extern tag_typedef_t ntatag_s_recv_msg_ref;
1492 1493 1494 1495 1496 1497 1498 1499
/** Get number of SIP messages received.
 *
 * Return number SIP messages that has been received.  The number includes
 * also bad and unparsable messages.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
 * NTATAG_S_RECV_REQUEST_REF(), NTATAG_S_RECV_RESPONSE_REF()
 */
1500
#define NTATAG_S_RECV_MSG_REF(x) ntatag_s_recv_msg_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1501 1502

NTA_DLL extern tag_typedef_t ntatag_s_recv_request;
1503
#define NTATAG_S_RECV_REQUEST(x) ntatag_s_recv_request, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1504 1505

NTA_DLL extern tag_typedef_t ntatag_s_recv_request_ref;
1506 1507 1508 1509 1510 1511 1512 1513
/** Get number of SIP requests received.
 *
 * Return number SIP requests that has been received. The number includes
 * also number of bad requests available with NTATAG_S_BAD_REQUEST_REF().
 *
 * @sa nta_agent_get_stats(), NTATAG_S_BAD_REQUEST_REF(),
 * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_RESPONSE_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1514
#define NTATAG_S_RECV_REQUEST_REF(x)\
1515
 ntatag_s_recv_request_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1516 1517

NTA_DLL extern tag_typedef_t ntatag_s_recv_response;
1518
#define NTATAG_S_RECV_RESPONSE(x) ntatag_s_recv_response, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1519 1520

NTA_DLL extern tag_typedef_t ntatag_s_recv_response_ref;
1521 1522 1523 1524 1525 1526 1527 1528 1529
/** Get number of SIP responses received.
 *
 * Return number SIP responses that has been received. The number includes
 * also number of bad and unusable responses available with
 * NTATAG_S_BAD_RESPONSE_REF().
 *
 * @sa nta_agent_get_stats(), NTATAG_S_BAD_RESPONSE_REF(),
 * NTATAG_S_RECV_MSG_REF(), NTATAG_S_RECV_REQUEST_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1530
#define NTATAG_S_RECV_RESPONSE_REF(x)\
1531
 ntatag_s_recv_response_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1532 1533

NTA_DLL extern tag_typedef_t ntatag_s_bad_message;
1534
#define NTATAG_S_BAD_MESSAGE(x) ntatag_s_bad_message, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1535 1536

NTA_DLL extern tag_typedef_t ntatag_s_bad_message_ref;
1537 1538 1539 1540 1541 1542 1543
/** Get number of bad SIP messages received.
 *
 * Return number of bad SIP messages that has been received.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_RECV_MSG_REF(), 
 * NTATAG_S_BAD_REQUEST_REF(), NTATAG_S_BAD_RESPONSE_REF().
 */
Pekka Pessi's avatar
Pekka Pessi committed
1544
#define NTATAG_S_BAD_MESSAGE_REF(x)\
1545
 ntatag_s_bad_message_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1546 1547

NTA_DLL extern tag_typedef_t ntatag_s_bad_request;
1548
#define NTATAG_S_BAD_REQUEST(x) ntatag_s_bad_request, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1549 1550

NTA_DLL extern tag_typedef_t ntatag_s_bad_request_ref;
1551 1552 1553 1554 1555 1556 1557
/** Get number of bad SIP requests received.
 *
 * Return number of bad SIP requests that has been received.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
 * NTATAG_S_BAD_RESPONSE_REF().
 */
Pekka Pessi's avatar
Pekka Pessi committed
1558
#define NTATAG_S_BAD_REQUEST_REF(x)\
1559
 ntatag_s_bad_request_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1560 1561

NTA_DLL extern tag_typedef_t ntatag_s_bad_response;
1562
#define NTATAG_S_BAD_RESPONSE(x) ntatag_s_bad_response, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1563 1564

NTA_DLL extern tag_typedef_t ntatag_s_bad_response_ref;
1565 1566 1567 1568 1569 1570 1571
/** Get number of bad SIP responses received.
 *
 * Return number of bad SIP responses that has been received.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_BAD_MESSAGE_REF(),
 * NTATAG_S_BAD_REQUEST_REF()
 */
Pekka Pessi's avatar
Pekka Pessi committed
1572
#define NTATAG_S_BAD_RESPONSE_REF(x)\
1573
 ntatag_s_bad_response_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1574 1575

NTA_DLL extern tag_typedef_t ntatag_s_drop_request;
1576
#define NTATAG_S_DROP_REQUEST(x) ntatag_s_drop_request, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1577 1578

NTA_DLL extern tag_typedef_t ntatag_s_drop_request_ref;
1579 1580 1581 1582 1583 1584 1585 1586 1587 1588
/** Get number of SIP requests dropped.
 *
 * Return number of SIP requests that has been randomly dropped after
 * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
 *
 * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
 * NTATAG_S_DROP_RESPONSE_REF()
 * 
 * @note The value was not calculated before @VERSION_1_12_7.
 */
Pekka Pessi's avatar
Pekka Pessi committed
1589
#define NTATAG_S_DROP_REQUEST_REF(x)\
1590
 ntatag_s_drop_request_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1591 1592

NTA_DLL extern tag_typedef_t ntatag_s_drop_response;
1593
#define NTATAG_S_DROP_RESPONSE(x) ntatag_s_drop_response, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1594 1595

NTA_DLL extern tag_typedef_t ntatag_s_drop_response_ref;
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
/** Get number of SIP responses dropped.
 *
 * Return number of SIP responses that has been randomly dropped after
 * receiving them because of NTATAG_DEBUG_DROP_PROB() has been set.
 *
 * @sa nta_agent_get_stats(), NTATAG_DEBUG_DROP_PROB(),
 * NTATAG_S_DROP_REQUEST_REF()
 * 
 * @note The value was not calculated before @VERSION_1_12_7.
 */
Pekka Pessi's avatar
Pekka Pessi committed
1606
#define NTATAG_S_DROP_RESPONSE_REF(x)\
1607
 ntatag_s_drop_response_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1608 1609

NTA_DLL extern tag_typedef_t ntatag_s_client_tr;
1610
#define NTATAG_S_CLIENT_TR(x) ntatag_s_client_tr, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1611 1612

NTA_DLL extern tag_typedef_t ntatag_s_client_tr_ref;
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
/** Get number of client transactions created.
 *
 * Return number of client transactions created. The number also includes
 * client transactions with which stack failed to send the request because
 * the DNS resolving failed or the transport failed.
 *
 * @note The number include stateless requests sent with nta_msg_tsend(),
 * too.
 *
 * @sa nta_agent_get_stats(), NTATAG_S_SENT_REQUEST_REF(),
 * NTATAG_S_SERVER_TR_REF().
 */
Pekka Pessi's avatar
Pekka Pessi committed
1625
#define NTATAG_S_CLIENT_TR_REF(x)\
1626
 ntatag_s_client_tr_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1627 1628

NTA_DLL extern tag_typedef_t ntatag_s_server_tr;
1629
#define NTATAG_S_SERVER_TR(x) ntatag_s_server_tr, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed
1630 1631

NTA_DLL extern tag_typedef_t ntatag_s_server_tr_ref;
1632 1633 1634 1635 1636 1637 1638
/** Get number of server transactions created.
 *
 * Return number of server transactions created. 
 *
 * @sa nta_agent_get_stats(), NTATAG_S_RECV_RESPONSE_REF(),
 * NTATAG_S_CLIENT_TR_REF(), NTATAG_S_DIALOG_TR_REF(),
 */
Pekka Pessi's avatar
Pekka Pessi committed
1639
#define NTATAG_S_SERVER_TR_REF(x)\
1640
 ntatag_s_server_tr_ref, tag_usize_vr(&(x))
Pekka Pessi's avatar
Pekka Pessi committed
1641 1642

NTA_DLL extern tag_typedef_t ntatag_s_dialog_tr;
1643
#define NTATAG_S_DIALOG_TR(x) ntatag_s_dialog_tr, tag_usize_v(x)
Pekka Pessi's avatar
Pekka Pessi committed