[asterisk-commits] dvossel: branch dvossel/sip_string_parse_testing r244056 - in /team/dvossel/s...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jan 30 00:07:48 CST 2010
Author: dvossel
Date: Sat Jan 30 00:07:44 2010
New Revision: 244056
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244056
Log:
correct some formatting
Modified:
team/dvossel/sip_string_parse_testing/channels/chan_sip.c
team/dvossel/sip_string_parse_testing/channels/sip/sip.h
Modified: team/dvossel/sip_string_parse_testing/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_string_parse_testing/channels/chan_sip.c?view=diff&rev=244056&r1=244055&r2=244056
==============================================================================
--- team/dvossel/sip_string_parse_testing/channels/chan_sip.c (original)
+++ team/dvossel/sip_string_parse_testing/channels/chan_sip.c Sat Jan 30 00:07:44 2010
@@ -552,13 +552,13 @@
.resync_threshold = -1,
.impl = ""
};
-static struct ast_jb_conf global_jbconf; /*!< Global jitterbuffer configuration */
-
-static const char config[] = "sip.conf"; /*!< Main configuration file */
-static const char notify_config[] = "sip_notify.conf"; /*!< Configuration file for sending Notify with CLI commands to reconfigure or reboot phones */
+static struct ast_jb_conf global_jbconf; /*!< Global jitterbuffer configuration */
+
+static const char config[] = "sip.conf"; /*!< Main configuration file */
+static const char notify_config[] = "sip_notify.conf"; /*!< Configuration file for sending Notify with CLI commands to reconfigure or reboot phones */
/*! \brief Readable descriptions of device states.
- \note Should be aligned to above table as index */
+ * \note Should be aligned to above table as index */
static const struct invstate2stringtable {
const enum invitestates state;
const char *desc;
@@ -574,10 +574,10 @@
};
/*! \brief Subscription types that we support. We support
- - dialoginfo updates (really device status, not dialog info as was the original intent of the standard)
- - SIMPLE presence used for device status
- - Voicemail notification subscriptions
-*/
+ * - dialoginfo updates (really device status, not dialog info as was the original intent of the standard)
+ * - SIMPLE presence used for device status
+ * - Voicemail notification subscriptions
+ */
static const struct cfsubscription_types {
enum subscriptiontype type;
const char * const event;
@@ -594,42 +594,41 @@
};
/*! \brief The core structure to setup dialogs. We parse incoming messages by using
- structure and then route the messages according to the type.
-
- \note Note that sip_methods[i].id == i must hold or the code breaks */
+ * structure and then route the messages according to the type.
+ *
+ * \note Note that sip_methods[i].id == i must hold or the code breaks
+ */
static const struct cfsip_methods {
enum sipmethod id;
int need_rtp; /*!< when this is the 'primary' use for a pvt structure, does it need RTP? */
char * const text;
enum can_create_dialog can_create;
} sip_methods[] = {
- { SIP_UNKNOWN, RTP, "-UNKNOWN-", CAN_CREATE_DIALOG },
- { SIP_RESPONSE, NO_RTP, "SIP/2.0", CAN_NOT_CREATE_DIALOG },
- { SIP_REGISTER, NO_RTP, "REGISTER", CAN_CREATE_DIALOG },
- { SIP_OPTIONS, NO_RTP, "OPTIONS", CAN_CREATE_DIALOG },
- { SIP_NOTIFY, NO_RTP, "NOTIFY", CAN_CREATE_DIALOG },
- { SIP_INVITE, RTP, "INVITE", CAN_CREATE_DIALOG },
- { SIP_ACK, NO_RTP, "ACK", CAN_NOT_CREATE_DIALOG },
- { SIP_PRACK, NO_RTP, "PRACK", CAN_NOT_CREATE_DIALOG },
- { SIP_BYE, NO_RTP, "BYE", CAN_NOT_CREATE_DIALOG },
- { SIP_REFER, NO_RTP, "REFER", CAN_CREATE_DIALOG },
- { SIP_SUBSCRIBE, NO_RTP, "SUBSCRIBE", CAN_CREATE_DIALOG },
- { SIP_MESSAGE, NO_RTP, "MESSAGE", CAN_CREATE_DIALOG },
- { SIP_UPDATE, NO_RTP, "UPDATE", CAN_NOT_CREATE_DIALOG },
- { SIP_INFO, NO_RTP, "INFO", CAN_NOT_CREATE_DIALOG },
- { SIP_CANCEL, NO_RTP, "CANCEL", CAN_NOT_CREATE_DIALOG },
- { SIP_PUBLISH, NO_RTP, "PUBLISH", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD },
- { SIP_PING, NO_RTP, "PING", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD }
+ { SIP_UNKNOWN, RTP, "-UNKNOWN-",CAN_CREATE_DIALOG },
+ { SIP_RESPONSE, NO_RTP, "SIP/2.0", CAN_NOT_CREATE_DIALOG },
+ { SIP_REGISTER, NO_RTP, "REGISTER", CAN_CREATE_DIALOG },
+ { SIP_OPTIONS, NO_RTP, "OPTIONS", CAN_CREATE_DIALOG },
+ { SIP_NOTIFY, NO_RTP, "NOTIFY", CAN_CREATE_DIALOG },
+ { SIP_INVITE, RTP, "INVITE", CAN_CREATE_DIALOG },
+ { SIP_ACK, NO_RTP, "ACK", CAN_NOT_CREATE_DIALOG },
+ { SIP_PRACK, NO_RTP, "PRACK", CAN_NOT_CREATE_DIALOG },
+ { SIP_BYE, NO_RTP, "BYE", CAN_NOT_CREATE_DIALOG },
+ { SIP_REFER, NO_RTP, "REFER", CAN_CREATE_DIALOG },
+ { SIP_SUBSCRIBE, NO_RTP, "SUBSCRIBE",CAN_CREATE_DIALOG },
+ { SIP_MESSAGE, NO_RTP, "MESSAGE", CAN_CREATE_DIALOG },
+ { SIP_UPDATE, NO_RTP, "UPDATE", CAN_NOT_CREATE_DIALOG },
+ { SIP_INFO, NO_RTP, "INFO", CAN_NOT_CREATE_DIALOG },
+ { SIP_CANCEL, NO_RTP, "CANCEL", CAN_NOT_CREATE_DIALOG },
+ { SIP_PUBLISH, NO_RTP, "PUBLISH", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD },
+ { SIP_PING, NO_RTP, "PING", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD }
};
-
-static unsigned int chan_idx;
/*! \brief List of well-known SIP options. If we get this in a require,
we should check the list and answer accordingly. */
static const struct cfsip_options {
- int id; /*!< Bitmap ID */
- int supported; /*!< Supported by Asterisk ? */
- char * const text; /*!< Text id, as in standard */
+ int id; /*!< Bitmap ID */
+ int supported; /*!< Supported by Asterisk ? */
+ char * const text; /*!< Text id, as in standard */
} sip_options[] = { /* XXX used in 3 places */
/* RFC3262: PRACK 100% reliability */
{ SIP_OPT_100REL, NOT_SUPPORTED, "100rel" },
@@ -735,58 +734,57 @@
ast_uri_decode(str); \
} \
-static int global_match_auth_username; /*!< Match auth username if available instead of From: Default off. */
-
-static int global_relaxdtmf; /*!< Relax DTMF */
-static int global_prematuremediafilter; /*!< Enable/disable premature frames in a call (causing 183 early media) */
-static int global_rtptimeout; /*!< Time out call if no RTP */
-static int global_rtpholdtimeout; /*!< Time out call if no RTP during hold */
-static int global_rtpkeepalive; /*!< Send RTP keepalives */
-static int global_reg_timeout; /*!< Global time between attempts for outbound registrations */
-static int global_regattempts_max; /*!< Registration attempts before giving up */
-static int global_shrinkcallerid; /*!< enable or disable shrinking of caller id */
-static int global_callcounter; /*!< Enable call counters for all devices. This is currently enabled by setting the peer
- call-limit to INT_MAX. When we remove the call-limit from the code, we can make it
- with just a boolean flag in the device structure */
-static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
-static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
-static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
-static unsigned int global_tos_text; /*!< IP type of service for text RTP packets */
-static unsigned int global_cos_sip; /*!< 802.1p class of service for SIP packets */
-static unsigned int global_cos_audio; /*!< 802.1p class of service for audio RTP packets */
-static unsigned int global_cos_video; /*!< 802.1p class of service for video RTP packets */
-static unsigned int global_cos_text; /*!< 802.1p class of service for text RTP packets */
-static unsigned int recordhistory; /*!< Record SIP history. Off by default */
-static unsigned int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
-static char global_useragent[AST_MAX_EXTENSION]; /*!< Useragent for the SIP channel */
-static char global_sdpsession[AST_MAX_EXTENSION]; /*!< SDP session name for the SIP channel */
-static char global_sdpowner[AST_MAX_EXTENSION]; /*!< SDP owner name for the SIP channel */
-static int global_authfailureevents; /*!< Whether we send authentication failure manager events or not. Default no. */
-static int global_t1; /*!< T1 time */
-static int global_t1min; /*!< T1 roundtrip time minimum */
-static int global_timer_b; /*!< Timer B - RFC 3261 Section 17.1.1.2 */
-static unsigned int global_autoframing; /*!< Turn autoframing on or off. */
-static int global_qualifyfreq; /*!< Qualify frequency */
-static int global_qualify_gap; /*!< Time between our group of peer pokes */
-static int global_qualify_peers; /*!< Number of peers to poke at a given time */
-
+static unsigned int chan_idx; /*!< used in naming sip channel */
+static int global_match_auth_username; /*!< Match auth username if available instead of From: Default off. */
+
+static int global_relaxdtmf; /*!< Relax DTMF */
+static int global_prematuremediafilter; /*!< Enable/disable premature frames in a call (causing 183 early media) */
+static int global_rtptimeout; /*!< Time out call if no RTP */
+static int global_rtpholdtimeout; /*!< Time out call if no RTP during hold */
+static int global_rtpkeepalive; /*!< Send RTP keepalives */
+static int global_reg_timeout; /*!< Global time between attempts for outbound registrations */
+static int global_regattempts_max; /*!< Registration attempts before giving up */
+static int global_shrinkcallerid; /*!< enable or disable shrinking of caller id */
+static int global_callcounter; /*!< Enable call counters for all devices. This is currently enabled by setting the peer
+ * call-limit to INT_MAX. When we remove the call-limit from the code, we can make it
+ * with just a boolean flag in the device structure */
+static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
+static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
+static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static unsigned int global_tos_text; /*!< IP type of service for text RTP packets */
+static unsigned int global_cos_sip; /*!< 802.1p class of service for SIP packets */
+static unsigned int global_cos_audio; /*!< 802.1p class of service for audio RTP packets */
+static unsigned int global_cos_video; /*!< 802.1p class of service for video RTP packets */
+static unsigned int global_cos_text; /*!< 802.1p class of service for text RTP packets */
+static unsigned int recordhistory; /*!< Record SIP history. Off by default */
+static unsigned int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
+static char global_useragent[AST_MAX_EXTENSION]; /*!< Useragent for the SIP channel */
+static char global_sdpsession[AST_MAX_EXTENSION]; /*!< SDP session name for the SIP channel */
+static char global_sdpowner[AST_MAX_EXTENSION]; /*!< SDP owner name for the SIP channel */
+static int global_authfailureevents; /*!< Whether we send authentication failure manager events or not. Default no. */
+static int global_t1; /*!< T1 time */
+static int global_t1min; /*!< T1 roundtrip time minimum */
+static int global_timer_b; /*!< Timer B - RFC 3261 Section 17.1.1.2 */
+static unsigned int global_autoframing; /*!< Turn autoframing on or off. */
+static int global_qualifyfreq; /*!< Qualify frequency */
+static int global_qualify_gap; /*!< Time between our group of peer pokes */
+static int global_qualify_peers; /*!< Number of peers to poke at a given time */
static enum st_mode global_st_mode; /*!< Mode of operation for Session-Timers */
static enum st_refresher global_st_refresher; /*!< Session-Timer refresher */
static int global_min_se; /*!< Lowest threshold for session refresh interval */
static int global_max_se; /*!< Highest threshold for session refresh interval */
-static int global_dynamic_exclude_static = 0; /*!< Exclude static peers from contact registrations */
+static int global_dynamic_exclude_static = 0; /*!< Exclude static peers from contact registrations */
/*@}*/
-
/*! \name Object counters @{
- * \bug These counters are not handled in a thread-safe way ast_atomic_fetchadd_int()
- * should be used to modify these values. */
-static int speerobjs = 0; /*!< Static peers */
-static int rpeerobjs = 0; /*!< Realtime peers */
-static int apeerobjs = 0; /*!< Autocreated peer objects */
-static int regobjs = 0; /*!< Registry objects */
+ * \bug These counters are not handled in a thread-safe way ast_atomic_fetchadd_int()
+ * should be used to modify these values. */
+static int speerobjs = 0; /*!< Static peers */
+static int rpeerobjs = 0; /*!< Realtime peers */
+static int apeerobjs = 0; /*!< Autocreated peer objects */
+static int regobjs = 0; /*!< Registry objects */
/* }@ */
static struct ast_flags global_flags[2] = {{0}}; /*!< global SIP_ flags */
@@ -813,30 +811,41 @@
static struct io_context *io; /*!< The IO context */
static int *sipsock_read_id; /*!< ID of IO entry for sipsock FD */
struct sip_pkt;
-static AST_LIST_HEAD_STATIC(domain_list, domain); /*!< The SIP domain list */
+static AST_LIST_HEAD_STATIC(domain_list, domain); /*!< The SIP domain list */
AST_LIST_HEAD_NOLOCK(sip_history_head, sip_history); /*!< history list, entry in sip_pvt */
static enum sip_debug_e sipdebug;
/*! \brief extra debugging for 'text' related events.
- * At the moment this is set together with sip_debug_console.
- * \note It should either go away or be implemented properly.
+ * At the moment this is set together with sip_debug_console.
+ * \note It should either go away or be implemented properly.
*/
static int sipdebug_text;
static const struct _map_x_s referstatusstrings[] = {
- { REFER_IDLE, "<none>" },
- { REFER_SENT, "Request sent" },
- { REFER_RECEIVED, "Request received" },
- { REFER_CONFIRMED, "Confirmed" },
- { REFER_ACCEPTED, "Accepted" },
- { REFER_RINGING, "Target ringing" },
- { REFER_200OK, "Done" },
- { REFER_FAILED, "Failed" },
- { REFER_NOAUTH, "Failed - auth failure" },
- { -1, NULL} /* terminator */
+ { REFER_IDLE, "<none>" },
+ { REFER_SENT, "Request sent" },
+ { REFER_RECEIVED, "Request received" },
+ { REFER_CONFIRMED, "Confirmed" },
+ { REFER_ACCEPTED, "Accepted" },
+ { REFER_RINGING, "Target ringing" },
+ { REFER_200OK, "Done" },
+ { REFER_FAILED, "Failed" },
+ { REFER_NOAUTH, "Failed - auth failure" },
+ { -1, NULL} /* terminator */
};
+
+/* --- Hash tables of various objects --------*/
+#ifdef LOW_MEMORY
+static int hash_peer_size = 17;
+static int hash_dialog_size = 17;
+static int hash_user_size = 17;
+#else
+static int hash_peer_size = 563; /*!< Size of peer hash table, prime number preferred! */
+static int hash_dialog_size = 563;
+static int hash_user_size = 563;
+#endif
/*! \brief
* Here we implement the container for dialogs (sip_pvt), defining
@@ -847,22 +856,9 @@
* references to the individual items.
*/
static struct ao2_container *dialogs;
-
#define sip_pvt_lock(x) ao2_lock(x)
#define sip_pvt_trylock(x) ao2_trylock(x)
#define sip_pvt_unlock(x) ao2_unlock(x)
-
-/* --- Hash tables of various objects --------*/
-
-#ifdef LOW_MEMORY
-static int hash_peer_size = 17;
-static int hash_dialog_size = 17;
-static int hash_user_size = 17;
-#else
-static int hash_peer_size = 563; /*!< Size of peer hash table, prime number preferred! */
-static int hash_dialog_size = 563;
-static int hash_user_size = 563;
-#endif
/*! \brief The table of TCP threads */
static struct ao2_container *threadt;
@@ -937,15 +933,15 @@
* Other variables (externhost, externexpire, externrefresh) are used
* to support the above functions.
*/
-static struct sockaddr_in externip; /*!< External IP address if we are behind NAT */
-static struct sockaddr_in media_address; /*!< External RTP IP address if we are behind NAT */
-
-static char externhost[MAXHOSTNAMELEN]; /*!< External host name */
-static time_t externexpire; /*!< Expiration counter for re-resolving external host name in dynamic DNS */
-static int externrefresh = 10; /*!< Refresh timer for DNS-based external address (dyndns) */
-static struct sockaddr_in stunaddr; /*!< stun server address */
-static uint16_t externtcpport; /*!< external tcp port */
-static uint16_t externtlsport; /*!< external tls port */
+static struct sockaddr_in externip; /*!< External IP address if we are behind NAT */
+static struct sockaddr_in media_address; /*!< External RTP IP address if we are behind NAT */
+
+static char externhost[MAXHOSTNAMELEN]; /*!< External host name */
+static time_t externexpire; /*!< Expiration counter for re-resolving external host name in dynamic DNS */
+static int externrefresh = 10; /*!< Refresh timer for DNS-based external address (dyndns) */
+static struct sockaddr_in stunaddr; /*!< stun server address */
+static uint16_t externtcpport; /*!< external tcp port */
+static uint16_t externtlsport; /*!< external tls port */
/*! \brief List of local networks
* We store "localnet" addresses from the config file into an access list,
@@ -953,13 +949,13 @@
* AST_SENSE_DENY for 'local' addresses, and AST_SENSE_ALLOW for 'non local'
* (i.e. presumably public) addresses.
*/
-static struct ast_ha *localaddr; /*!< List of local networks, on the same side of NAT as this Asterisk */
-
-static int ourport_tcp; /*!< The port used for TCP connections */
-static int ourport_tls; /*!< The port used for TCP/TLS connections */
+static struct ast_ha *localaddr; /*!< List of local networks, on the same side of NAT as this Asterisk */
+
+static int ourport_tcp; /*!< The port used for TCP connections */
+static int ourport_tls; /*!< The port used for TCP/TLS connections */
static struct sockaddr_in debugaddr;
-static struct ast_config *notify_types = NULL; /*!< The list of manual NOTIFY types we know how to send */
+static struct ast_config *notify_types = NULL; /*!< The list of manual NOTIFY types we know how to send */
/*! some list management macros. */
@@ -1259,6 +1255,7 @@
static void change_redirecting_information(struct sip_pvt *p, struct sip_request *req, struct ast_party_redirecting *redirecting, int set_call_forward);
static int get_domain(const char *str, char *domain, int len);
static void get_realm(struct sip_pvt *p, const struct sip_request *req);
+static int parse_uri(char *uri, const char *scheme, char **ret_name, char **pass, char **domain, char **port, char **options, char **transport);
/*-- TCP connection handling ---*/
static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_session_instance *tcptls_session);
@@ -3282,8 +3279,7 @@
* \endverbatim
*
*/
-static int parse_uri(char *uri, const char *scheme,
- char **ret_name, char **pass, char **domain, char **port, char **options, char **transport)
+static int parse_uri(char *uri, const char *scheme, char **ret_name, char **pass, char **domain, char **port, char **options, char **transport)
{
char *name = NULL;
int error = 0;
Modified: team/dvossel/sip_string_parse_testing/channels/sip/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/sip_string_parse_testing/channels/sip/sip.h?view=diff&rev=244056&r1=244055&r2=244056
==============================================================================
--- team/dvossel/sip_string_parse_testing/channels/sip/sip.h (original)
+++ team/dvossel/sip_string_parse_testing/channels/sip/sip.h Sat Jan 30 00:07:44 2010
@@ -193,20 +193,20 @@
#define DEFAULT_MWI_FROM ""
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_ALLOWGUEST TRUE
-#define DEFAULT_RTPKEEPALIVE 0 /*!< Default RTPkeepalive setting */
-#define DEFAULT_CALLCOUNTER FALSE /*!< Do not enable call counters by default */
-#define DEFAULT_SRVLOOKUP TRUE /*!< Recommended setting is ON */
-#define DEFAULT_COMPACTHEADERS FALSE /*!< Send compact (one-character) SIP headers. Default off */
-#define DEFAULT_TOS_SIP 0 /*!< Call signalling packets should be marked as DSCP CS3, but the default is 0 to be compatible with previous versions. */
-#define DEFAULT_TOS_AUDIO 0 /*!< Audio packets should be marked as DSCP EF (Expedited Forwarding), but the default is 0 to be compatible with previous versions. */
-#define DEFAULT_TOS_VIDEO 0 /*!< Video packets should be marked as DSCP AF41, but the default is 0 to be compatible with previous versions. */
-#define DEFAULT_TOS_TEXT 0 /*!< Text packets should be marked as XXXX XXXX, but the default is 0 to be compatible with previous versions. */
-#define DEFAULT_COS_SIP 4 /*!< Level 2 class of service for SIP signalling */
-#define DEFAULT_COS_AUDIO 5 /*!< Level 2 class of service for audio media */
-#define DEFAULT_COS_VIDEO 6 /*!< Level 2 class of service for video media */
-#define DEFAULT_COS_TEXT 5 /*!< Level 2 class of service for text media (T.140) */
+#define DEFAULT_RTPKEEPALIVE 0 /*!< Default RTPkeepalive setting */
+#define DEFAULT_CALLCOUNTER FALSE /*!< Do not enable call counters by default */
+#define DEFAULT_SRVLOOKUP TRUE /*!< Recommended setting is ON */
+#define DEFAULT_COMPACTHEADERS FALSE /*!< Send compact (one-character) SIP headers. Default off */
+#define DEFAULT_TOS_SIP 0 /*!< Call signalling packets should be marked as DSCP CS3, but the default is 0 to be compatible with previous versions. */
+#define DEFAULT_TOS_AUDIO 0 /*!< Audio packets should be marked as DSCP EF (Expedited Forwarding), but the default is 0 to be compatible with previous versions. */
+#define DEFAULT_TOS_VIDEO 0 /*!< Video packets should be marked as DSCP AF41, but the default is 0 to be compatible with previous versions. */
+#define DEFAULT_TOS_TEXT 0 /*!< Text packets should be marked as XXXX XXXX, but the default is 0 to be compatible with previous versions. */
+#define DEFAULT_COS_SIP 4 /*!< Level 2 class of service for SIP signalling */
+#define DEFAULT_COS_AUDIO 5 /*!< Level 2 class of service for audio media */
+#define DEFAULT_COS_VIDEO 6 /*!< Level 2 class of service for video media */
+#define DEFAULT_COS_TEXT 5 /*!< Level 2 class of service for text media (T.140) */
#define DEFAULT_ALLOW_EXT_DOM TRUE /*!< Allow external domains */
-#define DEFAULT_REALM "asterisk" /*!< Realm for HTTP digest authentication */
+#define DEFAULT_REALM "asterisk" /*!< Realm for HTTP digest authentication */
#define DEFAULT_DOMAINSASREALM FALSE /*!< Use the domain option to guess the realm for registration and invite requests */
#define DEFAULT_NOTIFYRINGING TRUE /*!< Notify devicestate system on ringing state */
#define DEFAULT_NOTIFYCID DISABLED /*!< Include CID with ringing notifications */
@@ -268,16 +268,16 @@
/* re-INVITE related settings */
#define SIP_REINVITE (7 << 20) /*!< DP: four settings, uses three bits */
-#define SIP_REINVITE_NONE (0 << 20)/*!< DP: no reinvite allowed */
-#define SIP_DIRECT_MEDIA (1 << 20)/*!< DP: allow peers to be reinvited to send media directly p2p */
-#define SIP_DIRECT_MEDIA_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */
-#define SIP_REINVITE_UPDATE (4 << 20) /*!< DP: use UPDATE (RFC3311) when reinviting this peer */
+#define SIP_REINVITE_NONE (0 << 20) /*!< DP: no reinvite allowed */
+#define SIP_DIRECT_MEDIA (1 << 20) /*!< DP: allow peers to be reinvited to send media directly p2p */
+#define SIP_DIRECT_MEDIA_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */
+#define SIP_REINVITE_UPDATE (4 << 20) /*!< DP: use UPDATE (RFC3311) when reinviting this peer */
/* "insecure" settings - see insecure2str() */
-#define SIP_INSECURE (3 << 23) /*!< DP: three settings, uses two bits */
-#define SIP_INSECURE_NONE (0 << 23) /*!< DP: secure mode */
-#define SIP_INSECURE_PORT (1 << 23) /*!< DP: don't require matching port for incoming requests */
-#define SIP_INSECURE_INVITE (1 << 24) /*!< DP: don't require authentication for incoming INVITEs */
+#define SIP_INSECURE (3 << 23) /*!< DP: three settings, uses two bits */
+#define SIP_INSECURE_NONE (0 << 23) /*!< DP: secure mode */
+#define SIP_INSECURE_PORT (1 << 23) /*!< DP: don't require matching port for incoming requests */
+#define SIP_INSECURE_INVITE (1 << 24) /*!< DP: don't require authentication for incoming INVITEs */
/* Sending PROGRESS in-band settings */
#define SIP_PROG_INBAND (3 << 25) /*!< DP: three settings, uses two bits */
@@ -302,31 +302,31 @@
a second page of flags (for flags[1] */
/*@{*/
/* realtime flags */
-#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0) /*!< GP: Should we keep RT objects in memory for extended time? */
-#define SIP_PAGE2_RTAUTOCLEAR (1 << 2) /*!< GP: Should we clean memory from peers after expiry? */
-#define SIP_PAGE2_RPID_UPDATE (1 << 3)
-#define SIP_PAGE2_Q850_REASON (1 << 4) /*!< DP: Get/send cause code via Reason header */
+#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0) /*!< GP: Should we keep RT objects in memory for extended time? */
+#define SIP_PAGE2_RTAUTOCLEAR (1 << 2) /*!< GP: Should we clean memory from peers after expiry? */
+#define SIP_PAGE2_RPID_UPDATE (1 << 3)
+#define SIP_PAGE2_Q850_REASON (1 << 4) /*!< DP: Get/send cause code via Reason header */
/* Space for addition of other realtime flags in the future */
-#define SIP_PAGE2_CONSTANT_SSRC (1 << 7) /*!< GDP: Don't change SSRC on reinvite */
-#define SIP_PAGE2_SYMMETRICRTP (1 << 8) /*!< GDP: Whether symmetric RTP is enabled or not */
-#define SIP_PAGE2_STATECHANGEQUEUE (1 << 9) /*!< D: Unsent state pending change exists */
-
-#define SIP_PAGE2_CONNECTLINEUPDATE_PEND (1 << 10)
-#define SIP_PAGE2_RPID_IMMEDIATE (1 << 11)
-#define SIP_PAGE2_RPORT_PRESENT (1 << 12) /*!< Was rport received in the Via header? */
-#define SIP_PAGE2_PREFERRED_CODEC (1 << 13) /*!< GDP: Only respond with single most preferred joint codec */
-#define SIP_PAGE2_VIDEOSUPPORT (1 << 14) /*!< DP: Video supported if offered? */
-#define SIP_PAGE2_TEXTSUPPORT (1 << 15) /*!< GDP: Global text enable */
-#define SIP_PAGE2_ALLOWSUBSCRIBE (1 << 16) /*!< GP: Allow subscriptions from this peer? */
-#define SIP_PAGE2_ALLOWOVERLAP (1 << 17) /*!< DP: Allow overlap dialing ? */
-#define SIP_PAGE2_SUBSCRIBEMWIONLY (1 << 18) /*!< GP: Only issue MWI notification if subscribed to */
-#define SIP_PAGE2_IGNORESDPVERSION (1 << 19) /*!< GDP: Ignore the SDP session version number we receive and treat all sessions as new */
-
-#define SIP_PAGE2_T38SUPPORT (3 << 20) /*!< GDP: T.38 Fax Support */
-#define SIP_PAGE2_T38SUPPORT_UDPTL (1 << 20) /*!< GDP: T.38 Fax Support (no error correction) */
-#define SIP_PAGE2_T38SUPPORT_UDPTL_FEC (2 << 20) /*!< GDP: T.38 Fax Support (FEC error correction) */
-#define SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY (3 << 20) /*!< GDP: T.38 Fax Support (redundancy error correction) */
+#define SIP_PAGE2_CONSTANT_SSRC (1 << 7) /*!< GDP: Don't change SSRC on reinvite */
+#define SIP_PAGE2_SYMMETRICRTP (1 << 8) /*!< GDP: Whether symmetric RTP is enabled or not */
+#define SIP_PAGE2_STATECHANGEQUEUE (1 << 9) /*!< D: Unsent state pending change exists */
+
+#define SIP_PAGE2_CONNECTLINEUPDATE_PEND (1 << 10)
+#define SIP_PAGE2_RPID_IMMEDIATE (1 << 11)
+#define SIP_PAGE2_RPORT_PRESENT (1 << 12) /*!< Was rport received in the Via header? */
+#define SIP_PAGE2_PREFERRED_CODEC (1 << 13) /*!< GDP: Only respond with single most preferred joint codec */
+#define SIP_PAGE2_VIDEOSUPPORT (1 << 14) /*!< DP: Video supported if offered? */
+#define SIP_PAGE2_TEXTSUPPORT (1 << 15) /*!< GDP: Global text enable */
+#define SIP_PAGE2_ALLOWSUBSCRIBE (1 << 16) /*!< GP: Allow subscriptions from this peer? */
+#define SIP_PAGE2_ALLOWOVERLAP (1 << 17) /*!< DP: Allow overlap dialing ? */
+#define SIP_PAGE2_SUBSCRIBEMWIONLY (1 << 18) /*!< GP: Only issue MWI notification if subscribed to */
+#define SIP_PAGE2_IGNORESDPVERSION (1 << 19) /*!< GDP: Ignore the SDP session version number we receive and treat all sessions as new */
+
+#define SIP_PAGE2_T38SUPPORT (3 << 20) /*!< GDP: T.38 Fax Support */
+#define SIP_PAGE2_T38SUPPORT_UDPTL (1 << 20) /*!< GDP: T.38 Fax Support (no error correction) */
+#define SIP_PAGE2_T38SUPPORT_UDPTL_FEC (2 << 20) /*!< GDP: T.38 Fax Support (FEC error correction) */
+#define SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY (3 << 20) /*!< GDP: T.38 Fax Support (redundancy error correction) */
#define SIP_PAGE2_CALL_ONHOLD (3 << 23) /*!< D: Call hold states: */
#define SIP_PAGE2_CALL_ONHOLD_ACTIVE (1 << 23) /*!< D: Active hold */
@@ -375,15 +375,15 @@
* \note this is for the INVITE that sets up the dialog
*/
enum invitestates {
- INV_NONE = 0, /*!< No state at all, maybe not an INVITE dialog */
- INV_CALLING = 1, /*!< Invite sent, no answer */
- INV_PROCEEDING = 2, /*!< We got/sent 1xx message */
- INV_EARLY_MEDIA = 3, /*!< We got 18x message with to-tag back */
- INV_COMPLETED = 4, /*!< Got final response with error. Wait for ACK, then CONFIRMED */
- INV_CONFIRMED = 5, /*!< Confirmed response - we've got an ack (Incoming calls only) */
- INV_TERMINATED = 6, /*!< Transaction done - either successful (AST_STATE_UP) or failed, but done
+ INV_NONE = 0, /*!< No state at all, maybe not an INVITE dialog */
+ INV_CALLING = 1, /*!< Invite sent, no answer */
+ INV_PROCEEDING = 2, /*!< We got/sent 1xx message */
+ INV_EARLY_MEDIA = 3, /*!< We got 18x message with to-tag back */
+ INV_COMPLETED = 4, /*!< Got final response with error. Wait for ACK, then CONFIRMED */
+ INV_CONFIRMED = 5, /*!< Confirmed response - we've got an ack (Incoming calls only) */
+ INV_TERMINATED = 6, /*!< Transaction done - either successful (AST_STATE_UP) or failed, but done
The only way out of this is a BYE from one side */
- INV_CANCELLED = 7, /*!< Transaction cancelled by client or server in non-terminated state */
+ INV_CANCELLED = 7, /*!< Transaction cancelled by client or server in non-terminated state */
};
/*! \brief When sending a SIP message, we can send with a few options, depending on
@@ -509,9 +509,9 @@
\note Asterisk does not support SCTP or UDP/DTLS
*/
enum sip_transport {
- SIP_TRANSPORT_UDP = 1, /*!< Unreliable transport for SIP, needs retransmissions */
- SIP_TRANSPORT_TCP = 1 << 1, /*!< Reliable, but unsecure */
- SIP_TRANSPORT_TLS = 1 << 2, /*!< TCP/TLS - reliable and secure transport for signalling */
+ SIP_TRANSPORT_UDP = 1, /*!< Unreliable transport for SIP, needs retransmissions */
+ SIP_TRANSPORT_TCP = 1 << 1, /*!< Reliable, but unsecure */
+ SIP_TRANSPORT_TLS = 1 << 2, /*!< TCP/TLS - reliable and secure transport for signalling */
};
/*! \brief States whether a SIP message can create a dialog in Asterisk. */
@@ -559,8 +559,8 @@
/*! \brief Modes for SIP domain handling in the PBX */
enum domain_mode {
- SIP_DOMAIN_AUTO, /*!< This domain is auto-configured */
- SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
+ SIP_DOMAIN_AUTO, /*!< This domain is auto-configured */
+ SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
};
/*! \brief debugging state
@@ -577,23 +577,23 @@
/*! \brief T38 States for a call */
enum t38state {
- T38_DISABLED = 0, /*!< Not enabled */
- T38_LOCAL_REINVITE, /*!< Offered from local - REINVITE */
- T38_PEER_REINVITE, /*!< Offered from peer - REINVITE */
- T38_ENABLED /*!< Negotiated (enabled) */
+ T38_DISABLED = 0, /*!< Not enabled */
+ T38_LOCAL_REINVITE, /*!< Offered from local - REINVITE */
+ T38_PEER_REINVITE, /*!< Offered from peer - REINVITE */
+ T38_ENABLED /*!< Negotiated (enabled) */
};
/*! \brief Parameters to know status of transfer */
enum referstatus {
- REFER_IDLE, /*!< No REFER is in progress */
- REFER_SENT, /*!< Sent REFER to transferee */
- REFER_RECEIVED, /*!< Received REFER from transferrer */
- REFER_CONFIRMED, /*!< Refer confirmed with a 100 TRYING (unused) */
- REFER_ACCEPTED, /*!< Accepted by transferee */
- REFER_RINGING, /*!< Target Ringing */
- REFER_200OK, /*!< Answered by transfer target */
- REFER_FAILED, /*!< REFER declined - go on */
- REFER_NOAUTH /*!< We had no auth for REFER */
+ REFER_IDLE, /*!< No REFER is in progress */
+ REFER_SENT, /*!< Sent REFER to transferee */
+ REFER_RECEIVED, /*!< Received REFER from transferrer */
+ REFER_CONFIRMED, /*!< Refer confirmed with a 100 TRYING (unused) */
+ REFER_ACCEPTED, /*!< Accepted by transferee */
+ REFER_RINGING, /*!< Target Ringing */
+ REFER_200OK, /*!< Answered by transfer target */
+ REFER_FAILED, /*!< REFER declined - go on */
+ REFER_NOAUTH /*!< We had no auth for REFER */
};
enum sip_peer_type {
@@ -608,10 +608,8 @@
};
enum sip_tcptls_alert {
- /*! \brief There is new data to be sent out */
- TCPTLS_ALERT_DATA,
- /*! \brief A request to stop the tcp_handler thread */
- TCPTLS_ALERT_STOP,
+ TCPTLS_ALERT_DATA, /*!< \brief There is new data to be sent out */
+ TCPTLS_ALERT_STOP, /*!< \brief A request to stop the tcp_handler thread */
};
@@ -654,18 +652,18 @@
be applied to devices (trunks, services, phones)
*/
struct sip_settings {
- int peer_rtupdate; /*!< G: Update database with registration data for peer? */
- int rtsave_sysname; /*!< G: Save system name at registration? */
- int ignore_regexpire; /*!< G: Ignore expiration of peer */
- int rtautoclear; /*!< Realtime ?? */
- int directrtpsetup; /*!< Enable support for Direct RTP setup (no re-invites) */
- int pedanticsipchecking; /*!< Extra checking ? Default off */
- int autocreatepeer; /*!< Auto creation of peers at registration? Default off. */
- int srvlookup; /*!< SRV Lookup on or off. Default is on */
- int allowguest; /*!< allow unauthenticated peers to connect? */
+ int peer_rtupdate; /*!< G: Update database with registration data for peer? */
+ int rtsave_sysname; /*!< G: Save system name at registration? */
+ int ignore_regexpire; /*!< G: Ignore expiration of peer */
+ int rtautoclear; /*!< Realtime ?? */
+ int directrtpsetup; /*!< Enable support for Direct RTP setup (no re-invites) */
+ int pedanticsipchecking; /*!< Extra checking ? Default off */
+ int autocreatepeer; /*!< Auto creation of peers at registration? Default off. */
+ int srvlookup; /*!< SRV Lookup on or off. Default is on */
+ int allowguest; /*!< allow unauthenticated peers to connect? */
int alwaysauthreject; /*!< Send 401 Unauthorized for all failing requests */
int compactheaders; /*!< send compact sip headers */
- int allow_external_domains; /*!< Accept calls to external SIP domains? */
+ int allow_external_domains; /*!< Accept calls to external SIP domains? */
int callevents; /*!< Whether we send manager events or not */
int regextenonqualify; /*!< Whether to add/remove regexten when qualifying peers */
int matchexterniplocally; /*!< Match externip/externhost setting against localnet setting */
@@ -676,14 +674,14 @@
enum notifycid_setting notifycid; /*!< Send CID with ringing notifications */
enum transfermodes allowtransfer; /*!< SIP Refer restriction scheme */
int allowsubscribe; /*!< Flag for disabling ALL subscriptions, this is FALSE only if all peers are FALSE
- the global setting is in globals_flags[1] */
+ the global setting is in globals_flags[1] */
char realm[MAXHOSTNAMELEN]; /*!< Default realm */
int domainsasrealm; /*!< Use domains lists as realms */
struct sip_proxy outboundproxy; /*!< Outbound proxy */
char default_context[AST_MAX_CONTEXT];
char default_subscribecontext[AST_MAX_CONTEXT];
- struct ast_ha *contact_ha; /*! \brief Global list of addresses dynamic peers are not allowed to use */
- format_t capability; /*!< Supported codecs */
+ struct ast_ha *contact_ha; /*! \brief Global list of addresses dynamic peers are not allowed to use */
+ format_t capability; /*!< Supported codecs */
};
/*! \brief The SIP socket definition */
@@ -691,7 +689,7 @@
enum sip_transport type; /*!< UDP, TCP or TLS */
int fd; /*!< Filed descriptor, the actual socket */
uint16_t port;
- struct ast_tcptls_session_instance *tcptls_session; /* If tcp or tls, a socket manager */
+ struct ast_tcptls_session_instance *tcptls_session; /* If tcp or tls, a socket manager */
};
/*! \brief sip_request: The data grabbed from the UDP socket
@@ -719,22 +717,22 @@
* \endverbatim
*/
struct sip_request {
- ptrdiff_t rlPart1; /*!< Offset of the SIP Method Name or "SIP/2.0" protocol version */
- ptrdiff_t rlPart2; /*!< Offset of the Request URI or Response Status */
+ ptrdiff_t rlPart1; /*!< Offset of the SIP Method Name or "SIP/2.0" protocol version */
+ ptrdiff_t rlPart2; /*!< Offset of the Request URI or Response Status */
int len; /*!< bytes used in data[], excluding trailing null terminator. Rarely used. */
int headers; /*!< # of SIP Headers */
int method; /*!< Method of this request */
int lines; /*!< Body Content */
unsigned int sdp_start; /*!< the line number where the SDP begins */
unsigned int sdp_count; /*!< the number of lines of SDP */
- char debug; /*!< print extra debugging if non zero */
- char has_to_tag; /*!< non-zero if packet has To: tag */
- char ignore; /*!< if non-zero This is a re-transmit, ignore it */
+ char debug; /*!< print extra debugging if non zero */
+ char has_to_tag; /*!< non-zero if packet has To: tag */
+ char ignore; /*!< if non-zero This is a re-transmit, ignore it */
ptrdiff_t header[SIP_MAX_HEADERS]; /*!< Array of offsets into the request string of each SIP header*/
- ptrdiff_t line[SIP_MAX_LINES]; /*!< Array of offsets into the request string of each SDP line*/
+ ptrdiff_t line[SIP_MAX_LINES]; /*!< Array of offsets into the request string of each SDP line*/
struct ast_str *data;
/* XXX Do we need to unref socket.ser when the request goes away? */
- struct sip_socket socket; /*!< The socket used for this request */
+ struct sip_socket socket; /*!< The socket used for this request */
AST_LIST_ENTRY(sip_request) next;
};
@@ -749,22 +747,22 @@
/*! \brief structure used in transfers */
struct sip_dual {
- struct ast_channel *chan1; /*!< First channel involved */
- struct ast_channel *chan2; /*!< Second channel involved */
- struct sip_request req; /*!< Request that caused the transfer (REFER) */
- int seqno; /*!< Sequence number */
+ struct ast_channel *chan1; /*!< First channel involved */
+ struct ast_channel *chan2; /*!< Second channel involved */
+ struct sip_request req; /*!< Request that caused the transfer (REFER) */
+ int seqno; /*!< Sequence number */
};
/*! \brief Parameters to the transmit_invite function */
struct sip_invite_param {
- int addsipheaders; /*!< Add extra SIP headers */
[... 643 lines stripped ...]
More information about the asterisk-commits
mailing list