diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 39877650f3..e9f0738827 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -32,7 +32,7 @@
* \note TCP/TLS support is EXPERIMENTAL and WILL CHANGE. This applies to configuration
* settings, dialplan commands and dialplans apps/functions
* See \ref sip_tcp_tls
- *
+ *
*
* ******** General TODO:s
* \todo Better support of forking
@@ -40,7 +40,7 @@
* \todo Transaction support
* \todo Asterisk should send a non-100 provisional response every minute to keep proxies
* from cancelling the transaction (RFC 3261 13.3.1.1). See bug #11157.
- *
+ *
* ******** Wishlist: Improvements
* - Support of SIP domains for devices, so that we match on username@domain in the From: header
* - Connect registrations with a specific device on the incoming call. It's not done
@@ -68,7 +68,7 @@
* sipsock_read() for udp only. In tcp, packets are read by the tcp_helper thread.
* sipsock_read() function parses the packet and matches an existing
* dialog or starts a new SIP dialog.
- *
+ *
* sipsock_read sends the packet to handle_incoming(), that parses a bit more.
* If it is a response to an outbound request, the packet is sent to handle_response().
* If it is a request, handle_incoming() sends it to one of a list of functions
@@ -83,28 +83,28 @@
* the sip_answer() function is called.
*
* The actual media - Video or Audio - is mostly handled by the RTP subsystem
- * in rtp.c
- *
+ * in rtp.c
+ *
* \par Outbound calls
* Outbound calls are set up by the PBX through the sip_request_call()
* function. After that, they are activated by sip_call().
- *
+ *
* \par Hanging up
* The PBX issues a hangup on both incoming and outgoing calls through
* the sip_hangup() function
*/
-/*!
+/*!
* \page sip_tcp_tls SIP TCP and TLS support
- *
+ *
* \par tcpfixes TCP implementation changes needed
* \todo Fix TCP/TLS handling in dialplan, SRV records, transfers and much more
* \todo Save TCP/TLS sessions in registry
* If someone registers a SIPS uri, this forces us to set up a TLS connection back.
* \todo Add TCP/TLS information to function SIPPEER and SIPCHANINFO
* \todo If tcpenable=yes, we must open a TCP socket on the same address as the IP for UDP.
- * The tcpbindaddr config option should only be used to open ADDITIONAL ports
- * So we should propably go back to
+ * The tcpbindaddr config option should only be used to open ADDITIONAL ports
+ * So we should propably go back to
* bindaddr= the default address to bind to. If tcpenable=yes, then bind this to both udp and TCP
* if tlsenable=yes, open TLS port (provided we also have cert)
* tcpbindaddr = extra address for additional TCP connections
@@ -113,11 +113,11 @@
* These three options should take multiple IP/port pairs
* Note: Since opening additional listen sockets is a *new* feature we do not have today
* the XXXbindaddr options needs to be disabled until we have support for it
- *
+ *
* \todo re-evaluate the transport= setting in sip.conf. This is right now not well
* thought of. If a device in sip.conf contacts us via TCP, we should not switch transport,
* even if udp is the configured first transport.
- *
+ *
* \todo Be prepared for one outbound and another incoming socket per pvt. This applies
* specially to communication with other peers (proxies).
* \todo We need to test TCP sessions with SIP proxies and in regards
@@ -137,7 +137,7 @@
* \todo Default transports are set to UDP, which cause the wrong behaviour when contacting remote
* devices directly from the dialplan. UDP is only a fallback if no other method works,
* in order to be compatible with RFC2543 (SIP/1.0) devices. For transactions that exceed the
- * MTU (like INIVTE with video, audio and RTT) TCP should be preferred.
+ * MTU (like INIVTE with video, audio and RTT) TCP should be preferred.
*
* When dialling unconfigured peers (with no port number) or devices in external domains
* NAPTR records MUST be consulted to find configured transport. If they are not found,
@@ -150,7 +150,7 @@
* __set_address_from_contact(const char *fullcontact, struct sockaddr_in *sin, int tcp)
* - sets TLS port as default for all TCP connections, unless other port is given in contact.
* parse_register_contact(struct sip_pvt *pvt, struct sip_peer *peer, struct sip_request *req)
- * - assumes that the contact the UA registers is using the same transport as the REGISTER request, which is
+ * - assumes that the contact the UA registers is using the same transport as the REGISTER request, which is
* a bad guess.
* - Does not save any information about TCP/TLS connected devices, which is a severe BUG, as discussed on the mailing list.
* get_destination(struct sip_pvt *p, struct sip_request *oreq)
@@ -191,9 +191,9 @@
made by remote end-points. A remote end-point can request Asterisk to engage
session-timers by either sending it an INVITE request with a "Supported: timer"
header in it or by responding to Asterisk's INVITE with a 200 OK that contains
- Session-Expires: header in it. In this mode, the Asterisk server does not
+ Session-Expires: header in it. In this mode, the Asterisk server does not
request session-timers from remote end-points. This is the default mode.
- 2. Originate :: In the "originate" mode, the Asterisk server requests the remote
+ 2. Originate :: In the "originate" mode, the Asterisk server requests the remote
end-points to activate session-timers in addition to honoring such requests
made by the remote end-pints. In order to get as much protection as possible
against hanging SIP channels due to network or end-point failures, Asterisk
@@ -202,7 +202,7 @@
3. Refuse :: In the "refuse" mode, Asterisk acts as if it does not support session-
timers for inbound or outbound requests. If a remote end-point requests
session-timers in a dialog, then Asterisk ignores that request unless it's
- noted as a requirement (Require: header), in which case the INVITE is
+ noted as a requirement (Require: header), in which case the INVITE is
rejected with a 420 Bad Extension response.
*/
@@ -245,15 +245,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/file.h"
#include "asterisk/astobj.h"
-/*
+/*
Uncomment the define below, if you are having refcount related memory leaks.
With this uncommented, this module will generate a file, /tmp/refs, which contains
a history of the ao2_ref() calls. To be useful, all calls to ao2_* functions should
- be modified to ao2_t_* calls, and include a tag describing what is happening with
+ be modified to ao2_t_* calls, and include a tag describing what is happening with
enough detail, to make pairing up a reference count increment with its corresponding decrement.
The refcounter program in utils/ can be invaluable in highlighting objects that are not
balanced, along with the complete history for that object.
- In normal operation, the macros defined will throw away the tags, so they do not
+ In normal operation, the macros defined will throw away the tags, so they do not
affect the speed of the program at all. They can be considered to be documentation.
*/
/* #define REF_DEBUG 1 */
@@ -317,9 +317,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
- SIPRemoveHeader() allows you to remove headers which were previously
- added with SIPAddHeader(). If no parameter is supplied, all previously added
- headers will be removed. If a parameter is supplied, only the matching headers
+ SIPRemoveHeader() allows you to remove headers which were previously
+ added with SIPAddHeader(). If no parameter is supplied, all previously added
+ headers will be removed. If a parameter is supplied, only the matching headers
will be removed.
For example you have added these 2 headers:
SIPAddHeader(P-Asserted-Identity: sip:foo@bar);
@@ -581,13 +581,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/* guard limit must be larger than guard secs */
/* guard min must be < 1000, and should be >= 250 */
#define EXPIRY_GUARD_SECS 15 /*!< How long before expiry do we reregister */
-#define EXPIRY_GUARD_LIMIT 30 /*!< Below here, we use EXPIRY_GUARD_PCT instead of
+#define EXPIRY_GUARD_LIMIT 30 /*!< Below here, we use EXPIRY_GUARD_PCT instead of
EXPIRY_GUARD_SECS */
-#define EXPIRY_GUARD_MIN 500 /*!< This is the minimum guard time applied. If
- GUARD_PCT turns out to be lower than this, it
+#define EXPIRY_GUARD_MIN 500 /*!< This is the minimum guard time applied. If
+ GUARD_PCT turns out to be lower than this, it
will use this time instead.
This is in milliseconds. */
-#define EXPIRY_GUARD_PCT 0.20 /*!< Percentage of expires timeout to use when
+#define EXPIRY_GUARD_PCT 0.20 /*!< Percentage of expires timeout to use when
below EXPIRY_GUARD_LIMIT */
#define DEFAULT_EXPIRY 900 /*!< Expire slowly */
@@ -602,7 +602,7 @@ static int mwi_expiry = DEFAULT_MWI_EXPIRY;
#define CALLERID_UNKNOWN "Anonymous"
#define FROMDOMAIN_INVALID "anonymous.invalid"
-
+
#define DEFAULT_MAXMS 2000 /*!< Qualification: Must be faster than 2 seconds by default */
#define DEFAULT_QUALIFYFREQ 60 * 1000 /*!< Qualification: How often to check for the host to be up */
#define DEFAULT_FREQ_NOTOK 10 * 1000 /*!< Qualification: How often to check, if the host is down... */
@@ -610,7 +610,7 @@ static int mwi_expiry = DEFAULT_MWI_EXPIRY;
#define DEFAULT_RETRANS 1000 /*!< How frequently to retransmit Default: 2 * 500 ms in RFC 3261 */
#define MAX_RETRANS 6 /*!< Try only 6 times for retransmissions, a total of 7 transmissions */
#define DEFAULT_TIMER_T1 500 /*!< SIP timer T1 (according to RFC 3261) */
-#define SIP_TRANS_TIMEOUT 64 * DEFAULT_TIMER_T1 /*!< SIP request timeout (rfc 3261) 64*T1
+#define SIP_TRANS_TIMEOUT 64 * DEFAULT_TIMER_T1 /*!< SIP request timeout (rfc 3261) 64*T1
\todo Use known T1 for timeout (peerpoke)
*/
#define DEFAULT_TRANS_TIMEOUT -1 /*!< Use default SIP transaction timeout */
@@ -619,7 +619,7 @@ static int mwi_expiry = DEFAULT_MWI_EXPIRY;
#define SIP_MAX_HEADERS 64 /*!< Max amount of SIP headers to read */
#define SIP_MAX_LINES 64 /*!< Max amount of lines in SIP attachment (like SDP) */
#define SIP_MIN_PACKET 4096 /*!< Initialize size of memory to allocate for packets */
-#define MAX_HISTORY_ENTRIES 50 /*!< Max entires in the history list for a sip_pvt */
+#define MAX_HISTORY_ENTRIES 50 /*!< Max entires in the history list for a sip_pvt */
#define INITIAL_CSEQ 101 /*!< Our initial sip sequence number */
@@ -641,10 +641,10 @@ 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 */
-#define RTP 1
+#define RTP 1
#define NO_RTP 0
-/*! \brief Authorization scheme for call transfers
+/*! \brief Authorization scheme for call transfers
\note Not a bitfield flag, since there are plans for other modes,
like "only allow transfers for authenticated devices" */
@@ -660,7 +660,7 @@ enum sip_result {
AST_FAILURE = -1, /*!< Failure code */
};
-/*! \brief States for the INVITE transaction, not the dialog
+/*! \brief States for the INVITE transaction, not the dialog
\note this is for the INVITE that sets up the dialog
*/
enum invitestates {
@@ -670,7 +670,7 @@ enum invitestates {
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_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 */
};
@@ -709,7 +709,7 @@ enum parse_register_result {
};
/*! \brief Type of subscription, based on the packages we do support, see \ref subscription_types */
-enum subscriptiontype {
+enum subscriptiontype {
NONE = 0,
XPIDF_XML,
DIALOG_INFO_XML,
@@ -730,7 +730,7 @@ static const struct cfsubscription_types {
const char * const text;
} subscription_types[] = {
{ NONE, "-", "unknown", "unknown" },
- /* RFC 4235: SIP Dialog event package */
+ /* RFC 4235: SIP Dialog event package */
{ DIALOG_INFO_XML, "dialog", "application/dialog-info+xml", "dialog-info+xml" },
{ CPIM_PIDF_XML, "presence", "application/cpim-pidf+xml", "cpim-pidf+xml" }, /* RFC 3863 */
{ PIDF_XML, "presence", "application/pidf+xml", "pidf+xml" }, /* RFC 3863 */
@@ -739,7 +739,7 @@ static const struct cfsubscription_types {
};
-/*! \brief Authentication types - proxy or www authentication
+/*! \brief Authentication types - proxy or www authentication
\note Endpoints, like Asterisk, should always use WWW authentication to
allow multiple authentications in the same call - to the proxy and
to the end point.
@@ -769,30 +769,30 @@ enum check_auth_result {
/*! \brief States for outbound registrations (with register= lines in sip.conf */
enum sipregistrystate {
- REG_STATE_UNREGISTERED = 0, /*!< We are not registered
+ REG_STATE_UNREGISTERED = 0, /*!< We are not registered
* \note Initial state. We should have a timeout scheduled for the initial
* (or next) registration transmission, calling sip_reregister
*/
- REG_STATE_REGSENT, /*!< Registration request sent
+ REG_STATE_REGSENT, /*!< Registration request sent
* \note sent initial request, waiting for an ack or a timeout to
* retransmit the initial request.
*/
- REG_STATE_AUTHSENT, /*!< We have tried to authenticate
+ REG_STATE_AUTHSENT, /*!< We have tried to authenticate
* \note entered after transmit_register with auth info,
* waiting for an ack.
*/
REG_STATE_REGISTERED, /*!< Registered and done */
- REG_STATE_REJECTED, /*!< Registration rejected *
+ REG_STATE_REJECTED, /*!< Registration rejected
* \note only used when the remote party has an expire larger than
* our max-expire. This is a final state from which we do not
* recover (not sure how correctly).
*/
- REG_STATE_TIMEOUT, /*!< Registration timed out *
+ REG_STATE_TIMEOUT, /*!< Registration timed out
* \note XXX unused */
REG_STATE_NOAUTH, /*!< We have no accepted credentials
@@ -804,7 +804,7 @@ enum sipregistrystate {
/*! \brief Modes in which Asterisk can be configured to run SIP Session-Timers */
enum st_mode {
- SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */
+ SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */
SESSION_TIMER_MODE_ACCEPT, /*!< Honor inbound Session-Timer requests */
SESSION_TIMER_MODE_ORIGINATE, /*!< Originate outbound and honor inbound requests */
SESSION_TIMER_MODE_REFUSE /*!< Ignore inbound Session-Timers requests */
@@ -817,8 +817,8 @@ enum st_refresher {
SESSION_TIMER_REFRESHER_UAS /*!< Session is refreshed by the UAS */
};
-/*! \brief Define some implemented SIP transports
- \note Asterisk does not support SCTP or UDP/DTLS
+/*! \brief Define some implemented SIP transports
+ \note Asterisk does not support SCTP or UDP/DTLS
*/
enum sip_transport {
SIP_TRANSPORT_UDP = 1, /*!< Unreliable transport for SIP, needs retransmissions */
@@ -828,7 +828,7 @@ enum sip_transport {
/*! \brief definition of a sip proxy server
*
- * For outbound proxies, a sip_peer will contain a reference to a
+ * For outbound proxies, a sip_peer will contain a reference to a
* dynamically allocated instance of a sip_proxy. A sip_pvt may also
* contain a reference to a peer's outboundproxy, or it may contain
* a reference to the sip_cfg.outboundproxy.
@@ -837,13 +837,13 @@ struct sip_proxy {
char name[MAXHOSTNAMELEN]; /*!< DNS name of domain/host or IP */
struct sockaddr_in ip; /*!< Currently used IP address and port */
time_t last_dnsupdate; /*!< When this was resolved */
- enum sip_transport transport;
+ enum sip_transport transport;
int force; /*!< If it's an outbound proxy, Force use of this outbound proxy for all outbound requests */
/* Room for a SRV record chain based on the name */
};
/*! \brief argument for the 'show channels|subscriptions' callback. */
-struct __show_chan_arg {
+struct __show_chan_arg {
int fd;
int subscriptions;
int numchans; /* return value */
@@ -857,7 +857,7 @@ enum can_create_dialog {
CAN_CREATE_DIALOG_UNSUPPORTED_METHOD,
};
-/*! \brief SIP Request methods known by Asterisk
+/*! \brief SIP Request methods known by Asterisk
\note Do _NOT_ make any changes to this enum, or the array following it;
if you think you are doing the right thing, you are probably
@@ -898,7 +898,7 @@ enum notifycid_setting {
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 {
+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;
@@ -907,7 +907,7 @@ static const struct cfsip_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_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 },
@@ -923,10 +923,10 @@ static const struct cfsip_methods {
{ SIP_PING, NO_RTP, "PING", CAN_CREATE_DIALOG_UNSUPPORTED_METHOD }
};
-/*! Define SIP option tags, used in Require: and Supported: headers
- We need to be aware of these properties in the phones to use
+/*! Define SIP option tags, used in Require: and Supported: headers
+ We need to be aware of these properties in the phones to use
the replace: header. We should not do that without knowing
- that the other end supports it...
+ that the other end supports it...
This is nothing we can configure, we learn by the dialog
Supported: header on the REGISTER (peer) or the INVITE
(other devices)
@@ -969,7 +969,7 @@ static const struct cfsip_options {
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" },
+ { SIP_OPT_100REL, NOT_SUPPORTED, "100rel" },
/* RFC3959: SIP Early session support */
{ SIP_OPT_EARLY_SESSION, NOT_SUPPORTED, "early-session" },
/* SIMPLE events: RFC4662 */
@@ -999,9 +999,9 @@ static const struct cfsip_options {
/* RFC-ietf-sip-uri-list-subscribe-02.txt - subscription lists */
{ SIP_OPT_RECLISTSUB, NOT_SUPPORTED, "recipient-list-subscribe" },
/* RFC3891: Replaces: header for transfer */
- { SIP_OPT_REPLACES, SUPPORTED, "replaces" },
+ { SIP_OPT_REPLACES, SUPPORTED, "replaces" },
/* One version of Polycom firmware has the wrong label */
- { SIP_OPT_REPLACES, SUPPORTED, "replace" },
+ { SIP_OPT_REPLACES, SUPPORTED, "replace" },
/* RFC4412 Resource priorities */
{ SIP_OPT_RESPRIORITY, NOT_SUPPORTED, "resource-priority" },
/* RFC3329: Security agreement mechanism */
@@ -1063,18 +1063,18 @@ static const char *sip_reason_code_to_str(enum AST_REDIRECTING_REASON code)
return "unknown";
}
-/*! \brief SIP Methods we support
+/*! \brief SIP Methods we support
\todo This string should be set dynamically. We only support REFER and SUBSCRIBE if we have
allowsubscribe and allowrefer on in sip.conf.
*/
#define ALLOWED_METHODS "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO"
-/*! \brief SIP Extensions we support
+/*! \brief SIP Extensions we support
\note This should be generated based on the previous array
in combination with settings.
\todo We should not have "timer" if it's disabled in the configuration file.
*/
-#define SUPPORTED_EXTENSIONS "replaces, timer"
+#define SUPPORTED_EXTENSIONS "replaces, timer"
/*! \brief Standard SIP unsecure port for UDP and TCP from RFC 3261. DO NOT CHANGE THIS */
#define STANDARD_SIP_PORT 5060
@@ -1090,13 +1090,13 @@ static const char *sip_reason_code_to_str(enum AST_REDIRECTING_REASON code)
* option. If you change this value, the signalling will be incorrect.
*/
-/*! \name DefaultValues Default values, set and reset in reload_config before reading configuration
+/*! \name DefaultValues Default values, set and reset in reload_config before reading configuration
These are default values in the source. There are other recommended values in the
sip.conf.sample for new installations. These may differ to keep backwards compatibility,
- yet encouraging new behaviour on new installations
+ yet encouraging new behaviour on new installations
*/
-/*@{*/
+/*@{*/
#define DEFAULT_CONTEXT "default" /*!< The default context for [general] section as well as devices */
#define DEFAULT_MOHINTERPRET "default" /*!< The default music class */
#define DEFAULT_MOHSUGGEST ""
@@ -1137,13 +1137,13 @@ static const char *sip_reason_code_to_str(enum AST_REDIRECTING_REASON code)
#define DEFAULT_SDPOWNER "root" /*!< Default SDP username field in (o=) header unless re-defined in sip.conf */
#define DEFAULT_ENGINE "asterisk" /*!< Default RTP engine to use for sessions */
#endif
-/*@}*/
+/*@}*/
/*! \name DefaultSettings
Default setttings are used as a channel setting and as a default when
- configuring devices
+ configuring devices
*/
-/*@{*/
+/*@{*/
static char default_language[MAX_LANGUAGE];
static char default_callerid[AST_MAX_EXTENSION];
static char default_mwi_from[80];
@@ -1152,7 +1152,7 @@ static char default_notifymime[AST_MAX_EXTENSION];
static int default_qualify; /*!< Default Qualify= setting */
static char default_vmexten[AST_MAX_EXTENSION];
static char default_mohinterpret[MAX_MUSICCLASS]; /*!< Global setting for moh class to use when put on hold */
-static char default_mohsuggest[MAX_MUSICCLASS]; /*!< Global setting for moh class to suggest when putting
+static char default_mohsuggest[MAX_MUSICCLASS]; /*!< Global setting for moh class to suggest when putting
* a bridged channel on hold */
static char default_parkinglot[AST_MAX_CONTEXT]; /*!< Parkinglot */
static char default_engine[256]; /*!< Default RTP engine */
@@ -1161,14 +1161,14 @@ static struct ast_codec_pref default_prefs; /*!< Default codec prefs */
static unsigned int default_transports; /*!< Default Transports (enum sip_transport) that are acceptable */
static unsigned int default_primary_transport; /*!< Default primary Transport (enum sip_transport) for outbound connections to devices */
-/*@}*/
+/*@}*/
/*! \name GlobalSettings
Global settings apply to the channel (often settings you can change in the general section
of sip.conf
*/
-/*@{*/
-/*! \brief a place to store all global settings for the sip channel driver
+/*@{*/
+/*! \brief a place to store all global settings for the sip channel driver
These are settings that will be possibly to apply on a group level later on.
\note Do not add settings that only apply to the channel itself and can't
be applied to devices (trunks, services, phones)
@@ -1194,7 +1194,7 @@ struct sip_settings {
int notifyhold; /*!< Send notifications on hold */
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
+ int allowsubscribe; /*!< Flag for disabling ALL subscriptions, this is FALSE only if all peers are FALSE
the global setting is in globals_flags[1] */
char realm[MAXHOSTNAMELEN]; /*!< Default realm */
int domainsasrealm; /*!< Use domains lists as realms */
@@ -1248,7 +1248,7 @@ 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 */
-/*@}*/
+/*@}*/
/*! \brief Global list of addresses dynamic peers are not allowed to use */
static struct ast_ha *global_contact_ha = NULL;
@@ -1305,7 +1305,7 @@ struct sip_socket {
* Incoming messages: we first store the data from the socket in data[],
* adding a trailing \0 to make string parsing routines happy.
* Then call parse_request() and req.method = find_sip_method();
- * to initialize the other fields. The \r\n at the end of each line is
+ * to initialize the other fields. The \r\n at the end of each line is
* replaced by \0, so that data[] is not a conforming SIP message anymore.
* After this processing, rlPart1 is set to non-NULL to remember
* that we can run get_header() on this kind of packet.
@@ -1320,7 +1320,7 @@ struct sip_socket {
* (which fills the first line to "METHOD uri SIP/2.0" or "SIP/2.0 code text"),
* and then fill the rest with add_header() and add_line().
* The \r\n at the end of the line are still there, so the get_header()
- * and similar functions don't work on these packets.
+ * and similar functions don't work on these packets.
* \endverbatim
*/
struct sip_request {
@@ -1388,7 +1388,7 @@ enum domain_mode {
SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
};
-/*! \brief Domain data structure.
+/*! \brief Domain data structure.
\note In the future, we will connect this to a configuration tree specific
for this domain
*/
@@ -1420,7 +1420,7 @@ struct sip_auth {
};
/*! \name SIPflags
- Various flags for the flags field in the pvt structure
+ Various flags for the flags field in the pvt structure
Trying to sort these up (one or more of the following):
D: Dialog
P: Peer/user
@@ -1428,7 +1428,7 @@ struct sip_auth {
When flags are used by multiple structures, it is important that
they have a common layout so it is easy to copy them.
*/
-/*@{*/
+/*@{*/
#define SIP_OUTGOING (1 << 0) /*!< D: Direction of the last transaction in this dialog */
#define SIP_RINGING (1 << 2) /*!< D: Have sent 180 ringing */
#define SIP_PROGRESS_SENT (1 << 3) /*!< D: Have sent 183 message progress */
@@ -1487,11 +1487,11 @@ struct sip_auth {
(SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \
SIP_PROG_INBAND | SIP_USECLIENTCODE | SIP_NAT_FORCE_RPORT | SIP_G726_NONSTANDARD | \
SIP_USEREQPHONE | SIP_INSECURE)
-/*@}*/
+/*@}*/
/*! \name SIPflags2
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? */
@@ -1536,7 +1536,7 @@ struct sip_auth {
SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
SIP_PAGE2_RPID_IMMEDIATE | SIP_PAGE2_RPID_UPDATE | SIP_PAGE2_SYMMETRICRTP)
-/*@}*/
+/*@}*/
/*! \brief debugging state
* We store separately the debugging requests from the config file
@@ -1594,7 +1594,7 @@ enum referstatus {
struct _map_x_s {
int x;
const char *s;
-};
+};
static const struct _map_x_s referstatusstrings[] = {
{ REFER_IDLE, "" },
@@ -1632,11 +1632,11 @@ struct sip_refer {
};
-/*! \brief Structure that encapsulates all attributes related to running
+/*! \brief Structure that encapsulates all attributes related to running
* SIP Session-Timers feature on a per dialog basis.
*/
struct sip_st_dlg {
- int st_active; /*!< Session-Timers on/off */
+ int st_active; /*!< Session-Timers on/off */
int st_interval; /*!< Session-Timers negotiated session refresh interval */
int st_schedid; /*!< Session-Timers ast_sched scheduler id */
enum st_refresher st_ref; /*!< Session-Timers session refresher */
@@ -1649,7 +1649,7 @@ struct sip_st_dlg {
};
-/*! \brief Structure that encapsulates all attributes related to configuration
+/*! \brief Structure that encapsulates all attributes related to configuration
* of SIP Session-Timers feature on a per user/peer basis.
*/
struct sip_st_cfg {
@@ -1785,7 +1785,7 @@ struct sip_pvt {
int amaflags; /*!< AMA Flags */
int pendinginvite; /*!< Any pending INVITE or state NOTIFY (in subscribe pvt's) ? (seqno of this) */
int glareinvite; /*!< A invite received while a pending invite is already present is stored here. Its seqno is the
- value. Since this glare invite's seqno is not the same as the pending invite's, it must be
+ value. Since this glare invite's seqno is not the same as the pending invite's, it must be
held in order to properly process acknowledgements for our 491 response. */
struct sip_request initreq; /*!< Latest request that opened a new transaction
within this dialog.
@@ -1803,7 +1803,7 @@ struct sip_pvt {
struct ast_dsp *dsp; /*!< Inband DTMF Detection dsp */
- struct sip_peer *relatedpeer; /*!< If this dialog is related to a peer, which one
+ struct sip_peer *relatedpeer; /*!< If this dialog is related to a peer, which one
Used in peerpoke, mwi subscriptions */
struct sip_registry *registry; /*!< If this is a REGISTER dialog, to which registry */
struct ast_rtp_instance *rtp; /*!< RTP Session */
@@ -1815,8 +1815,8 @@ struct sip_pvt {
struct ast_variable *chanvars; /*!< Channel variables to set for inbound call */
AST_LIST_HEAD_NOLOCK(request_queue, sip_request) request_queue; /*!< Requests that arrived but could not be processed immediately */
struct sip_invite_param *options; /*!< Options for INVITE */
- struct sip_st_dlg *stimer; /*!< SIP Session-Timers */
-
+ struct sip_st_dlg *stimer; /*!< SIP Session-Timers */
+
int red; /*!< T.140 RTP Redundancy */
int hangupcause; /*!< Storage of hangupcause copied from our owner before we disconnect from the AST channel (only used at hangup) */
@@ -1834,7 +1834,7 @@ struct sip_pvt {
* By doing this, even if we don't want to answer a particular media stream with something meaningful, we can
* still put an m= line in our answer with the port set to 0.
*
- * The reason for the length being 4 is that in this branch of Asterisk, the only media types supported are
+ * The reason for the length being 4 is that in this branch of Asterisk, the only media types supported are
* image, audio, text, and video. Therefore we need to keep track of which types of media were offered.
*
* Note that if we wanted to be 100% correct, we would keep a list of all media streams offered. That way we could respond
@@ -1845,7 +1845,7 @@ struct sip_pvt {
* The large-scale changes would be a good idea for implementing during an SDP rewrite.
*/
struct offered_media offered_media[4];
-};
+};
/*! \brief
@@ -1945,7 +1945,7 @@ enum sip_peer_type {
SIP_TYPE_USER = (1 << 1),
};
-/*! \brief Structure for SIP peer data, we place calls to peers if registered or fixed IP address (host)
+/*! \brief Structure for SIP peer data, we place calls to peers if registered or fixed IP address (host)
*/
/* XXX field 'name' must be first otherwise sip_addrcmp() will fail, as will astobj2 hashing of the structure */
struct sip_peer {
@@ -1956,7 +1956,7 @@ struct sip_peer {
AST_STRING_FIELD(remotesecret); /*!< Remote secret (trunks, remote devices) */
AST_STRING_FIELD(context); /*!< Default context for incoming calls */
AST_STRING_FIELD(subscribecontext); /*!< Default context for subscriptions */
- AST_STRING_FIELD(username); /*!< Temporary username until registration */
+ AST_STRING_FIELD(username); /*!< Temporary username until registration */
AST_STRING_FIELD(accountcode); /*!< Account code */
AST_STRING_FIELD(tohost); /*!< If not dynamic, IP address */
AST_STRING_FIELD(regexten); /*!< Extension to register (if regcontext is used) */
@@ -2039,7 +2039,7 @@ struct sip_peer {
};
-/*!
+/*!
* \brief Registrations with other SIP proxies
*
* Created by sip_register(), the entry is linked in the 'regl' list,
@@ -2237,7 +2237,7 @@ AST_THREADSTORAGE_CUSTOM(ts_video_rtp, NULL, ts_ast_rtp_destroy);
AST_THREADSTORAGE_CUSTOM(ts_text_rtp, NULL, ts_ast_rtp_destroy);
#endif
-/*! \brief Authentication list for realm authentication
+/*! \brief Authentication list for realm authentication
* \todo Move the sip_auth list to AST_LIST */
static struct sip_auth *authl = NULL;
@@ -2277,11 +2277,11 @@ static struct sockaddr_in internip;
*
* + with "externip = host[:port]" we specify the address/port explicitly.
* The address is looked up only once when (re)loading the config file;
- *
+ *
* + with "externhost = host[:port]" we do a similar thing, but the
* hostname is stored in externhost, and the hostname->IP mapping
* is refreshed every 'externrefresh' seconds;
- *
+ *
* + with "stunaddr = host[:port]" we run queries every externrefresh seconds
* to the specified server, and store the result in externip.
*
@@ -2310,7 +2310,7 @@ static struct sockaddr_in debugaddr;
static struct ast_config *notify_types; /*!< The list of manual NOTIFY types we know how to send */
/*! some list management macros. */
-
+
#define UNLINK(element, head, prev) do { \
if (prev) \
(prev)->next = (element)->next; \
@@ -2468,11 +2468,11 @@ static int attempt_transfer(struct sip_dual *transferer, struct sip_dual *target
static int do_magic_pickup(struct ast_channel *channel, const char *extension, const char *context);
/*!
- * \brief generic function for determining if a correct transport is being
+ * \brief generic function for determining if a correct transport is being
* used to contact a peer
*
- * this is done as a macro so that the "tmpl" var can be passed either a
- * sip_request or a sip_peer
+ * this is done as a macro so that the "tmpl" var can be passed either a
+ * sip_request or a sip_peer
*/
#define check_request_transport(peer, tmpl) ({ \
int ret = 0; \
@@ -2555,7 +2555,7 @@ static int sip_do_reload(enum channelreloadreason reason);
static char *sip_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen);
-/*--- Debugging
+/*--- Debugging
Functions for enabling debug per IP or fully, or enabling history logging for
a SIP dialog
*/
@@ -2564,7 +2564,7 @@ static inline int sip_debug_test_addr(const struct sockaddr_in *addr);
static inline int sip_debug_test_pvt(struct sip_pvt *p);
-/*! \brief Append to SIP dialog history
+/*! \brief Append to SIP dialog history
\return Always returns 0 */
#define append_history(p, event, fmt , args... ) append_history_full(p, "%-15s " fmt, event, ## args)
static void append_history_full(struct sip_pvt *p, const char *fmt, ...);
@@ -2640,7 +2640,7 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
static void update_connectedline(struct sip_pvt *p, const void *data, size_t datalen);
static void update_redirecting(struct sip_pvt *p, const void *data, size_t datalen);
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 int get_domain(const char *str, char *domain, int len);
static void get_realm(struct sip_pvt *p, const struct sip_request *req);
/*-- TCP connection handling ---*/
@@ -2852,10 +2852,10 @@ static void *sip_tcp_worker_fn(void *data)
return _sip_tcp_helper_thread(NULL, tcptls_session);
}
-/*! \brief SIP TCP thread management function
+/*! \brief SIP TCP thread management function
This function reads from the socket, parses the packet into a request
*/
-static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_session_instance *tcptls_session)
+static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_session_instance *tcptls_session)
{
int res, cl;
struct sip_request req = { 0, } , reqcpy = { 0, };
@@ -2922,7 +2922,7 @@ static void *_sip_tcp_helper_thread(struct sip_pvt *pvt, struct ast_tcptls_sessi
goto cleanup;
}
ast_mutex_unlock(&tcptls_session->lock);
- if (me->stop)
+ if (me->stop)
goto cleanup;
ast_str_append(&req.data, 0, "%s", buf);
req.len = req.data->used;
@@ -3271,8 +3271,8 @@ static unsigned int parse_sip_options(struct sip_pvt *pvt, const char *supported
}
/* This function is used to parse both Suported: and Require: headers.
- Let the caller of this function know that an unknown option tag was
- encountered, so that if the UAC requires it then the request can be
+ Let the caller of this function know that an unknown option tag was
+ encountered, so that if the UAC requires it then the request can be
rejected with a 420 response. */
if (!found)
profile |= SIP_OPT_UNKNOWN;
@@ -3291,7 +3291,7 @@ static unsigned int parse_sip_options(struct sip_pvt *pvt, const char *supported
}
/*! \brief See if we pass debug IP filter */
-static inline int sip_debug_test_addr(const struct sockaddr_in *addr)
+static inline int sip_debug_test_addr(const struct sockaddr_in *addr)
{
if (!sipdebug)
return 0;
@@ -3320,7 +3320,7 @@ static const char *sip_nat_mode(const struct sip_pvt *p)
}
/*! \brief Test PVT for debugging output */
-static inline int sip_debug_test_pvt(struct sip_pvt *p)
+static inline int sip_debug_test_pvt(struct sip_pvt *p)
{
if (!sipdebug)
return 0;
@@ -3365,7 +3365,7 @@ static inline const char *get_transport_list(unsigned int transports) {
case SIP_TRANSPORT_TCP | SIP_TRANSPORT_TLS:
return "TLS,TCP";
default:
- return transports ?
+ return transports ?
"TLS,TCP,UDP" : "UNKNOWN";
}
}
@@ -3400,9 +3400,9 @@ static inline const char *get_transport_pvt(struct sip_pvt *p)
return get_transport(p->socket.type);
}
-/*! \brief Transmit SIP message
+/*! \brief Transmit SIP message
Sends a SIP request or response on a given socket (in the pvt)
- Called by retrans_pkt, send_request, send_response and
+ Called by retrans_pkt, send_request, send_response and
__sip_reliable_xmit
*/
static int __sip_xmit(struct sip_pvt *p, struct ast_str *data, int len)
@@ -3440,7 +3440,7 @@ static int __sip_xmit(struct sip_pvt *p, struct ast_str *data, int len)
case EHOSTUNREACH: /* Host can't be reached */
case ENETDOWN: /* Inteface down */
case ENETUNREACH: /* Network failure */
- case ECONNREFUSED: /* ICMP port unreachable */
+ case ECONNREFUSED: /* ICMP port unreachable */
res = XMIT_ERROR; /* Don't bother with trying to transmit again */
}
}
@@ -3512,7 +3512,7 @@ static void ast_sip_ouraddrfor(struct in_addr *them, struct sockaddr_in *us, str
*us = externip;
else
ast_log(LOG_WARNING, "stun failed\n");
- ast_debug(1, "Target address %s is not local, substituting externip\n",
+ ast_debug(1, "Target address %s is not local, substituting externip\n",
ast_inet_ntoa(*(struct in_addr *)&them->s_addr));
} else if (p) {
/* no remapping, but we bind to a specific address, so use it. */
@@ -3613,7 +3613,7 @@ static int retrans_pkt(const void *data)
pkt->timer_a = 2 ;
else
pkt->timer_a = 2 * pkt->timer_a;
-
+
/* For non-invites, a maximum of 4 secs */
siptimer_a = pkt->timer_t1 * pkt->timer_a; /* Double each time */
if (pkt->method != SIP_INVITE && siptimer_a > 4000)
@@ -3622,7 +3622,7 @@ static int retrans_pkt(const void *data)
/* Reschedule re-transmit */
reschedule = siptimer_a;
ast_debug(4, "** SIP timers: Rescheduling retransmission %d to %d ms (t1 %d ms (Retrans id #%d)) \n", pkt->retrans +1, siptimer_a, pkt->timer_t1, pkt->retransid);
- }
+ }
if (sip_debug_test_pvt(pkt->owner)) {
const struct sockaddr_in *dst = sip_real_dst(pkt->owner);
@@ -3637,9 +3637,9 @@ static int retrans_pkt(const void *data)
sip_pvt_unlock(pkt->owner);
if (xmitres == XMIT_ERROR)
ast_log(LOG_WARNING, "Network error on retransmit in dialog %s\n", pkt->owner->callid);
- else
+ else
return reschedule;
- }
+ }
/* Too many retries */
if (pkt->owner && pkt->method != SIP_OPTIONS && xmitres == 0) {
if (pkt->is_fatal || sipdebug) /* Tell us if it's critical or if we're debugging */
@@ -3649,11 +3649,11 @@ static int retrans_pkt(const void *data)
} else if (pkt->method == SIP_OPTIONS && sipdebug) {
ast_log(LOG_WARNING, "Cancelling retransmit of OPTIONs (call id %s) -- See doc/sip-retransmit.txt.\n", pkt->owner->callid);
- }
+ }
if (xmitres == XMIT_ERROR) {
ast_log(LOG_WARNING, "Transmit error :: Cancelling transmission on Call ID %s\n", pkt->owner->callid);
append_history(pkt->owner, "XmitErr", "%s", pkt->is_fatal ? "(Critical)" : "(Non-critical)");
- } else
+ } else
append_history(pkt->owner, "MaxRetries", "%s", pkt->is_fatal ? "(Critical)" : "(Non-critical)");
pkt->retransid = -1;
@@ -3665,7 +3665,7 @@ static int retrans_pkt(const void *data)
sip_pvt_lock(pkt->owner);
}
- if (pkt->owner->owner && !pkt->owner->owner->hangupcause)
+ if (pkt->owner->owner && !pkt->owner->owner->hangupcause)
pkt->owner->owner->hangupcause = AST_CAUSE_NO_USER_RESPONSE;
if (pkt->owner->owner) {
@@ -3687,7 +3687,7 @@ static int retrans_pkt(const void *data)
if (pkt->method == SIP_BYE) {
/* We're not getting answers on SIP BYE's. Tear down the call anyway. */
- if (pkt->owner->owner)
+ if (pkt->owner->owner)
ast_channel_unlock(pkt->owner->owner);
append_history(pkt->owner, "ByeFailure", "Remote peer doesn't respond to bye. Destroying call anyway.");
pvt_set_needdestroy(pkt->owner, "no response to BYE");
@@ -3713,8 +3713,8 @@ static int retrans_pkt(const void *data)
return 0;
}
-/*! \brief Transmit packet with retransmits
- \return 0 on success, -1 on failure to allocate packet
+/*! \brief Transmit packet with retransmits
+ \return 0 on success, -1 on failure to allocate packet
*/
static enum sip_result __sip_reliable_xmit(struct sip_pvt *p, int seqno, int resp, struct ast_str *data, int len, int fatal, int sipmethod)
{
@@ -3895,7 +3895,7 @@ static int sip_cancel_destroy(struct sip_pvt *p)
return res;
}
-/*! \brief Acknowledges receipt of a packet and stops retransmission
+/*! \brief Acknowledges receipt of a packet and stops retransmission
* called with p locked*/
static int __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
{
@@ -3926,7 +3926,7 @@ static int __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
if (sipdebug)
ast_debug(4, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
}
- /* This odd section is designed to thwart a
+ /* This odd section is designed to thwart a
* race condition in the packet scheduler. There are
* two conditions under which deleting the packet from the
* scheduler can fail.
@@ -4036,7 +4036,7 @@ static int send_response(struct sip_pvt *p, struct sip_request *req, enum xmitty
if (p->do_history) {
struct sip_request tmp = { .rlPart1 = 0, };
parse_copy(&tmp, req);
- append_history(p, reliable ? "TxRespRel" : "TxResp", "%s / %s - %s", tmp.data->str, get_header(&tmp, "CSeq"),
+ append_history(p, reliable ? "TxRespRel" : "TxResp", "%s / %s - %s", tmp.data->str, get_header(&tmp, "CSeq"),
(tmp.method == SIP_RESPONSE || tmp.method == SIP_UNKNOWN) ? REQ_OFFSET_TO_STR(&tmp, rlPart2) : sip_methods[tmp.method].text);
ast_free(tmp.data);
}
@@ -4055,7 +4055,7 @@ static int send_request(struct sip_pvt *p, struct sip_request *req, enum xmittyp
{
int res;
- /* If we have an outbound proxy, reset peer address
+ /* If we have an outbound proxy, reset peer address
Only do this once.
*/
if (p->outboundproxy) {
@@ -4262,7 +4262,7 @@ static char *get_in_brackets(char *tmp)
/*! \brief * parses a URI in its components.
*
- * \note
+ * \note
* - If scheme is specified, drop it from the top.
* - If a component is not requested, do not split around it.
*
@@ -4273,10 +4273,10 @@ static char *get_in_brackets(char *tmp)
* Init pointers to empty string so we never get NULL dereferencing.
* Overwrites the string.
* return 0 on success, other values on error.
- * \verbatim
- * general form we are expecting is sip[s]:username[:password][;parameter]@host[:port][;...]
+ * \verbatim
+ * general form we are expecting is sip[s]:username[:password][;parameter]@host[:port][;...]
* \endverbatim
- *
+ *
*/
static int parse_uri(char *uri, char *scheme,
char **ret_name, char **pass, char **domain, char **port, char **options, char **transport)
@@ -4412,7 +4412,7 @@ static int sip_sendtext(struct ast_channel *ast, const char *text)
return 0;
}
-/*! \brief Update peer object in realtime storage
+/*! \brief Update peer object in realtime storage
If the Asterisk system name is set in asterisk.conf, we will use
that name and store that in the "regserver" field in the sippeers
table to facilitate multi-server setups.
@@ -4610,7 +4610,7 @@ static const char *get_name_from_variable(struct ast_variable *var, const char *
}
/*! \brief realtime_peer: Get peer from realtime storage
- * Checks the "sippeers" realtime family from extconfig.conf
+ * Checks the "sippeers" realtime family from extconfig.conf
* Checks the "sipregs" realtime family from extconfig.conf if it's configured.
* This returns a pointer to a peer and because we use build_peer, we can rest
* assured that the refcount is bumped.
@@ -4828,8 +4828,8 @@ static int find_by_name(void *obj, void *arg, void *data, int flags)
return CMP_MATCH | CMP_STOP;
}
-/*!
- * \brief Locate device by name or ip address
+/*!
+ * \brief Locate device by name or ip address
*
* \param which_objects Define which objects should be matched when doing a lookup
* by name. Valid options are FINDUSERS, FINDPEERS, or FINDALLDEVICES.
@@ -5052,7 +5052,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
(!peer->maxms || ((peer->lastms >= 0) && (peer->lastms <= peer->maxms)))) {
dialog->sa = (peer->addr.sin_addr.s_addr) ? peer->addr : peer->defaddr;
dialog->recv = dialog->sa;
- } else
+ } else
return -1;
ast_copy_flags(&dialog->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
@@ -5136,7 +5136,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
}
}
}
- if (!ast_strlen_zero(peer->fromuser))
+ if (!ast_strlen_zero(peer->fromuser))
ast_string_field_set(dialog, fromuser, peer->fromuser);
if (!ast_strlen_zero(peer->language))
ast_string_field_set(dialog, language, peer->language);
@@ -5170,7 +5170,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
}
/*! \brief create address structure from device name
- * Or, if peer not found, find it in the global DNS
+ * Or, if peer not found, find it in the global DNS
* returns TRUE (-1) on failure, FALSE on success */
static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockaddr_in *sin, int newdialog)
{
@@ -5232,7 +5232,7 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
/* Let's see if we can find the host in DNS. First try DNS SRV records,
then hostname lookup */
- /*! \todo Fix this function. When we ask for SRV, we should check all transports
+ /*! \todo Fix this function. When we ask for SRV, we should check all transports
In the future, we should first check NAPTR to find out transport preference
*/
hostn = peername;
@@ -5292,7 +5292,7 @@ static int auto_congest(const void *arg)
}
-/*! \brief Initiate SIP call from PBX
+/*! \brief Initiate SIP call from PBX
* used from the dial() application */
static int sip_call(struct ast_channel *ast, char *dest, int timeout)
{
@@ -5342,10 +5342,10 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout)
if (sipdebug)
ast_debug(3, "Call for %s transfered by %s\n", p->username, referer);
snprintf(buf, sizeof(buf)-1, "-> %s (via %s)", p->cid_name, referer);
- } else
+ } else
snprintf(buf, sizeof(buf)-1, "-> %s", p->cid_name);
ast_string_field_set(p, cid_name, buf);
- }
+ }
ast_debug(1, "Outgoing Call for %s\n", p->username);
res = update_call_counter(p, INC_CALL_RINGING);
@@ -5373,8 +5373,8 @@ static int sip_call(struct ast_channel *ast, char *dest, int timeout)
p->invitestate = INV_CALLING;
/* Initialize auto-congest time */
- AST_SCHED_REPLACE_UNREF(p->initid, sched, p->timer_b, auto_congest, p,
- dialog_unref(_data, "dialog ptr dec when SCHED_REPLACE del op succeeded"),
+ AST_SCHED_REPLACE_UNREF(p->initid, sched, p->timer_b, auto_congest, p,
+ dialog_unref(_data, "dialog ptr dec when SCHED_REPLACE del op succeeded"),
dialog_unref(p, "dialog ptr dec when SCHED_REPLACE add failed"),
dialog_ref(p, "dialog ptr inc when SCHED_REPLACE add succeeded") );
}
@@ -5543,7 +5543,7 @@ static void __sip_destroy(struct sip_pvt *p, int lockowner, int lockdialoglist)
* This will cause unexpected behaviour in subscriptions, since a "friend"
* is *two* devices in Asterisk, not one.
*
- * Thought: For realtime, we should probably update storage with inuse counter...
+ * Thought: For realtime, we should probably update storage with inuse counter...
*
* \return 0 if call is ok (no call limit, below threshold)
* -1 on rejection of call
@@ -5559,7 +5559,7 @@ static int update_call_counter(struct sip_pvt *fup, int event)
ast_debug(3, "Updating call counter for %s call\n", outgoing ? "outgoing" : "incoming");
- /* Test if we need to check call limits, in order to avoid
+ /* Test if we need to check call limits, in order to avoid
realtime lookups if we do not need it */
if (!ast_test_flag(&fup->flags[0], SIP_CALL_LIMIT) && !ast_test_flag(&fup->flags[1], SIP_PAGE2_CALL_ONHOLD))
return 0;
@@ -5567,7 +5567,7 @@ static int update_call_counter(struct sip_pvt *fup, int event)
ast_copy_string(name, fup->username, sizeof(name));
/* Check the list of devices */
- if ((p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, TRUE, FINDALLDEVICES, FALSE))) {
+ if ((p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, TRUE, FINDALLDEVICES, FALSE))) {
inuse = &p->inUse;
call_limit = &p->call_limit;
inringing = &p->inRinging;
@@ -5636,7 +5636,7 @@ static int update_call_counter(struct sip_pvt *fup, int event)
if (*inuse >= *call_limit) {
ast_log(LOG_NOTICE, "Call %s %s '%s' rejected due to usage limit of %d\n", outgoing ? "to" : "from", "peer", name, *call_limit);
unref_peer(p, "update_call_counter: unref peer p, call limit exceeded");
- return -1;
+ return -1;
}
}
if (inringing && (event == INC_CALL_RINGING)) {
@@ -5686,7 +5686,7 @@ static int update_call_counter(struct sip_pvt *fup, int event)
if (p) {
ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", p->name);
unref_peer(p, "update_call_counter: unref_peer from call counter");
- }
+ }
return 0;
}
@@ -5799,13 +5799,13 @@ static int hangup_sip2cause(int cause)
return 0;
}
-/*! \brief Convert Asterisk hangup causes to SIP codes
+/*! \brief Convert Asterisk hangup causes to SIP codes
\verbatim
Possible values from causes.h
AST_CAUSE_NOTDEFINED AST_CAUSE_NORMAL AST_CAUSE_BUSY
AST_CAUSE_FAILURE AST_CAUSE_CONGESTION AST_CAUSE_UNALLOCATED
- In addition to these, a lot of PRI codes is defined in causes.h
+ In addition to these, a lot of PRI codes is defined in causes.h
...should we take care of them too ?
Quote RFC 3398
@@ -5963,7 +5963,7 @@ static int sip_hangup(struct ast_channel *ast)
ast_module_unref(ast_module_info->self);
/* Do not destroy this pvt until we have timeout or
- get an answer to the BYE or INVITE/CANCEL
+ get an answer to the BYE or INVITE/CANCEL
If we get no answer during retransmit period, drop the call anyway.
(Sorry, mother-in-law, you can't deny a hangup by sending
603 declined to BYE...)
@@ -5994,7 +5994,7 @@ static int sip_hangup(struct ast_channel *ast)
p->invitestate = INV_CANCELLED;
/* Send a new request: CANCEL */
transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);
- /* Actually don't destroy us yet, wait for the 487 on our original
+ /* Actually don't destroy us yet, wait for the 487 on our original
INVITE, but do set an autodestruct just in case we never get it. */
needdestroy = 0;
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
@@ -6003,7 +6003,7 @@ static int sip_hangup(struct ast_channel *ast)
const char *res;
if (p->hangupcause && (res = hangup_cause2sip(p->hangupcause)))
transmit_response_reliable(p, res, &p->initreq);
- else
+ else
transmit_response_reliable(p, "603 Declined", &p->initreq);
p->invitestate = INV_TERMINATED;
}
@@ -6131,7 +6131,7 @@ static void try_suggested_sip_codec(struct sip_pvt *p)
return;
}
-/*! \brief sip_answer: Answer SIP call , send 200 OK on Invite
+/*! \brief sip_answer: Answer SIP call , send 200 OK on Invite
* Part of PBX interface */
static int sip_answer(struct ast_channel *ast)
{
@@ -6163,7 +6163,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
if (!(frame->subclass & ast->nativeformats)) {
char s1[512], s2[512], s3[512];
ast_log(LOG_WARNING, "Asked to transmit frame type %d, while native formats is %s(%d) read/write = %s(%d)/%s(%d)\n",
- frame->subclass,
+ frame->subclass,
ast_getformatname_multiple(s1, sizeof(s1) - 1, ast->nativeformats & AST_FORMAT_AUDIO_MASK),
ast->nativeformats & AST_FORMAT_AUDIO_MASK,
ast_getformatname_multiple(s2, sizeof(s2) - 1, ast->readformat),
@@ -6252,7 +6252,7 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
sip_pvt_unlock(p);
}
break;
- default:
+ default:
ast_log(LOG_WARNING, "Can't send %d type frames with SIP write\n", frame->frametype);
return 0;
}
@@ -6428,9 +6428,9 @@ static void interpret_t38_parameters(struct sip_pvt *p, const struct ast_control
}
}
-/*! \brief Play indication to user
+/*! \brief Play indication to user
* With SIP a lot of indications is sent as messages, letting the device play
- the indication - busy signal, congestion etc
+ the indication - busy signal, congestion etc
\return -1 to force ast_indicate to send indication in audio, 0 if SIP can handle the indication by sending a message
*/
static int sip_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
@@ -6481,7 +6481,7 @@ static int sip_indicate(struct ast_channel *ast, int condition, const void *data
!ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
!ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
transmit_response(p, "100 Trying", &p->initreq);
- p->invitestate = INV_PROCEEDING;
+ p->invitestate = INV_PROCEEDING;
break;
}
res = -1;
@@ -6614,7 +6614,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
/* XXX Why are we choosing a codec from the native formats?? */
fmt = ast_best_codec(tmp->nativeformats);
- /* If we have a prefcodec setting, we have an inbound channel that set a
+ /* If we have a prefcodec setting, we have an inbound channel that set a
preferred format for this call. Otherwise, we check the jointcapability
We also check for vrtp. If it's not there, we are not allowed do any video anyway.
*/
@@ -6634,7 +6634,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
needtext = i->jointcapability & AST_FORMAT_TEXT_MASK; /* Inbound call */
}
- if (needvideo)
+ if (needvideo)
ast_debug(3, "This channel can handle video! HOLLYWOOD next!\n");
else
ast_debug(3, "This channel will not be able to handle video.\n");
@@ -6659,7 +6659,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
ast_channel_set_fd(tmp, 3, ast_rtp_instance_fd(i->vrtp, 1));
}
- if (needtext && i->trtp)
+ if (needtext && i->trtp)
ast_channel_set_fd(tmp, 4, ast_rtp_instance_fd(i->trtp, 0));
if (i->udptl)
ast_channel_set_fd(tmp, 5, ast_udptl_fd(i->udptl));
@@ -6764,7 +6764,7 @@ static const char *get_sdp_iterate(int *start, struct sip_request *req, const ch
}
/*! \brief Get a line from an SDP message body */
-static const char *get_sdp(struct sip_request *req, const char *name)
+static const char *get_sdp(struct sip_request *req, const char *name)
{
int dummy = 0;
@@ -6772,7 +6772,7 @@ static const char *get_sdp(struct sip_request *req, const char *name)
}
/*! \brief Get a specific line from the message body */
-static char *get_body(struct sip_request *req, char *name, char delimiter)
+static char *get_body(struct sip_request *req, char *name, char delimiter)
{
int x;
int len = strlen(name);
@@ -6833,7 +6833,7 @@ static const char *__get_header(const struct sip_request *req, const char *name,
/*
* Technically you can place arbitrary whitespace both before and after the ':' in
* a header, although RFC3261 clearly says you shouldn't before, and place just
- * one afterwards. If you shouldn't do it, what absolute idiot decided it was
+ * one afterwards. If you shouldn't do it, what absolute idiot decided it was
* a good idea to say you can do it, and if you can do it, why in the hell would.
* you say you shouldn't.
* Anyways, pedanticsipchecking controls whether we allow spaces before ':',
@@ -6862,7 +6862,7 @@ static const char *__get_header(const struct sip_request *req, const char *name,
return "";
}
-/*! \brief Get header from SIP request
+/*! \brief Get header from SIP request
\return Always return something, so don't check for NULL because it won't happen :-)
*/
static const char *get_header(const struct sip_request *req, const char *name)
@@ -7184,7 +7184,7 @@ static int find_call_cb(void *__pvt, void *__arg, int flags)
found = !strcmp(p->callid, arg->callid);
if (sip_cfg.pedanticsipchecking && found) {
found = ast_strlen_zero(arg->tag) || ast_strlen_zero(p->theirtag) || !ast_test_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED) || !strcmp(p->theirtag, arg->tag);
- }
+ }
}
ast_debug(5, "= %s Their Call ID: %s Their Tag %s Our tag: %s\n", found ? "Found" : "No match", p->callid, p->theirtag, p->tag);
@@ -7288,7 +7288,7 @@ restartsearch:
}
ao2_unlock(dialogs);
}
-
+
/* See if the method is capable of creating a dialog */
if (sip_methods[intended_method].can_create == CAN_CREATE_DIALOG) {
if (intended_method == SIP_REFER) {
@@ -7305,7 +7305,7 @@ restartsearch:
sip_pvt_lock(p);
} else {
/* We have a memory or file/socket error (can't allocate RTP sockets or something) so we're not
- getting a dialog from sip_alloc.
+ getting a dialog from sip_alloc.
Without a dialog we can't retransmit and handle ACKs and all that, but at least
send an error message.
@@ -7639,7 +7639,7 @@ static void mark_parsed_methods(unsigned int *methods, char *methods_str)
* We parse the allow header on incoming Registrations and save the
* result to the SIP peer that is registering. When the registration
* expires, we clear what we know about the peer's allowed methods.
- * When the peer re-registers, we once again parse to see if the
+ * When the peer re-registers, we once again parse to see if the
* list of allowed methods has changed.
*
* For peers that do not register, we parse the first message we receive
@@ -7704,51 +7704,51 @@ static unsigned int set_pvt_allowed_methods(struct sip_pvt *pvt, struct sip_requ
/*! \brief Parse multiline SIP headers into one header
This is enabled if pedanticsipchecking is enabled */
-static int lws2sws(char *msgbuf, int len)
-{
- int h = 0, t = 0;
- int lws = 0;
-
- for (; h < len;) {
- /* Eliminate all CRs */
- if (msgbuf[h] == '\r') {
- h++;
- continue;
- }
- /* Check for end-of-line */
- if (msgbuf[h] == '\n') {
- /* Check for end-of-message */
- if (h + 1 == len)
- break;
- /* Check for a continuation line */
- if (msgbuf[h + 1] == ' ' || msgbuf[h + 1] == '\t') {
- /* Merge continuation line */
- h++;
- continue;
- }
- /* Propagate LF and start new line */
- msgbuf[t++] = msgbuf[h++];
+static int lws2sws(char *msgbuf, int len)
+{
+ int h = 0, t = 0;
+ int lws = 0;
+
+ for (; h < len;) {
+ /* Eliminate all CRs */
+ if (msgbuf[h] == '\r') {
+ h++;
+ continue;
+ }
+ /* Check for end-of-line */
+ if (msgbuf[h] == '\n') {
+ /* Check for end-of-message */
+ if (h + 1 == len)
+ break;
+ /* Check for a continuation line */
+ if (msgbuf[h + 1] == ' ' || msgbuf[h + 1] == '\t') {
+ /* Merge continuation line */
+ h++;
+ continue;
+ }
+ /* Propagate LF and start new line */
+ msgbuf[t++] = msgbuf[h++];
lws = 0;
- continue;
- }
- if (msgbuf[h] == ' ' || msgbuf[h] == '\t') {
- if (lws) {
- h++;
- continue;
- }
- msgbuf[t++] = msgbuf[h++];
- lws = 1;
- continue;
- }
- msgbuf[t++] = msgbuf[h++];
- if (lws)
- lws = 0;
- }
- msgbuf[t] = '\0';
- return t;
-}
-
-/*! \brief Parse a SIP message
+ continue;
+ }
+ if (msgbuf[h] == ' ' || msgbuf[h] == '\t') {
+ if (lws) {
+ h++;
+ continue;
+ }
+ msgbuf[t++] = msgbuf[h++];
+ lws = 1;
+ continue;
+ }
+ msgbuf[t++] = msgbuf[h++];
+ if (lws)
+ lws = 0;
+ }
+ msgbuf[t] = '\0';
+ return t;
+}
+
+/*! \brief Parse a SIP message
\note this function is used both on incoming and outgoing packets
*/
static int parse_request(struct sip_request *req)
@@ -8078,14 +8078,14 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
memset(p->offered_media, 0, sizeof(p->offered_media));
- /* Store the SDP version number of remote UA. This will allow us to
- distinguish between session modifications and session refreshes. If
- the remote UA does not send an incremented SDP version number in a
- subsequent RE-INVITE then that means its not changing media session.
- The RE-INVITE may have been sent to update connected party, remote
- target or to refresh the session (Session-Timers). Asterisk must not
- change media session and increment its own version number in answer
- SDP in this case. */
+ /* Store the SDP version number of remote UA. This will allow us to
+ distinguish between session modifications and session refreshes. If
+ the remote UA does not send an incremented SDP version number in a
+ subsequent RE-INVITE then that means its not changing media session.
+ The RE-INVITE may have been sent to update connected party, remote
+ target or to refresh the session (Session-Timers). Asterisk must not
+ change media session and increment its own version number in answer
+ SDP in this case. */
o = get_sdp(req, "o");
if (ast_strlen_zero(o)) {
@@ -8095,17 +8095,17 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
o_copy = ast_strdupa(o);
token = strsep(&o_copy, " "); /* Skip username */
- if (!o_copy) {
+ if (!o_copy) {
ast_log(LOG_WARNING, "SDP syntax error in o= line username\n");
return -1;
}
token = strsep(&o_copy, " "); /* Skip session-id */
- if (!o_copy) {
+ if (!o_copy) {
ast_log(LOG_WARNING, "SDP syntax error in o= line session-id\n");
return -1;
}
token = strsep(&o_copy, " "); /* Version */
- if (!o_copy) {
+ if (!o_copy) {
ast_log(LOG_WARNING, "SDP syntax error in o= line\n");
return -1;
}
@@ -8147,7 +8147,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_debug(2, "Call %s responded to our reinvite without changing SDP version; ignoring SDP.\n", p->callid);
return 0;
}
- }
+ }
/* Try to find first media stream */
m = get_sdp(req, "m");
@@ -8253,14 +8253,14 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_verbose("Found RTP text format %d\n", codec);
ast_rtp_codecs_payloads_set_m_type(&newtextrtp, NULL, codec);
}
- } else if (p->udptl && ( (sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) ||
+ } else if (p->udptl && ( (sscanf(m, "image %30d udptl t38%n", &x, &len) == 1 && len > 0) ||
(sscanf(m, "image %30d UDPTL t38%n", &x, &len) == 1 && len > 0) )) {
if (debug)
ast_verbose("Got T.38 offer in SDP in dialog %s\n", p->callid);
p->offered_media[SDP_IMAGE].offered = TRUE;
udptlportno = x;
numberofmediastreams++;
- } else
+ } else
ast_log(LOG_WARNING, "Unsupported SDP media type in offer: %s\n", m);
if (numberofports > 1)
ast_log(LOG_WARNING, "SDP offered %d ports for media, not supported by Asterisk. Will try anyway...\n", numberofports);
@@ -8517,7 +8517,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
last_rtpmap_codec++;
} else {
ast_rtp_codecs_payloads_unset(&newvideortp, NULL, codec);
- if (debug)
+ if (debug)
ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
}
} else if (!strncasecmp(mimeSubtype, "T140", 4)) { /* Text */
@@ -8529,7 +8529,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
if (p->trtp) {
ast_rtp_codecs_payloads_set_rtpmap_type_rate(&newtextrtp, NULL, codec, "text", mimeSubtype, 0, sample_rate);
red_pt = codec;
- sprintf(red_fmtp, "fmtp:%d ", red_pt);
+ sprintf(red_fmtp, "fmtp:%d ", red_pt);
if (debug)
ast_verbose("RED submimetype has payload type: %d\n", red_pt);
@@ -8543,7 +8543,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
last_rtpmap_codec++;
} else {
ast_rtp_codecs_payloads_unset(&newaudiortp, NULL, codec);
- if (debug)
+ if (debug)
ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
}
}
@@ -8669,7 +8669,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_rtp_codecs_payload_formats(&newaudiortp, &peercapability, &peernoncodeccapability);
ast_rtp_codecs_payload_formats(&newvideortp, &vpeercapability, &vpeernoncodeccapability);
ast_rtp_codecs_payload_formats(&newtextrtp, &tpeercapability, &tpeernoncodeccapability);
-
+
newjointcapability = p->capability & (peercapability | vpeercapability | tpeercapability);
newpeercapability = (peercapability | vpeercapability | tpeercapability);
newnoncodeccapability = p->noncodeccapability & peernoncodeccapability;
@@ -8756,14 +8756,14 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
/* Setup video port number */
if (p->vrtp && vsin.sin_port) {
ast_rtp_instance_set_remote_address(p->vrtp, &vsin);
- if (debug)
+ if (debug)
ast_verbose("Peer video RTP is at port %s:%d\n", ast_inet_ntoa(vsin.sin_addr), ntohs(vsin.sin_port));
}
/* Setup text port number */
if (p->trtp && tsin.sin_port) {
ast_rtp_instance_set_remote_address(p->trtp, &tsin);
- if (debug)
+ if (debug)
ast_verbose("Peer text RTP is at port %s:%d\n", ast_inet_ntoa(tsin.sin_addr), ntohs(tsin.sin_port));
}
@@ -8778,7 +8778,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
if (!(p->owner->nativeformats & p->jointcapability) && (p->jointcapability & AST_FORMAT_AUDIO_MASK)) {
if (debug) {
char s1[SIPBUFSIZE], s2[SIPBUFSIZE];
- ast_debug(1, "Oooh, we need to change our audio formats since our peer supports only %s and not %s\n",
+ ast_debug(1, "Oooh, we need to change our audio formats since our peer supports only %s and not %s\n",
ast_getformatname_multiple(s1, SIPBUFSIZE, p->jointcapability),
ast_getformatname_multiple(s2, SIPBUFSIZE, p->owner->nativeformats));
}
@@ -8805,7 +8805,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD); /* Clear both flags */
} else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1)) {
int already_on_hold = ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD);
- ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
+ ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
S_OR(p->mohsuggest, NULL),
!ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
if (sendonly)
@@ -8820,7 +8820,7 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
"Status: On\r\n"
"Channel: %s\r\n"
"Uniqueid: %s\r\n",
- p->owner->name,
+ p->owner->name,
p->owner->uniqueid);
}
if (sendonly == 1) /* One directional hold (sendonly/recvonly) */
@@ -8955,7 +8955,7 @@ static int copy_via_headers(struct sip_pvt *p, struct sip_request *req, const st
/* Find ;rport; (empty request) */
rport = strstr(leftmost, ";rport");
- if (rport && *(rport+6) == '=')
+ if (rport && *(rport+6) == '=')
rport = NULL; /* We already have a parameter to rport */
if (((ast_test_flag(&p->flags[0], SIP_NAT_FORCE_RPORT)) || (rport && ast_test_flag(&p->flags[0], SIP_NAT_RPORT_PRESENT)))) {
@@ -9023,14 +9023,14 @@ static void add_route(struct sip_request *req, struct sip_route *route)
add_header(req, "Route", r);
}
-/*! \brief Set destination from SIP URI
+/*! \brief Set destination from SIP URI
*
- * Parse uri to h (host) and port - uri is already just the part inside the <>
- * general form we are expecting is sip[s]:username[:password][;parameter]@host[:port][;...]
+ * Parse uri to h (host) and port - uri is already just the part inside the <>
+ * general form we are expecting is sip[s]:username[:password][;parameter]@host[:port][;...]
* If there's a port given, turn NAPTR/SRV off. NAPTR might indicate SIPS preference even
* for SIP: uri's
*
- * If there's a sips: uri scheme, TLS will be required.
+ * If there's a sips: uri scheme, TLS will be required.
*/
static void set_destination(struct sip_pvt *p, char *uri)
{
@@ -9059,7 +9059,7 @@ static void set_destination(struct sip_pvt *p, char *uri)
}
}
hn = strcspn(h, ":;>") + 1;
- if (hn > sizeof(hostname))
+ if (hn > sizeof(hostname))
hn = sizeof(hostname);
ast_copy_string(hostname, h, hn);
/* XXX bug here if string has been trimmed to sizeof(hostname) */
@@ -9222,7 +9222,7 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg
/* If this is an invite, add Session-Timers related headers if the feature is active for this session */
if (p->method == SIP_INVITE && p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) {
char se_hdr[256];
- snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
+ snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
strefresher2str(p->stimer->st_ref));
add_header(resp, "Require", "timer");
add_header(resp, "Session-Expires", se_hdr);
@@ -9295,15 +9295,15 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
if (sipmethod == SIP_CANCEL)
c = REQ_OFFSET_TO_STR(&p->initreq, rlPart2); /* Use original URI */
else if (sipmethod == SIP_ACK) {
- /* Use URI from Contact: in 200 OK (if INVITE)
+ /* Use URI from Contact: in 200 OK (if INVITE)
(we only have the contacturi on INVITEs) */
if (!ast_strlen_zero(p->okcontacturi))
c = is_strict ? p->route->hop : p->okcontacturi;
else
c = REQ_OFFSET_TO_STR(&p->initreq, rlPart2);
- } else if (!ast_strlen_zero(p->okcontacturi))
+ } else if (!ast_strlen_zero(p->okcontacturi))
c = is_strict ? p->route->hop : p->okcontacturi; /* Use for BYE or REINVITE */
- else if (!ast_strlen_zero(p->uri))
+ else if (!ast_strlen_zero(p->uri))
c = p->uri;
else {
char *n;
@@ -9364,16 +9364,16 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
}
/* Add Session-Timers related headers if the feature is active for this session.
- An exception to this behavior is the ACK request. Since Asterisk never requires
- session-timers support from a remote end-point (UAS) in an INVITE, it must
- not send 'Require: timer' header in the ACK request.
+ An exception to this behavior is the ACK request. Since Asterisk never requires
+ session-timers support from a remote end-point (UAS) in an INVITE, it must
+ not send 'Require: timer' header in the ACK request.
This should only be added in the INVITE transactions, not MESSAGE or REFER or other
in-dialog messages.
*/
- if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE
+ if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE
&& sipmethod == SIP_INVITE) {
char se_hdr[256];
- snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
+ snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
strefresher2str(p->stimer->st_ref));
add_header(req, "Require", "timer");
add_header(req, "Session-Expires", se_hdr);
@@ -9449,7 +9449,7 @@ static int transmit_response_using_temp(ast_string_field callid, struct sockaddr
* E.g. certainly the threadstorage should be left alone,
* but other thihngs such as flags etc. maybe need cleanup ?
*/
-
+
/* Initialize the bare minimum */
p->method = intended_method;
@@ -9486,13 +9486,13 @@ static int transmit_response_using_temp(ast_string_field callid, struct sockaddr
}
/*! \brief Transmit response, no retransmits */
-static int transmit_response(struct sip_pvt *p, const char *msg, const struct sip_request *req)
+static int transmit_response(struct sip_pvt *p, const char *msg, const struct sip_request *req)
{
return __transmit_response(p, msg, req, XMIT_UNRELIABLE);
}
/*! \brief Transmit response, no retransmits */
-static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *unsupported)
+static int transmit_response_with_unsupported(struct sip_pvt *p, const char *msg, const struct sip_request *req, const char *unsupported)
{
struct sip_request resp;
respprep(&resp, p, msg, req);
@@ -9573,7 +9573,7 @@ static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, const
/* Choose Realm */
get_realm(p, req);
- /* Stale means that they sent us correct authentication, but
+ /* Stale means that they sent us correct authentication, but
based it on an old challenge (nonce) */
snprintf(tmp, sizeof(tmp), "Digest algorithm=MD5, realm=\"%s\", nonce=\"%s\"%s", p->realm, randdata, stale ? ", stale=true" : "");
respprep(&resp, p, msg, req);
@@ -9583,10 +9583,10 @@ static int transmit_response_with_auth(struct sip_pvt *p, const char *msg, const
return send_response(p, &resp, reliable, seqno);
}
-/*!
+/*!
\brief Extract domain from SIP To/From header
\return -1 on error, 1 if domain string is empty, 0 if domain was properly extracted
- \note TODO: Such code is all over SIP channel, there is a sense to organize
+ \note TODO: Such code is all over SIP channel, there is a sense to organize
this patern in one function
*/
static int get_domain(const char *str, char *domain, int len)
@@ -9623,9 +9623,9 @@ static int get_domain(const char *str, char *domain, int len)
return ast_strlen_zero(domain);
}
-/*!
- \brief Choose realm based on From header and then To header or use globaly configured realm.
- Realm from From/To header should be listed among served domains in config file: domain=...
+/*!
+ \brief Choose realm based on From header and then To header or use globaly configured realm.
+ Realm from From/To header should be listed among served domains in config file: domain=...
*/
static void get_realm(struct sip_pvt *p, const struct sip_request *req)
{
@@ -9667,7 +9667,7 @@ static int add_text(struct sip_request *req, const char *text)
return 0;
}
-/*! \brief Add DTMF INFO tone to sip message
+/*! \brief Add DTMF INFO tone to sip message
Mode = 0 for application/dtmf-relay (Cisco)
1 for application/dtmf
*/
@@ -9701,7 +9701,7 @@ static int add_digit(struct sip_request *req, char digit, unsigned int duration,
/*!
* \pre if p->owner exists, it must be locked
- * \brief Add Remote-Party-ID header to SIP message
+ * \brief Add Remote-Party-ID header to SIP message
*/
static int add_rpid(struct sip_request *req, struct sip_pvt *p)
{
@@ -9782,7 +9782,7 @@ static int add_rpid(struct sip_request *req, struct sip_pvt *p)
return 0;
}
-/*! \brief add XML encoded media control with update
+/*! \brief add XML encoded media control with update
\note XML: The only way to turn 0 bits of information into a few hundred. (markster) */
static int add_vidupdate(struct sip_request *req)
{
@@ -9906,7 +9906,7 @@ static void add_tcodec_to_sdp(const struct sip_pvt *p, int codec,
if (codec == AST_FORMAT_T140RED) {
int t140code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(p->trtp), 1, AST_FORMAT_T140);
- ast_str_append(a_buf, 0, "a=fmtp:%d %d/%d/%d\r\n", rtp_code,
+ ast_str_append(a_buf, 0, "a=fmtp:%d %d/%d/%d\r\n", rtp_code,
t140code,
t140code,
t140code);
@@ -9956,7 +9956,7 @@ static void add_noncodec_to_sdp(const struct sip_pvt *p, int format,
ast_str_append(a_buf, 0, "a=fmtp:%d 0-16\r\n", rtp_code);
}
-/*! \brief Set all IP media addresses for this call
+/*! \brief Set all IP media addresses for this call
\note called from add_sdp()
*/
static void get_our_media_address(struct sip_pvt *p, int needvideo,
@@ -9992,11 +9992,11 @@ static void get_our_media_address(struct sip_pvt *p, int needvideo,
}
-/*! \brief Add Session Description Protocol message
+/*! \brief Add Session Description Protocol message
If oldsdp is TRUE, then the SDP version number is not incremented. This mechanism
- is used in Session-Timers where RE-INVITEs are used for refreshing SIP sessions
- without modifying the media session in any way.
+ is used in Session-Timers where RE-INVITEs are used for refreshing SIP sessions
+ without modifying the media session in any way.
*/
static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int oldsdp, int add_audio, int add_t38)
{
@@ -10050,7 +10050,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
ast_log(LOG_WARNING, "No way to add SDP without an RTP structure\n");
return AST_FAILURE;
}
- /* XXX We should not change properties in the SIP dialog until
+ /* XXX We should not change properties in the SIP dialog until
we have acceptance of the offer if this is a re-invite */
/* Set RTP Session ID and version */
@@ -10080,7 +10080,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
capability = p->jointcapability;
/* XXX note, Video and Text are negated - 'true' means 'no' */
- ast_debug(1, "** Our capability: %s Video flag: %s Text flag: %s\n", ast_getformatname_multiple(codecbuf, sizeof(codecbuf), capability),
+ ast_debug(1, "** Our capability: %s Video flag: %s Text flag: %s\n", ast_getformatname_multiple(codecbuf, sizeof(codecbuf), capability),
p->novideo ? "True" : "False", p->notext ? "True" : "False");
ast_debug(1, "** Our prefcodec: %s \n", ast_getformatname_multiple(codecbuf, sizeof(codecbuf), p->prefcodec));
@@ -10088,7 +10088,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
if (capability & AST_FORMAT_AUDIO_MASK)
needaudio = TRUE;
- if (debug)
+ if (debug)
ast_verbose("Audio is at %s port %d\n", ast_inet_ntoa(p->ourip.sin_addr), ntohs(sin.sin_port));
/* Ok, we need video. Let's add what we need for video and set codecs.
@@ -10099,7 +10099,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
/* Build max bitrate string */
if (p->maxcallbitrate)
snprintf(bandwidth, sizeof(bandwidth), "b=CT:%d\r\n", p->maxcallbitrate);
- if (debug)
+ if (debug)
ast_verbose("Video is at %s port %d\n", ast_inet_ntoa(p->ourip.sin_addr), ntohs(vdest.sin_port));
}
@@ -10155,7 +10155,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
- Then other codecs in capabilities, including video
*/
- /* Prefer the audio codec we were requested to use, first, no matter what
+ /* Prefer the audio codec we were requested to use, first, no matter what
Note that p->prefcodec can include video codecs, so mask them out
*/
if (capability & p->prefcodec) {
@@ -10170,7 +10170,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
int codec;
if (!(codec = ast_codec_pref_index(&p->prefs, x)))
- break;
+ break;
if (!(capability & codec))
continue;
@@ -10221,7 +10221,7 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
/* XXX don't think you can have ptime for text */
if (min_text_packet_size)
ast_str_append(&a_text, 0, "a=ptime:%d\r\n", min_text_packet_size);
-
+
if (m_audio->len - m_audio->used < 2 || m_video->len - m_video->used < 2 ||
m_text->len - m_text->used < 2 || a_text->len - a_text->used < 2 ||
a_audio->len - a_audio->used < 2 || a_video->len - a_video->used < 2)
@@ -10362,7 +10362,7 @@ static int transmit_response_with_t38_sdp(struct sip_pvt *p, char *msg, struct s
respprep(&resp, p, msg, req);
if (p->udptl) {
add_sdp(&resp, p, 0, 0, 1);
- } else
+ } else
ast_log(LOG_ERROR, "Can't add SDP to response, since we have no UDPTL session allocated. Call-ID %s\n", p->callid);
if (retrans && !p->pendinginvite)
p->pendinginvite = seqno; /* Buggy clients sends ACK on RINGING too */
@@ -10393,7 +10393,7 @@ static void copy_request(struct sip_request *dst, const struct sip_request *src)
dst->data->used = src->data->used;
}
-/*! \brief Used for 200 OK and 183 early media
+/*! \brief Used for 200 OK and 183 early media
\return Will return XMIT_ERROR for network errors.
*/
static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const struct sip_request *req, enum xmittype reliable, int oldsdp, int rpid)
@@ -10419,7 +10419,7 @@ static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const
} else {
add_sdp(&resp, p, oldsdp, TRUE, FALSE);
}
- } else
+ } else
ast_log(LOG_ERROR, "Can't add SDP to response, since we have no RTP session allocated. Call-ID %s\n", p->callid);
if (reliable && !p->pendinginvite)
p->pendinginvite = seqno; /* Buggy clients sends ACK on RINGING too */
@@ -10427,7 +10427,7 @@ static int transmit_response_with_sdp(struct sip_pvt *p, const char *msg, const
}
/*! \brief Parse first line of incoming SIP request */
-static int determine_firstline_parts(struct sip_request *req)
+static int determine_firstline_parts(struct sip_request *req)
{
char *e = ast_skip_blanks(req->data->str); /* there shouldn't be any */
char *local_rlPart1;
@@ -10454,7 +10454,7 @@ static int determine_firstline_parts(struct sip_request *req)
ast_debug(3, "Oops. Bogus uri in <> %s\n", e);
e++;
if (!*e)
- return -1;
+ return -1;
}
req->rlPart2 = e - req->data->str; /* URI */
e = ast_skip_nonblanks(e);
@@ -10471,7 +10471,7 @@ static int determine_firstline_parts(struct sip_request *req)
/*! \brief Transmit reinvite with SDP
\note A re-invite is basically a new INVITE with the same CALL-ID and TAG as the
- INVITE that opened the SIP dialogue
+ INVITE that opened the SIP dialogue
We reinvite so that the audio stream (RTP) go directly between
the SIP UAs. SIP Signalling stays with * in the path.
@@ -10480,7 +10480,7 @@ static int determine_firstline_parts(struct sip_request *req)
If oldsdp is TRUE then the SDP version number is not incremented. This
is needed for Session-Timers so we can send a re-invite to refresh the
- SIP session without modifying the media session.
+ SIP session without modifying the media session.
*/
static int transmit_reinvite_with_sdp(struct sip_pvt *p, int t38version, int oldsdp)
{
@@ -10603,7 +10603,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
d = S_OR(p->fromdomain, ast_inet_ntoa(p->ourip.sin_addr));
if (p->owner && (p->owner->connected.id.number_presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
- l = p->owner->connected.id.number;
+ l = p->owner->connected.id.number;
n = p->owner->connected.id.name;
} else if (p->owner && (p->owner->connected.id.number_presentation & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED && (!ast_test_flag(&p->flags[0], SIP_SENDRPID))) {
/* if we are not sending RPID and user wants his callerid restricted */
@@ -10680,7 +10680,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
which may or may not be the destination of the call
*/
ast_string_field_set(p, uri, invite->str);
-
+
if (!ast_strlen_zero(p->todnid)) {
/*! \todo Need to add back the VXML URL here at some point, possibly use build_string for all this junk */
if (!strchr(p->todnid, '@')) {
@@ -10690,13 +10690,13 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
snprintf(to, sizeof(to), "%s%s", p->todnid, ast_strlen_zero(p->theirtag) ? "" : ";tag=", p->theirtag);
}
} else {
- if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) {
+ if (sipmethod == SIP_NOTIFY && !ast_strlen_zero(p->theirtag)) {
/* If this is a NOTIFY, use the From: tag in the subscribe (RFC 3265) */
snprintf(to, sizeof(to), "<%s%s>;tag=%s", (!strncasecmp(p->uri, "sip:", 4) ? "sip:" : ""), p->uri, p->theirtag);
} else if (p->options && p->options->vxml_url) {
/* If there is a VXML URL append it to the SIP URL */
snprintf(to, sizeof(to), "<%s>;%s", p->uri, p->options->vxml_url);
- } else
+ } else
snprintf(to, sizeof(to), "<%s>", p->uri);
}
@@ -10761,12 +10761,12 @@ static void add_diversion_header(struct sip_request *req, struct sip_pvt *pvt)
add_header(req, "Diversion", header_text);
}
-/*! \brief Build REFER/INVITE/OPTIONS/SUBSCRIBE message and transmit it
+/*! \brief Build REFER/INVITE/OPTIONS/SUBSCRIBE message and transmit it
\param init 0 = Prepare request within dialog, 1= prepare request, new branch, 2= prepare new request and new dialog. do_proxy_auth calls this with init!=2
\param p sip_pvt structure
- \param sdp unknown
- \param sipmethod unknown
-
+ \param sdp unknown
+ \param sipmethod unknown
+
*/
static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init)
{
@@ -10851,7 +10851,7 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init)
ast_log(LOG_WARNING, "No Headp for the channel...ooops!\n");
else {
const struct ast_var_t *current;
- AST_LIST_TRAVERSE(headp, current, entries) {
+ AST_LIST_TRAVERSE(headp, current, entries) {
/* SIPADDHEADER: Add SIP header to outgoing call */
if (!strncasecmp(ast_var_name(current), "SIPADDHEADER", strlen("SIPADDHEADER"))) {
char *content, *end;
@@ -11143,7 +11143,7 @@ static void state_notify_build_xml(int state, int full, const char *exten, const
/* We create a fake call-id which the phone will send back in an INVITE
Replaces header which we can grab and do some magic with. */
- ast_str_append(tmp, 0,
+ ast_str_append(tmp, 0,
"