mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 22:58:21 +00:00
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r353321 | alecdavis | 2012-01-31 11:16:22 +1300 (Tue, 31 Jan 2012) | 25 lines Merged revisions 353320 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r353320 | alecdavis | 2012-01-31 10:57:49 +1300 (Tue, 31 Jan 2012) | 18 lines RFC3261 Section 8.1.1.5. The sequence number value MUST be expressible as a 32-bit unsigned integer * fix: use %u instead of %d when dealing with CSeq numbers - to remove possibility of -ve numbers. * fix: change all uses of seqno and friends (ocseq icseq) from 'int' or 'unsigned int' to uint32_t. Summary of CSeq numbers. An initial CSeq number must be less than 2^31 A CSeq number can increase in value up to 2^32-1 An incrementing CSeq number must not wrap around to 0. Tested with Asterisk 1.8.8.2 with Grandstream phones. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1699/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
80 lines
2.9 KiB
C
80 lines
2.9 KiB
C
/*
|
|
* Asterisk -- An open source telephony toolkit.
|
|
*
|
|
* Copyright (C) 2010, Digium, Inc.
|
|
*
|
|
* See http://www.asterisk.org for more information about
|
|
* the Asterisk project. Please do not directly contact
|
|
* any of the maintainers of this project for assistance;
|
|
* the project provides a web site, mailing lists and IRC
|
|
* channels for your use.
|
|
*
|
|
* This program is free software, distributed under the terms of
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
* at the top of the source tree.
|
|
*/
|
|
|
|
/*!
|
|
* \file
|
|
* \brief sip dialog management header file
|
|
*/
|
|
|
|
#include "sip.h"
|
|
|
|
#ifndef _SIP_DIALOG_H
|
|
#define _SIP_DIALOG_H
|
|
|
|
/*! \brief
|
|
* when we create or delete references, make sure to use these
|
|
* functions so we keep track of the refcounts.
|
|
* To simplify the code, we allow a NULL to be passed to dialog_unref().
|
|
*/
|
|
#define dialog_ref(arg1,arg2) dialog_ref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
|
#define dialog_unref(arg1,arg2) dialog_unref_debug((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
|
|
struct sip_pvt *dialog_ref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func);
|
|
struct sip_pvt *dialog_unref_debug(struct sip_pvt *p, const char *tag, char *file, int line, const char *func);
|
|
|
|
struct sip_pvt *sip_alloc(ast_string_field callid, struct ast_sockaddr *sin,
|
|
int useglobal_nat, const int intended_method, struct sip_request *req);
|
|
void sip_scheddestroy_final(struct sip_pvt *p, int ms);
|
|
void sip_scheddestroy(struct sip_pvt *p, int ms);
|
|
int sip_cancel_destroy(struct sip_pvt *p);
|
|
|
|
/*! \brief Destroy SIP call structure.
|
|
* Make it return NULL so the caller can do things like
|
|
* foo = sip_destroy(foo);
|
|
* and reduce the chance of bugs due to dangling pointers.
|
|
*/
|
|
struct sip_pvt *sip_destroy(struct sip_pvt *p);
|
|
|
|
/*! \brief Destroy SIP call structure.
|
|
* Make it return NULL so the caller can do things like
|
|
* foo = sip_destroy(foo);
|
|
* and reduce the chance of bugs due to dangling pointers.
|
|
*/
|
|
void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist);
|
|
/*!
|
|
* \brief Unlink a dialog from the dialogs container, as well as any other places
|
|
* that it may be currently stored.
|
|
*
|
|
* \note A reference to the dialog must be held before calling
|
|
* this function, and this function does not release that
|
|
* reference.
|
|
*
|
|
* \note The dialog must not be locked when called.
|
|
*/
|
|
void dialog_unlink_all(struct sip_pvt *dialog);
|
|
|
|
/*! \brief Acknowledges receipt of a packet and stops retransmission
|
|
* called with p locked*/
|
|
int __sip_ack(struct sip_pvt *p, uint32_t seqno, int resp, int sipmethod);
|
|
|
|
/*! \brief Pretend to ack all packets
|
|
* called with p locked */
|
|
void __sip_pretend_ack(struct sip_pvt *p);
|
|
|
|
/*! \brief Acks receipt of packet, keep it around (used for provisional responses) */
|
|
int __sip_semi_ack(struct sip_pvt *p, uint32_t seqno, int resp, int sipmethod);
|
|
|
|
#endif /* defined(_SIP_DIALOG_H) */
|