Asterisk - The Open Source Telephony Project  18.5.0
Data Structures | Macros | Enumerations
sip.h File Reference

chan_sip header file More...

#include "asterisk.h"
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
#include "asterisk/strings.h"
#include "asterisk/tcptls.h"
#include "asterisk/test.h"
#include "asterisk/channel.h"
#include "asterisk/app.h"
#include "asterisk/indications.h"
#include "asterisk/security_events.h"
#include "asterisk/features.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/netsock2.h"
#include "asterisk/features_config.h"
#include "route.h"
Include dependency graph for sip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  __show_chan_arg
 argument for the 'show channels|subscriptions' callback. More...
 
struct  _map_x_s
 generic struct to map between strings and integers. Fill it with x-s pairs, terminate with an entry with s = NULL; Then you can call map_x_s(...) to map an integer to a string, and map_s_x() for the string -> integer mapping. More...
 
struct  cc_epa_entry
 Instance data for a Call completion EPA entry. More...
 
struct  cfsip_options
 List of well-known SIP options. If we get this in a require, we should check the list and answer accordingly. More...
 
struct  digestkeys
 
struct  domain
 Domain data structure. More...
 
struct  epa_backend
 backend for an event publication agent More...
 
struct  epa_static_data
 
struct  offered_media
 Structure for remembering offered media in an INVITE, to make sure we reply to all media streams. More...
 
struct  sip_pvt::request_queue
 
struct  sip_auth
 sip_auth: Credentials for authentication to other SIP services More...
 
struct  sip_auth_container
 Container of SIP authentication credentials. More...
 
struct  sip_cc_agent_pvt
 
struct  sip_epa_entry
 
struct  sip_esc_entry
 common ESC items for all event types More...
 
struct  sip_esc_publish_callbacks
 Callbacks for SIP ESCs. More...
 
struct  sip_history
 sip_history: Structure for saving transactions within a SIP dialog More...
 
struct  sip_invite_param
 Parameters to the transmit_invite function. More...
 
struct  sip_mailbox
 A peer's mailbox. More...
 
struct  sip_monitor_instance
 
struct  sip_msg_hdr
 
struct  sip_notify
 Struct to handle custom SIP notify requests. Dynamically allocated when needed. More...
 
struct  sip_peer
 Structure for SIP peer data, we place calls to peers if registered or fixed IP address (host) More...
 
struct  sip_pkt
 sip packet - raw format for outbound packets that are sent or scheduled for transmission Packets are linked in a list, whose head is in the struct sip_pvt they belong to. Each packet holds a reference to the parent struct sip_pvt. This structure is allocated in __sip_reliable_xmit() and only for packets that require retransmissions. More...
 
struct  sip_proxy
 definition of a sip proxy server More...
 
struct  sip_pvt
 Structure used for each SIP dialog, ie. a call, a registration, a subscribe. Created and initialized by sip_alloc(), the descriptor goes into the list of descriptors (dialoglist). More...
 
struct  sip_refer
 Structure to handle SIP transfers. Dynamically allocated when needed. More...
 
struct  sip_registry
 Registrations with other SIP proxies. More...
 
struct  sip_request
 sip_request: The data grabbed from the UDP socket More...
 
struct  sip_settings
 a place to store all global settings for the sip channel driver More...
 
struct  sip_socket
 The SIP socket definition. More...
 
struct  sip_st_cfg
 Structure that encapsulates all attributes related to configuration of SIP Session-Timers feature on a per user/peer basis. More...
 
struct  sip_st_dlg
 Structure that encapsulates all attributes related to running SIP Session-Timers feature on a per dialog basis. More...
 
struct  sip_subscription_mwi
 Definition of an MWI subscription to another server. More...
 
struct  sip_threadinfo
 Definition of a thread that handles a socket. More...
 
struct  sip_via
 Structure to store Via information. More...
 
struct  t38properties
 T.38 channel settings (at some point we need to make this alloc'ed. More...
 
struct  tcptls_packet
 

Macros

#define ALLOWED_METHODS   "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE"
 SIP Methods we support. More...
 
#define CALLERID_UNKNOWN   "Anonymous"
 
#define DEC_CALL_LIMIT   0
 
#define DEC_CALL_RINGING   2
 
#define DEFAULT_AUTHLIMIT   100
 
#define DEFAULT_AUTHTIMEOUT   30
 
#define DEFAULT_DEFAULT_EXPIRY   120
 
#define DEFAULT_EXPIRY   900
 
#define DEFAULT_FREQ_NOTOK   10 * 1000
 
#define DEFAULT_MAX_EXPIRY   3600
 
#define DEFAULT_MAX_FORWARDS   70
 
#define DEFAULT_MAX_SE   1800
 
#define DEFAULT_MAXMS   2000
 
#define DEFAULT_MIN_EXPIRY   60
 
#define DEFAULT_MIN_SE   90
 
#define DEFAULT_MWI_EXPIRY   3600
 
#define DEFAULT_QUALIFY_GAP   100
 
#define DEFAULT_QUALIFY_PEERS   1
 
#define DEFAULT_QUALIFYFREQ   60 * 1000
 
#define DEFAULT_REGISTRATION_TIMEOUT   20
 
#define DEFAULT_RETRANS   1000
 
#define DEFAULT_TIMER_T1   500
 
#define DEFAULT_TRANS_TIMEOUT   -1
 
#define EXPIRY_GUARD_LIMIT   30
 
#define EXPIRY_GUARD_MIN   500
 
#define EXPIRY_GUARD_PCT   0.20
 
#define EXPIRY_GUARD_SECS   15
 
#define FALSE   0
 
#define FINDALLDEVICES   (FINDUSERS | FINDPEERS)
 
#define FINDPEERS   (1 << 1)
 
#define FINDUSERS   (1 << 0)
 
#define FROMDOMAIN_INVALID   "anonymous.invalid"
 
#define INC_CALL_LIMIT   1
 
#define INC_CALL_RINGING   3
 
#define INITIAL_CSEQ   101
 
#define MAX_AUTHTRIES   3
 
#define MAX_HISTORY_ENTRIES   50
 
#define NO_RTP   0
 
#define NOT_SUPPORTED   0
 
#define OFFERED_MEDIA_COUNT   4
 The number of media types in enum media_type below. More...
 
#define PROVIS_KEEPALIVE_TIMEOUT   60000
 
#define RTP   1
 
#define SDP_MAX_RTPMAP_CODECS   32
 
#define SIP_MAX_HEADERS   64
 
#define SIP_MAX_LINES   256
 
#define SIP_MAX_PACKET_SIZE   20480
 
#define SIP_MIN_PACKET   4096
 
#define SIP_OPT_100REL   (1 << 1)
 
#define SIP_OPT_EARLY_SESSION   (1 << 3)
 
#define SIP_OPT_EVENTLIST   (1 << 11)
 
#define SIP_OPT_FROMCHANGE   (1 << 17)
 
#define SIP_OPT_GRUU   (1 << 12)
 
#define SIP_OPT_HISTINFO   (1 << 15)
 
#define SIP_OPT_JOIN   (1 << 4)
 
#define SIP_OPT_NOREFERSUB   (1 << 14)
 
#define SIP_OPT_OUTBOUND   (1 << 20)
 
#define SIP_OPT_PATH   (1 << 5)
 
#define SIP_OPT_PRECONDITION   (1 << 7)
 
#define SIP_OPT_PREF   (1 << 6)
 
#define SIP_OPT_PRIVACY   (1 << 8)
 
#define SIP_OPT_RECLISTINV   (1 << 18)
 
#define SIP_OPT_RECLISTSUB   (1 << 19)
 
#define SIP_OPT_REPLACES   (1 << 0)
 
#define SIP_OPT_RESPRIORITY   (1 << 16)
 
#define SIP_OPT_SDP_ANAT   (1 << 9)
 
#define SIP_OPT_SEC_AGREE   (1 << 10)
 
#define SIP_OPT_TARGET_DIALOG   (1 << 13)
 
#define SIP_OPT_TIMER   (1 << 2)
 
#define SIP_OPT_UNKNOWN   (1 << 21)
 
#define SIP_RESERVED   ";/?:@&=+$,# "
 
#define SIP_TRANS_TIMEOUT   64 * DEFAULT_TIMER_T1
 
#define SIPBUFSIZE   512
 
#define STANDARD_SIP_PORT   5060
 Standard SIP unsecure port for UDP and TCP from RFC 3261. DO NOT CHANGE THIS. More...
 
#define STANDARD_TLS_PORT   5061
 Standard SIP TLS port from RFC 3261. DO NOT CHANGE THIS. More...
 
#define SUPPORTED   1
 
#define TRUE   1
 
#define XMIT_ERROR   -2
 
DefaultValues Default values, set and reset in reload_config before reading configuration
Note
in many SIP headers, absence of a port number implies port 5060, and this is why we cannot change the above constant. There is a limited number of places in asterisk where we could, in principle, use a different "default" port number, but we do not support this feature at the moment. You can run Asterisk with SIP on a different port with a configuration option. If you change this value in the source code, the signalling will be incorrect.

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

#define DEFAULT_CONTEXT   "default"
 
#define DEFAULT_RECORD_FEATURE   "automon"
 
#define DEFAULT_MOHINTERPRET   "default"
 
#define DEFAULT_MOHSUGGEST   ""
 
#define DEFAULT_VMEXTEN   "asterisk"
 
#define DEFAULT_CALLERID   "asterisk"
 
#define DEFAULT_MWI_FROM   ""
 
#define DEFAULT_NOTIFYMIME   "application/simple-message-summary"
 
#define DEFAULT_ALLOWGUEST   TRUE
 
#define DEFAULT_RTPKEEPALIVE   0
 
#define DEFAULT_CALLCOUNTER   FALSE
 
#define DEFAULT_SRVLOOKUP   TRUE
 
#define DEFAULT_COMPACTHEADERS   FALSE
 
#define DEFAULT_TOS_SIP   0
 
#define DEFAULT_TOS_AUDIO   0
 
#define DEFAULT_TOS_VIDEO   0
 
#define DEFAULT_TOS_TEXT   0
 
#define DEFAULT_COS_SIP   4
 
#define DEFAULT_COS_AUDIO   5
 
#define DEFAULT_COS_VIDEO   6
 
#define DEFAULT_COS_TEXT   5
 
#define DEFAULT_ALLOW_EXT_DOM   TRUE
 
#define DEFAULT_REALM   "asterisk"
 
#define DEFAULT_DOMAINSASREALM   FALSE
 
#define DEFAULT_NOTIFYRINGING   NOTIFYRINGING_ENABLED
 
#define DEFAULT_NOTIFYCID   DISABLED
 
#define DEFAULT_PEDANTIC   TRUE
 
#define DEFAULT_AUTOCREATEPEER   AUTOPEERS_DISABLED
 
#define DEFAULT_MATCHEXTERNADDRLOCALLY   FALSE
 
#define DEFAULT_QUALIFY   FALSE
 
#define DEFAULT_KEEPALIVE   0
 
#define DEFAULT_KEEPALIVE_INTERVAL   60
 
#define DEFAULT_ALWAYSAUTHREJECT   TRUE
 
#define DEFAULT_AUTH_OPTIONS   FALSE
 
#define DEFAULT_AUTH_MESSAGE   TRUE
 
#define DEFAULT_ACCEPT_OUTOFCALL_MESSAGE   TRUE
 
#define DEFAULT_REGEXTENONQUALIFY   FALSE
 
#define DEFAULT_LEGACY_USEROPTION_PARSING   FALSE
 
#define DEFAULT_SEND_DIVERSION   TRUE
 
#define DEFAULT_T1MIN   100
 
#define DEFAULT_MAX_CALL_BITRATE   (384)
 
#define DEFAULT_USERAGENT   "Asterisk PBX"
 
#define DEFAULT_SDPSESSION   "Asterisk PBX"
 
#define DEFAULT_SDPOWNER   "root"
 
#define DEFAULT_ENGINE   "asterisk"
 
#define DEFAULT_STORE_SIP_CAUSE   FALSE
 
SIPflags

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 G: Global flag 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)
 
#define SIP_OFFER_CC   (1 << 1)
 
#define SIP_RINGING   (1 << 2)
 
#define SIP_PROGRESS_SENT   (1 << 3)
 
#define SIP_NEEDREINVITE   (1 << 4)
 
#define SIP_PENDINGBYE   (1 << 5)
 
#define SIP_GOTREFER   (1 << 6)
 
#define SIP_CALL_LIMIT   (1 << 7)
 
#define SIP_INC_COUNT   (1 << 8)
 
#define SIP_INC_RINGING   (1 << 9)
 
#define SIP_DEFER_BYE_ON_TRANSFER   (1 << 10)
 
#define SIP_PROMISCREDIR   (1 << 11)
 
#define SIP_TRUSTRPID   (1 << 12)
 
#define SIP_USEREQPHONE   (1 << 13)
 
#define SIP_USECLIENTCODE   (1 << 14)
 
#define SIP_DTMF   (7 << 15)
 
#define SIP_DTMF_RFC2833   (0 << 15)
 
#define SIP_DTMF_INBAND   (1 << 15)
 
#define SIP_DTMF_INFO   (2 << 15)
 
#define SIP_DTMF_AUTO   (3 << 15)
 
#define SIP_DTMF_SHORTINFO   (4 << 15)
 
#define SIP_NAT_FORCE_RPORT   (1 << 18)
 
#define SIP_NAT_RPORT_PRESENT   (1 << 19)
 
#define SIP_REINVITE   (7 << 20)
 
#define SIP_REINVITE_NONE   (0 << 20)
 
#define SIP_DIRECT_MEDIA   (1 << 20)
 
#define SIP_DIRECT_MEDIA_NAT   (2 << 20)
 
#define SIP_REINVITE_UPDATE   (4 << 20)
 
#define SIP_INSECURE   (3 << 23)
 
#define SIP_INSECURE_NONE   (0 << 23)
 
#define SIP_INSECURE_PORT   (1 << 23)
 
#define SIP_INSECURE_INVITE   (1 << 24)
 
#define SIP_PROG_INBAND   (3 << 25)
 
#define SIP_PROG_INBAND_NO   (0 << 25)
 
#define SIP_PROG_INBAND_NEVER   (1 << 25)
 
#define SIP_PROG_INBAND_YES   (2 << 25)
 
#define SIP_USEPATH   (1 << 27)
 
#define SIP_SENDRPID   (3 << 29)
 
#define SIP_SENDRPID_NO   (0 << 29)
 
#define SIP_SENDRPID_PAI   (1 << 29)
 
#define SIP_SENDRPID_RPID   (2 << 29)
 
#define SIP_G726_NONSTANDARD   (1 << 31)
 
#define SIP_FLAGS_TO_COPY
 Flags to copy from peer/user to dialog. More...
 
SIPflags2

a second page of flags (for flags[1]

#define SIP_PAGE2_RTCACHEFRIENDS   (1 << 0)
 
#define SIP_PAGE2_RTAUTOCLEAR   (1 << 1)
 
#define SIP_PAGE2_RPID_UPDATE   (1 << 2)
 
#define SIP_PAGE2_Q850_REASON   (1 << 3)
 
#define SIP_PAGE2_SYMMETRICRTP   (1 << 4)
 
#define SIP_PAGE2_STATECHANGEQUEUE   (1 << 5)
 
#define SIP_PAGE2_CONNECTLINEUPDATE_PEND   (1 << 6)
 
#define SIP_PAGE2_RPID_IMMEDIATE   (1 << 7)
 
#define SIP_PAGE2_RPORT_PRESENT   (1 << 8)
 
#define SIP_PAGE2_PREFERRED_CODEC   (1 << 9)
 
#define SIP_PAGE2_VIDEOSUPPORT   (1 << 10)
 
#define SIP_PAGE2_TEXTSUPPORT   (1 << 11)
 
#define SIP_PAGE2_ALLOWSUBSCRIBE   (1 << 12)
 
#define SIP_PAGE2_ALLOWOVERLAP   (3 << 13)
 
#define SIP_PAGE2_ALLOWOVERLAP_NO   (0 << 13)
 
#define SIP_PAGE2_ALLOWOVERLAP_YES   (1 << 13)
 
#define SIP_PAGE2_ALLOWOVERLAP_DTMF   (2 << 13)
 
#define SIP_PAGE2_ALLOWOVERLAP_SPARE   (3 << 13)
 
#define SIP_PAGE2_SUBSCRIBEMWIONLY   (1 << 15)
 
#define SIP_PAGE2_IGNORESDPVERSION   (1 << 16)
 
#define SIP_PAGE2_T38SUPPORT   (3 << 17)
 
#define SIP_PAGE2_T38SUPPORT_UDPTL   (1 << 17)
 
#define SIP_PAGE2_T38SUPPORT_UDPTL_FEC   (2 << 17)
 
#define SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY   (3 << 17)
 
#define SIP_PAGE2_CALL_ONHOLD   (3 << 19)
 
#define SIP_PAGE2_CALL_ONHOLD_ACTIVE   (1 << 19)
 
#define SIP_PAGE2_CALL_ONHOLD_ONEDIR   (2 << 19)
 
#define SIP_PAGE2_CALL_ONHOLD_INACTIVE   (3 << 19)
 
#define SIP_PAGE2_RFC2833_COMPENSATE   (1 << 21)
 
#define SIP_PAGE2_BUGGY_MWI   (1 << 22)
 
#define SIP_PAGE2_DIALOG_ESTABLISHED   (1 << 23)
 
#define SIP_PAGE2_FAX_DETECT   (3 << 24)
 
#define SIP_PAGE2_FAX_DETECT_CNG   (1 << 24)
 
#define SIP_PAGE2_FAX_DETECT_T38   (2 << 24)
 
#define SIP_PAGE2_FAX_DETECT_BOTH   (3 << 24)
 
#define SIP_PAGE2_UDPTL_DESTINATION   (1 << 26)
 
#define SIP_PAGE2_VIDEOSUPPORT_ALWAYS   (1 << 27)
 
#define SIP_PAGE2_HAVEPEERCONTEXT   (1 << 28) /*< Are we associated with a configured peer context? */
 
#define SIP_PAGE2_USE_SRTP   (1 << 29)
 
#define SIP_PAGE2_TRUST_ID_OUTBOUND   (3 << 30)
 
#define SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY   (0 << 30)
 
#define SIP_PAGE2_TRUST_ID_OUTBOUND_NO   (1 << 30)
 
#define SIP_PAGE2_TRUST_ID_OUTBOUND_YES   (2 << 30)
 
#define SIP_PAGE2_FLAGS_TO_COPY
 
#define SIP_PAGE3_SNOM_AOC   (1 << 0)
 
#define SIP_PAGE3_SRTP_TAG_32   (1 << 1)
 
#define SIP_PAGE3_NAT_AUTO_RPORT   (1 << 2)
 
#define SIP_PAGE3_NAT_AUTO_COMEDIA   (1 << 3)
 
#define SIP_PAGE3_DIRECT_MEDIA_OUTGOING   (1 << 4)
 
#define SIP_PAGE3_USE_AVPF   (1 << 5)
 
#define SIP_PAGE3_ICE_SUPPORT   (1 << 6)
 
#define SIP_PAGE3_IGNORE_PREFCAPS   (1 << 7)
 
#define SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL   (1 << 8)
 
#define SIP_PAGE3_FORCE_AVP   (1 << 9)
 
#define SIP_PAGE3_RTCP_MUX   (1 << 10)
 
#define SIP_PAGE3_FLAGS_TO_COPY
 
#define CHECK_AUTH_BUF_INITLEN   256
 

Enumerations

enum  autocreatepeer_mode { AUTOPEERS_DISABLED = 0, AUTOPEERS_VOLATILE, AUTOPEERS_PERSIST }
 Automatic peer registration behavior. More...
 
enum  can_create_dialog { CAN_NOT_CREATE_DIALOG, CAN_CREATE_DIALOG, CAN_CREATE_DIALOG_UNSUPPORTED_METHOD }
 States whether a SIP message can create a dialog in Asterisk. More...
 
enum  check_auth_result {
  AUTH_DONT_KNOW = -100, AUTH_SUCCESSFUL = 0, AUTH_CHALLENGE_SENT = 1, AUTH_SECRET_FAILED = -1,
  AUTH_USERNAME_MISMATCH = -2, AUTH_NOT_FOUND = -3, AUTH_UNKNOWN_DOMAIN = -5, AUTH_PEER_NOT_DYNAMIC = -6,
  AUTH_ACL_FAILED = -7, AUTH_BAD_TRANSPORT = -8, AUTH_RTP_FAILED = -9, AUTH_SESSION_LIMIT = -10
}
 Authentication result from check_auth* functions. More...
 
enum  digest_keys {
  K_RESP, K_URI, K_USER, K_NONCE,
  K_LAST
}
 
enum  domain_mode { SIP_DOMAIN_AUTO, SIP_DOMAIN_CONFIG }
 Modes for SIP domain handling in the PBX. More...
 
enum  inv_req_result { INV_REQ_SUCCESS = 11, INV_REQ_FAILED = 10, INV_REQ_ERROR = 9 }
 The results from handling an invite request. More...
 
enum  invitestates {
  INV_NONE = 0, INV_CALLING = 1, INV_PROCEEDING = 2, INV_EARLY_MEDIA = 3,
  INV_COMPLETED = 4, INV_CONFIRMED = 5, INV_TERMINATED = 6, INV_CANCELLED = 7
}
 States for the INVITE transaction, not the dialog. More...
 
enum  media_type {
  SDP_AUDIO, SDP_VIDEO, SDP_IMAGE, SDP_TEXT,
  SDP_UNKNOWN
}
 Media types generate different "dummy answers" for not accepting the offer of a media stream. We need to add definitions for each RTP profile. Secure RTP is not the same as normal RTP and will require a new definition. More...
 
enum  notifycid_setting { DISABLED = 0, ENABLED = 1, IGNORE_CONTEXT = 2 }
 Settings for the 'notifycid' option, see sip.conf.sample for details. More...
 
enum  notifyringing_setting { NOTIFYRINGING_DISABLED = 0, NOTIFYRINGING_ENABLED = 1, NOTIFYRINGING_NOTINUSE = 2 }
 Setting for the 'notifyringing' option, see sip.conf.sample for details. More...
 
enum  parse_register_result { PARSE_REGISTER_DENIED, PARSE_REGISTER_FAILED, PARSE_REGISTER_UPDATE, PARSE_REGISTER_QUERY }
 Results from the parse_register() function. More...
 
enum  referstatus {
  REFER_IDLE, REFER_SENT, REFER_RECEIVED, REFER_CONFIRMED,
  REFER_ACCEPTED, REFER_RINGING, REFER_200OK, REFER_FAILED,
  REFER_NOAUTH
}
 Parameters to know status of transfer. More...
 
enum  sip_auth_type { PROXY_AUTH = 407, WWW_AUTH = 401 }
 Authentication types - proxy or www authentication. More...
 
enum  sip_debug_e { sip_debug_none = 0, sip_debug_config = 1, sip_debug_console = 2 }
 debugging state We store separately the debugging requests from the config file and requests from the CLI. Debugging is enabled if either is set (which means that if sipdebug is set in the config file, we can only turn it off by reloading the config). More...
 
enum  sip_get_dest_result {
  SIP_GET_DEST_EXTEN_MATCHMORE = 1, SIP_GET_DEST_EXTEN_FOUND = 0, SIP_GET_DEST_EXTEN_NOT_FOUND = -1, SIP_GET_DEST_REFUSED = -2,
  SIP_GET_DEST_INVALID_URI = -3
}
 Result from get_destination function. More...
 
enum  sip_peer_type { SIP_TYPE_PEER = (1 << 0), SIP_TYPE_USER = (1 << 1) }
 
enum  sip_result { AST_SUCCESS = 0, AST_FAILURE = -1 }
 The result of a lot of functions. More...
 
enum  sip_tcptls_alert { TCPTLS_ALERT_DATA, TCPTLS_ALERT_STOP }
 
enum  sipmethod {
  SIP_UNKNOWN, SIP_RESPONSE, SIP_REGISTER, SIP_OPTIONS,
  SIP_NOTIFY, SIP_INVITE, SIP_ACK, SIP_PRACK,
  SIP_BYE, SIP_REFER, SIP_SUBSCRIBE, SIP_MESSAGE,
  SIP_UPDATE, SIP_INFO, SIP_CANCEL, SIP_PUBLISH,
  SIP_PING
}
 SIP Request methods known by Asterisk. More...
 
enum  sipregistrystate {
  REG_STATE_UNREGISTERED = 0, REG_STATE_REGSENT, REG_STATE_AUTHSENT, REG_STATE_REGISTERED,
  REG_STATE_REJECTED, REG_STATE_TIMEOUT, REG_STATE_NOAUTH, REG_STATE_FAILED
}
 States for outbound registrations (with register= lines in sip.conf. More...
 
enum  st_mode { SESSION_TIMER_MODE_INVALID = 0, SESSION_TIMER_MODE_ACCEPT, SESSION_TIMER_MODE_ORIGINATE, SESSION_TIMER_MODE_REFUSE }
 Modes in which Asterisk can be configured to run SIP Session-Timers. More...
 
enum  st_refresher { SESSION_TIMER_REFRESHER_AUTO, SESSION_TIMER_REFRESHER_US, SESSION_TIMER_REFRESHER_THEM }
 The entity playing the refresher role for Session-Timers. More...
 
enum  st_refresher_param { SESSION_TIMER_REFRESHER_PARAM_UNKNOWN, SESSION_TIMER_REFRESHER_PARAM_UAC, SESSION_TIMER_REFRESHER_PARAM_UAS }
 
enum  subscriptiontype {
  NONE = 0, XPIDF_XML, DIALOG_INFO_XML, CPIM_PIDF_XML,
  PIDF_XML, MWI_NOTIFICATION, CALL_COMPLETION
}
 Type of subscription, based on the packages we do support, see subscription_types. More...
 
enum  t38_action_flag { SDP_T38_NONE = 0, SDP_T38_INITIATE, SDP_T38_ACCEPT }
 
enum  t38state {
  T38_DISABLED = 0, T38_LOCAL_REINVITE, T38_PEER_REINVITE, T38_ENABLED,
  T38_REJECTED
}
 T38 States for a call. More...
 
enum  transfermodes { TRANSFER_OPENFORALL, TRANSFER_CLOSED }
 Authorization scheme for call transfers. More...
 
enum  xmittype { XMIT_CRITICAL = 2, XMIT_RELIABLE = 1, XMIT_UNRELIABLE = 0 }
 When sending a SIP message, we can send with a few options, depending on type of SIP request. UNRELIABLE is moslty used for responses to repeated requests, where the original response would be sent RELIABLE in an INVITE transaction. More...
 

GlobalSettings

Global settings apply to the channel (often settings you can change in the general section of sip.conf

#define REQ_OFFSET_TO_STR(req, offset)   (ast_str_buffer((req)->data) + ((req)->offset))
 
#define sip_ref_peer(peer, tag)   ao2_t_bump(peer, tag)
 
#define sip_unref_peer(peer, tag)   ({ ao2_t_cleanup(peer, tag); (NULL); })
 
enum  sip_mailbox_status { SIP_MAILBOX_STATUS_UNKNOWN = 0, SIP_MAILBOX_STATUS_EXISTING, SIP_MAILBOX_STATUS_NEW }
 
enum  sip_cc_publish_state { CC_CLOSED, CC_OPEN }
 The states that can be represented in a SIP call-completion PUBLISH. More...
 
enum  sip_cc_notify_state { CC_QUEUED, CC_READY }
 The states that can be represented in a SIP call-completion NOTIFY. More...
 
enum  sip_publish_type {
  SIP_PUBLISH_UNKNOWN, SIP_PUBLISH_INITIAL, SIP_PUBLISH_REFRESH, SIP_PUBLISH_MODIFY,
  SIP_PUBLISH_REMOVE, SIP_PUBLISH_UNKNOWN, SIP_PUBLISH_INITIAL, SIP_PUBLISH_REFRESH,
  SIP_PUBLISH_MODIFY, SIP_PUBLISH_REMOVE
}
 The types of PUBLISH messages defined in RFC 3903. More...
 
typedef int(*const esc_publish_callback) (struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *)
 
static const struct cfsip_options sip_options []
 
static struct ast_threadstorage check_auth_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_check_auth_buf , .custom_init = NULL , }
 
static void __init_check_auth_buf (void)
 
struct sip_peersip_find_peer (const char *peer, struct ast_sockaddr *addr, int realtime, int which_objects, int devstate_only, int transport)
 Locate device by name or ip address. More...
 
void sip_auth_headers (enum sip_auth_type code, char **header, char **respheader)
 return the request and response header for a 401 or 407 code More...
 
const char * sip_get_header (const struct sip_request *req, const char *name)
 Get header from SIP request. More...
 
const char * sip_get_transport (enum ast_transport t)
 Return transport as string. More...
 

Detailed Description

chan_sip header file

Definition in file sip.h.

Macro Definition Documentation

◆ ALLOWED_METHODS

#define ALLOWED_METHODS   "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE"

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.

Definition at line 173 of file sip.h.

Referenced by respprep(), transmit_invite(), transmit_notify_with_sipfrag(), transmit_reinvite_with_sdp(), and update_connectedline().

◆ CALLERID_UNKNOWN

#define CALLERID_UNKNOWN   "Anonymous"

Definition at line 93 of file sip.h.

Referenced by initreqprep().

◆ CHECK_AUTH_BUF_INITLEN

#define CHECK_AUTH_BUF_INITLEN   256

Definition at line 401 of file sip.h.

Referenced by check_auth(), sip_report_security_event(), and transmit_fake_auth_response().

◆ DEC_CALL_LIMIT

#define DEC_CALL_LIMIT   0

◆ DEC_CALL_RINGING

#define DEC_CALL_RINGING   2

Definition at line 129 of file sip.h.

Referenced by handle_response_invite(), and update_call_counter().

◆ DEFAULT_ACCEPT_OUTOFCALL_MESSAGE

#define DEFAULT_ACCEPT_OUTOFCALL_MESSAGE   TRUE

Definition at line 232 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_ALLOW_EXT_DOM

#define DEFAULT_ALLOW_EXT_DOM   TRUE

Allow external domains

Definition at line 218 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_ALLOWGUEST

#define DEFAULT_ALLOWGUEST   TRUE

Definition at line 205 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_ALWAYSAUTHREJECT

#define DEFAULT_ALWAYSAUTHREJECT   TRUE

Don't reject authentication requests always

Definition at line 229 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_AUTH_MESSAGE

#define DEFAULT_AUTH_MESSAGE   TRUE

Definition at line 231 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_AUTH_OPTIONS

#define DEFAULT_AUTH_OPTIONS   FALSE

Definition at line 230 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_AUTHLIMIT

#define DEFAULT_AUTHLIMIT   100

Definition at line 69 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_AUTHTIMEOUT

#define DEFAULT_AUTHTIMEOUT   30

Definition at line 70 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_AUTOCREATEPEER

#define DEFAULT_AUTOCREATEPEER   AUTOPEERS_DISABLED

Don't create peers automagically

Definition at line 224 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_CALLCOUNTER

#define DEFAULT_CALLCOUNTER   FALSE

Do not enable call counters by default

Definition at line 207 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_CALLERID

#define DEFAULT_CALLERID   "asterisk"

Default caller ID

Definition at line 202 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_COMPACTHEADERS

#define DEFAULT_COMPACTHEADERS   FALSE

Send compact (one-character) SIP headers. Default off

Definition at line 209 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_CONTEXT

#define DEFAULT_CONTEXT   "default"

The default context for [general] section as well as devices

Definition at line 197 of file sip.h.

◆ DEFAULT_COS_AUDIO

#define DEFAULT_COS_AUDIO   5

Level 2 class of service for audio media

Definition at line 215 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_COS_SIP

#define DEFAULT_COS_SIP   4

Level 2 class of service for SIP signalling

Definition at line 214 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_COS_TEXT

#define DEFAULT_COS_TEXT   5

Level 2 class of service for text media (T.140)

Definition at line 217 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_COS_VIDEO

#define DEFAULT_COS_VIDEO   6

Level 2 class of service for video media

Definition at line 216 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_DEFAULT_EXPIRY

#define DEFAULT_DEFAULT_EXPIRY   120

Definition at line 62 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_DOMAINSASREALM

#define DEFAULT_DOMAINSASREALM   FALSE

Use the domain option to guess the realm for registration and invite requests

Definition at line 220 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_ENGINE

#define DEFAULT_ENGINE   "asterisk"

Default RTP engine to use for sessions

Definition at line 242 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_EXPIRY

#define DEFAULT_EXPIRY   900

Expire slowly

Definition at line 88 of file sip.h.

◆ DEFAULT_FREQ_NOTOK

#define DEFAULT_FREQ_NOTOK   10 * 1000

Qualification: How often to check, if the host is down...

Definition at line 98 of file sip.h.

◆ DEFAULT_KEEPALIVE

#define DEFAULT_KEEPALIVE   0

Don't send keep alive packets

Definition at line 227 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_KEEPALIVE_INTERVAL

#define DEFAULT_KEEPALIVE_INTERVAL   60

Send keep alive packets at 60 second intervals

Definition at line 228 of file sip.h.

Referenced by build_peer(), and reload_config().

◆ DEFAULT_LEGACY_USEROPTION_PARSING

#define DEFAULT_LEGACY_USEROPTION_PARSING   FALSE

Definition at line 234 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MATCHEXTERNADDRLOCALLY

#define DEFAULT_MATCHEXTERNADDRLOCALLY   FALSE

Match extern IP locally default setting

Definition at line 225 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MAX_CALL_BITRATE

#define DEFAULT_MAX_CALL_BITRATE   (384)

Max bitrate for video

Definition at line 237 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MAX_EXPIRY

#define DEFAULT_MAX_EXPIRY   3600

Definition at line 64 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MAX_FORWARDS

#define DEFAULT_MAX_FORWARDS   70

Definition at line 67 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MAX_SE

#define DEFAULT_MAX_SE   1800

Session-Timer Default Session-Expires period (RFC 4028)

Definition at line 119 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MAXMS

#define DEFAULT_MAXMS   2000

Qualification: Must be faster than 2 seconds by default

Definition at line 96 of file sip.h.

◆ DEFAULT_MIN_EXPIRY

#define DEFAULT_MIN_EXPIRY   60

Definition at line 63 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MIN_SE

#define DEFAULT_MIN_SE   90

Session-Timer Default Min-SE period (RFC 4028)

Definition at line 120 of file sip.h.

Referenced by build_peer(), reload_config(), and transmit_invite().

◆ DEFAULT_MOHINTERPRET

#define DEFAULT_MOHINTERPRET   "default"

The default music class

Definition at line 199 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MOHSUGGEST

#define DEFAULT_MOHSUGGEST   ""

Definition at line 200 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MWI_EXPIRY

#define DEFAULT_MWI_EXPIRY   3600

Definition at line 65 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_MWI_FROM

#define DEFAULT_MWI_FROM   ""

Definition at line 203 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_NOTIFYCID

#define DEFAULT_NOTIFYCID   DISABLED

Include CID with ringing notifications

Definition at line 222 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_NOTIFYMIME

#define DEFAULT_NOTIFYMIME   "application/simple-message-summary"

Definition at line 204 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_NOTIFYRINGING

#define DEFAULT_NOTIFYRINGING   NOTIFYRINGING_ENABLED

Notify devicestate system on ringing state

Definition at line 221 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_PEDANTIC

#define DEFAULT_PEDANTIC   TRUE

Follow SIP standards for dialog matching

Definition at line 223 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_QUALIFY

#define DEFAULT_QUALIFY   FALSE

Don't monitor devices

Definition at line 226 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_QUALIFY_GAP

#define DEFAULT_QUALIFY_GAP   100

Definition at line 90 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_QUALIFY_PEERS

#define DEFAULT_QUALIFY_PEERS   1

Definition at line 91 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_QUALIFYFREQ

#define DEFAULT_QUALIFYFREQ   60 * 1000

Qualification: How often to check for the host to be up

Definition at line 97 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_REALM

#define DEFAULT_REALM   "asterisk"

Realm for HTTP digest authentication

Definition at line 219 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_RECORD_FEATURE

#define DEFAULT_RECORD_FEATURE   "automon"

The default feature specified for use with INFO

Definition at line 198 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_REGEXTENONQUALIFY

#define DEFAULT_REGEXTENONQUALIFY   FALSE

Definition at line 233 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_REGISTRATION_TIMEOUT

#define DEFAULT_REGISTRATION_TIMEOUT   20

Definition at line 66 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_RETRANS

#define DEFAULT_RETRANS   1000

How frequently to retransmit Default: 2 * 500 ms in RFC 3261

Definition at line 100 of file sip.h.

◆ DEFAULT_RTPKEEPALIVE

#define DEFAULT_RTPKEEPALIVE   0

Default RTPkeepalive setting

Definition at line 206 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_SDPOWNER

#define DEFAULT_SDPOWNER   "root"

Default SDP username field in (o=) header unless re-defined in sip.conf

Definition at line 241 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_SDPSESSION

#define DEFAULT_SDPSESSION   "Asterisk PBX"

Default SDP session name, (s=) header unless re-defined in sip.conf

Definition at line 240 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_SEND_DIVERSION

#define DEFAULT_SEND_DIVERSION   TRUE

Definition at line 235 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_SRVLOOKUP

#define DEFAULT_SRVLOOKUP   TRUE

Recommended setting is ON

Definition at line 208 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_STORE_SIP_CAUSE

#define DEFAULT_STORE_SIP_CAUSE   FALSE

Don't store HASH(SIP_CAUSE,<channel name>) for channels by default

Definition at line 243 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_T1MIN

#define DEFAULT_T1MIN   100

100 MS for minimal roundtrip time

Definition at line 236 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_TIMER_T1

#define DEFAULT_TIMER_T1   500

SIP timer T1 (according to RFC 3261)

Definition at line 101 of file sip.h.

Referenced by __sip_reliable_xmit(), and reload_config().

◆ DEFAULT_TOS_AUDIO

#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.

Definition at line 211 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_TOS_SIP

#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.

Definition at line 210 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_TOS_TEXT

#define DEFAULT_TOS_TEXT   0

Text packets should be marked as XXXX XXXX, but the default is 0 to be compatible with previous versions.

Definition at line 213 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_TOS_VIDEO

#define DEFAULT_TOS_VIDEO   0

Video packets should be marked as DSCP AF41, but the default is 0 to be compatible with previous versions.

Definition at line 212 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_TRANS_TIMEOUT

#define DEFAULT_TRANS_TIMEOUT   -1

◆ DEFAULT_USERAGENT

#define DEFAULT_USERAGENT   "Asterisk PBX"

Default Useragent: header unless re-defined in sip.conf

Definition at line 239 of file sip.h.

Referenced by reload_config().

◆ DEFAULT_VMEXTEN

#define DEFAULT_VMEXTEN   "asterisk"

Default voicemail extension

Definition at line 201 of file sip.h.

Referenced by reload_config().

◆ EXPIRY_GUARD_LIMIT

#define EXPIRY_GUARD_LIMIT   30

Below here, we use EXPIRY_GUARD_PCT instead of EXPIRY_GUARD_SECS

Definition at line 75 of file sip.h.

Referenced by handle_response_register().

◆ EXPIRY_GUARD_MIN

#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.

Definition at line 76 of file sip.h.

Referenced by handle_response_register().

◆ EXPIRY_GUARD_PCT

#define EXPIRY_GUARD_PCT   0.20

Percentage of expires timeout to use when below EXPIRY_GUARD_LIMIT

Definition at line 85 of file sip.h.

Referenced by handle_response_register().

◆ EXPIRY_GUARD_SECS

#define EXPIRY_GUARD_SECS   15

How long before expiry do we reregister

Definition at line 74 of file sip.h.

Referenced by handle_response_register().

◆ FALSE

#define FALSE   0

Definition at line 44 of file sip.h.

◆ FINDALLDEVICES

#define FINDALLDEVICES   (FINDUSERS | FINDPEERS)

Definition at line 54 of file sip.h.

Referenced by check_peer_ok(), find_by_name(), sip_devicestate(), and sip_find_peer_full().

◆ FINDPEERS

#define FINDPEERS   (1 << 1)

◆ FINDUSERS

#define FINDUSERS   (1 << 0)

Definition at line 52 of file sip.h.

Referenced by check_peer_ok(), find_by_name(), realtime_peer(), sip_find_peer_full(), and sip_show_user().

◆ FROMDOMAIN_INVALID

#define FROMDOMAIN_INVALID   "anonymous.invalid"

Definition at line 94 of file sip.h.

Referenced by initreqprep().

◆ INC_CALL_LIMIT

#define INC_CALL_LIMIT   1

Definition at line 128 of file sip.h.

Referenced by handle_request_invite(), and update_call_counter().

◆ INC_CALL_RINGING

#define INC_CALL_RINGING   3

Definition at line 130 of file sip.h.

Referenced by sip_call(), and update_call_counter().

◆ INITIAL_CSEQ

#define INITIAL_CSEQ   101

Our initial sip sequence number

Definition at line 117 of file sip.h.

Referenced by __sip_alloc(), AST_TEST_DEFINE(), sip_parse_register_line(), and transmit_response_using_temp().

◆ MAX_AUTHTRIES

#define MAX_AUTHTRIES   3

Try authentication three times, then fail

Definition at line 109 of file sip.h.

Referenced by do_message_auth(), handle_response(), handle_response_invite(), handle_response_publish(), handle_response_register(), and handle_response_update().

◆ MAX_HISTORY_ENTRIES

#define MAX_HISTORY_ENTRIES   50

Max entires in the history list for a sip_pvt

Definition at line 115 of file sip.h.

Referenced by append_history_va().

◆ NO_RTP

#define NO_RTP   0

Definition at line 125 of file sip.h.

◆ NOT_SUPPORTED

#define NOT_SUPPORTED   0

Definition at line 143 of file sip.h.

◆ OFFERED_MEDIA_COUNT

#define OFFERED_MEDIA_COUNT   4

The number of media types in enum media_type below.

Definition at line 484 of file sip.h.

◆ PROVIS_KEEPALIVE_TIMEOUT

#define PROVIS_KEEPALIVE_TIMEOUT   60000

How long to wait before retransmitting a provisional response (rfc 3261 13.3.1.1)

Definition at line 108 of file sip.h.

Referenced by __update_provisional_keepalive_full(), and send_provisional_keepalive_full().

◆ REQ_OFFSET_TO_STR

#define REQ_OFFSET_TO_STR (   req,
  offset 
)    (ast_str_buffer((req)->data) + ((req)->offset))

◆ RTP

#define RTP   1

Definition at line 124 of file sip.h.

◆ SDP_MAX_RTPMAP_CODECS

#define SDP_MAX_RTPMAP_CODECS   32

Maximum number of codecs allowed in received SDP

Definition at line 122 of file sip.h.

Referenced by process_sdp_a_audio(), process_sdp_a_text(), and process_sdp_a_video().

◆ SIP_CALL_LIMIT

#define SIP_CALL_LIMIT   (1 << 7)

D: Call limit enforced for this call

Definition at line 264 of file sip.h.

Referenced by check_peer_ok(), create_addr_from_peer(), and update_call_counter().

◆ SIP_DEFER_BYE_ON_TRANSFER

#define SIP_DEFER_BYE_ON_TRANSFER   (1 << 10)

D: Do not hangup at first ast_hangup

Definition at line 267 of file sip.h.

Referenced by handle_request_refer(), local_attended_transfer(), sip_hangup(), and sip_set_rtp_peer().

◆ SIP_DIRECT_MEDIA

#define SIP_DIRECT_MEDIA   (1 << 20)

DP: allow peers to be reinvited to send media directly p2p

Definition at line 289 of file sip.h.

Referenced by _sip_show_peer(), handle_common_options(), handle_incoming(), reload_config(), sip_allow_anyrtp_remote(), sip_get_rtp_peer(), sip_get_trtp_peer(), and sip_get_vrtp_peer().

◆ SIP_DIRECT_MEDIA_NAT

#define SIP_DIRECT_MEDIA_NAT   (2 << 20)

DP: allow media reinvite when new peer is behind NAT

Definition at line 290 of file sip.h.

Referenced by handle_common_options(), sip_get_rtp_peer(), and sip_set_rtp_peer().

◆ SIP_DTMF

#define SIP_DTMF   (7 << 15)

◆ SIP_DTMF_AUTO

#define SIP_DTMF_AUTO   (3 << 15)

DP: DTMF Support: AUTO switch between rfc2833 and in-band DTMF

Definition at line 279 of file sip.h.

Referenced by __sip_alloc(), check_peer_ok(), create_addr_from_peer(), enable_dsp_detect(), handle_common_options(), process_sdp(), sip_dtmfmode(), sip_new(), and sip_setoption().

◆ SIP_DTMF_INBAND

#define SIP_DTMF_INBAND   (1 << 15)

DP: DTMF Support: Inband audio, only for ULAW/ALAW - "inband"

Definition at line 277 of file sip.h.

Referenced by enable_dsp_detect(), handle_common_options(), process_sdp(), sip_dtmfmode(), sip_new(), sip_rtp_read(), sip_senddigit_begin(), sip_senddigit_end(), and sip_setoption().

◆ SIP_DTMF_INFO

#define SIP_DTMF_INFO   (2 << 15)

DP: DTMF Support: SIP Info messages - "info"

Definition at line 278 of file sip.h.

Referenced by handle_common_options(), sip_dtmfmode(), sip_new(), and sip_senddigit_end().

◆ SIP_DTMF_RFC2833

#define SIP_DTMF_RFC2833   (0 << 15)

◆ SIP_DTMF_SHORTINFO

#define SIP_DTMF_SHORTINFO   (4 << 15)

DP: DTMF Support: SIP Info messages - "info" - short variant

Definition at line 280 of file sip.h.

Referenced by handle_common_options(), sip_dtmfmode(), sip_new(), sip_senddigit_end(), and transmit_info_with_digit().

◆ SIP_FLAGS_TO_COPY

#define SIP_FLAGS_TO_COPY
Value:
SIP_USEREQPHONE | SIP_INSECURE | SIP_USEPATH)
#define SIP_USEPATH
Definition: sip.h:305
#define SIP_TRUSTRPID
Definition: sip.h:270
#define SIP_NAT_FORCE_RPORT
Definition: sip.h:283
#define SIP_REINVITE
Definition: sip.h:287
#define SIP_INSECURE
Definition: sip.h:294
#define SIP_DTMF
Definition: sip.h:275
#define SIP_USECLIENTCODE
Definition: sip.h:272
#define SIP_G726_NONSTANDARD
Definition: sip.h:310
#define SIP_PROMISCREDIR
Definition: sip.h:269
#define SIP_SENDRPID
Definition: sip.h:306

Flags to copy from peer/user to dialog.

Definition at line 313 of file sip.h.

Referenced by __sip_alloc(), check_peer_ok(), create_addr_from_peer(), set_peer_defaults(), and sip_poke_peer().

◆ SIP_G726_NONSTANDARD

#define SIP_G726_NONSTANDARD   (1 << 31)

DP: Use non-standard packing for G726-32 data

Definition at line 310 of file sip.h.

Referenced by add_codec_to_sdp(), handle_common_options(), and process_sdp_a_audio().

◆ SIP_GOTREFER

#define SIP_GOTREFER   (1 << 6)

D: Got a refer?

Definition at line 263 of file sip.h.

Referenced by handle_request_refer(), local_attended_transfer(), and sip_set_rtp_peer().

◆ SIP_INC_COUNT

#define SIP_INC_COUNT   (1 << 8)

D: Did this dialog increment the counter of in-use calls?

Definition at line 265 of file sip.h.

Referenced by handle_request_cancel(), sip_hangup(), sip_pvt_dtor(), and update_call_counter().

◆ SIP_INC_RINGING

#define SIP_INC_RINGING   (1 << 9)

D: Did this connection increment the counter of in-use calls?

Definition at line 266 of file sip.h.

Referenced by update_call_counter().

◆ SIP_INSECURE

#define SIP_INSECURE   (3 << 23)

DP: three settings, uses two bits

Definition at line 294 of file sip.h.

Referenced by _sip_show_peer(), handle_common_options(), load_module(), and sip_reload().

◆ SIP_INSECURE_INVITE

#define SIP_INSECURE_INVITE   (1 << 24)

DP: don't require authentication for incoming INVITEs

Definition at line 297 of file sip.h.

Referenced by check_peer_ok(), and set_insecure_flags().

◆ SIP_INSECURE_NONE

#define SIP_INSECURE_NONE   (0 << 23)

DP: secure mode

Definition at line 295 of file sip.h.

◆ SIP_INSECURE_PORT

#define SIP_INSECURE_PORT   (1 << 23)

DP: don't require matching port for incoming requests

Definition at line 296 of file sip.h.

Referenced by get_insecure_variable_from_config(), get_insecure_variable_from_sipregs(), peer_ipcmp_cb_full(), set_insecure_flags(), and sip_find_peer_full().

◆ SIP_MAX_HEADERS

#define SIP_MAX_HEADERS   64

Max amount of SIP headers to read

Definition at line 111 of file sip.h.

Referenced by add_header(), and parse_request().

◆ SIP_MAX_LINES

#define SIP_MAX_LINES   256

Max amount of lines in SIP attachment (like SDP)

Definition at line 112 of file sip.h.

Referenced by parse_request().

◆ SIP_MAX_PACKET_SIZE

#define SIP_MAX_PACKET_SIZE   20480

Max SIP packet size

Definition at line 113 of file sip.h.

Referenced by sip_tcptls_read().

◆ SIP_MIN_PACKET

#define SIP_MIN_PACKET   4096

Initialize size of memory to allocate for packets

Definition at line 114 of file sip.h.

Referenced by _sip_tcp_helper_thread(), init_req(), init_resp(), and sipsock_read().

◆ SIP_NAT_FORCE_RPORT

#define SIP_NAT_FORCE_RPORT   (1 << 18)

◆ SIP_NAT_RPORT_PRESENT

#define SIP_NAT_RPORT_PRESENT   (1 << 19)

DP: rport was present in the request

Definition at line 284 of file sip.h.

Referenced by build_via(), check_user_full(), check_via(), copy_via_headers(), parse_register_contact(), and sip_real_dst().

◆ SIP_NEEDREINVITE

#define SIP_NEEDREINVITE   (1 << 4)

D: Do we need to send another reinvite?

Definition at line 261 of file sip.h.

Referenced by check_pendings(), interpret_t38_parameters(), sip_hangup(), sip_reinvite_retry(), sip_sendhtml(), sip_set_rtp_peer(), and update_connectedline().

◆ SIP_OFFER_CC

#define SIP_OFFER_CC   (1 << 1)

D: Offer CC on subsequent responses

Definition at line 258 of file sip.h.

Referenced by __transmit_response(), sip_cc_agent_init(), and transmit_response_with_sdp().

◆ SIP_OPT_100REL

#define SIP_OPT_100REL   (1 << 1)

Definition at line 147 of file sip.h.

◆ SIP_OPT_EARLY_SESSION

#define SIP_OPT_EARLY_SESSION   (1 << 3)

Definition at line 149 of file sip.h.

◆ SIP_OPT_EVENTLIST

#define SIP_OPT_EVENTLIST   (1 << 11)

Definition at line 157 of file sip.h.

◆ SIP_OPT_FROMCHANGE

#define SIP_OPT_FROMCHANGE   (1 << 17)

Definition at line 163 of file sip.h.

◆ SIP_OPT_GRUU

#define SIP_OPT_GRUU   (1 << 12)

Definition at line 158 of file sip.h.

◆ SIP_OPT_HISTINFO

#define SIP_OPT_HISTINFO   (1 << 15)

Definition at line 161 of file sip.h.

◆ SIP_OPT_JOIN

#define SIP_OPT_JOIN   (1 << 4)

Definition at line 150 of file sip.h.

◆ SIP_OPT_NOREFERSUB

#define SIP_OPT_NOREFERSUB   (1 << 14)

Definition at line 160 of file sip.h.

◆ SIP_OPT_OUTBOUND

#define SIP_OPT_OUTBOUND   (1 << 20)

Definition at line 166 of file sip.h.

◆ SIP_OPT_PATH

#define SIP_OPT_PATH   (1 << 5)

Definition at line 151 of file sip.h.

◆ SIP_OPT_PRECONDITION

#define SIP_OPT_PRECONDITION   (1 << 7)

Definition at line 153 of file sip.h.

◆ SIP_OPT_PREF

#define SIP_OPT_PREF   (1 << 6)

Definition at line 152 of file sip.h.

◆ SIP_OPT_PRIVACY

#define SIP_OPT_PRIVACY   (1 << 8)

Definition at line 154 of file sip.h.

◆ SIP_OPT_RECLISTINV

#define SIP_OPT_RECLISTINV   (1 << 18)

Definition at line 164 of file sip.h.

◆ SIP_OPT_RECLISTSUB

#define SIP_OPT_RECLISTSUB   (1 << 19)

Definition at line 165 of file sip.h.

◆ SIP_OPT_REPLACES

#define SIP_OPT_REPLACES   (1 << 0)

Definition at line 146 of file sip.h.

Referenced by AST_TEST_DEFINE().

◆ SIP_OPT_RESPRIORITY

#define SIP_OPT_RESPRIORITY   (1 << 16)

Definition at line 162 of file sip.h.

◆ SIP_OPT_SDP_ANAT

#define SIP_OPT_SDP_ANAT   (1 << 9)

Definition at line 155 of file sip.h.

◆ SIP_OPT_SEC_AGREE

#define SIP_OPT_SEC_AGREE   (1 << 10)

Definition at line 156 of file sip.h.

◆ SIP_OPT_TARGET_DIALOG

#define SIP_OPT_TARGET_DIALOG   (1 << 13)

Definition at line 159 of file sip.h.

◆ SIP_OPT_TIMER

#define SIP_OPT_TIMER   (1 << 2)

Definition at line 148 of file sip.h.

Referenced by AST_TEST_DEFINE(), handle_request_invite_st(), and respprep().

◆ SIP_OPT_UNKNOWN

#define SIP_OPT_UNKNOWN   (1 << 21)

Definition at line 167 of file sip.h.

Referenced by AST_TEST_DEFINE(), and parse_sip_options().

◆ SIP_OUTGOING

#define SIP_OUTGOING   (1 << 0)

◆ SIP_PAGE2_ALLOWOVERLAP

#define SIP_PAGE2_ALLOWOVERLAP   (3 << 13)

◆ SIP_PAGE2_ALLOWOVERLAP_DTMF

#define SIP_PAGE2_ALLOWOVERLAP_DTMF   (2 << 13)

Yes, using the DTMF transmission through Early Media

Definition at line 340 of file sip.h.

Referenced by handle_common_options(), and sip_indicate().

◆ SIP_PAGE2_ALLOWOVERLAP_NO

#define SIP_PAGE2_ALLOWOVERLAP_NO   (0 << 13)

No, terminate with 404 Not found

Definition at line 338 of file sip.h.

◆ SIP_PAGE2_ALLOWOVERLAP_SPARE

#define SIP_PAGE2_ALLOWOVERLAP_SPARE   (3 << 13)

Spare (reserved for another dialling transmission mechanisms like KPML)

Definition at line 341 of file sip.h.

◆ SIP_PAGE2_ALLOWOVERLAP_YES

#define SIP_PAGE2_ALLOWOVERLAP_YES   (1 << 13)

Yes, using the 484 Address Incomplete response

Definition at line 339 of file sip.h.

Referenced by handle_common_options(), handle_request_invite(), handle_response(), reload_config(), and sip_indicate().

◆ SIP_PAGE2_ALLOWSUBSCRIBE

#define SIP_PAGE2_ALLOWSUBSCRIBE   (1 << 12)

GP: Allow subscriptions from this peer?

Definition at line 335 of file sip.h.

Referenced by _sip_show_peer(), build_peer(), handle_common_options(), handle_request_subscribe(), reload_config(), and sip_show_settings().

◆ SIP_PAGE2_BUGGY_MWI

#define SIP_PAGE2_BUGGY_MWI   (1 << 22)

DP: Buggy CISCO MWI fix

Definition at line 357 of file sip.h.

Referenced by handle_common_options(), and transmit_notify_with_mwi().

◆ SIP_PAGE2_CALL_ONHOLD

#define SIP_PAGE2_CALL_ONHOLD   (3 << 19)

◆ SIP_PAGE2_CALL_ONHOLD_ACTIVE

#define SIP_PAGE2_CALL_ONHOLD_ACTIVE   (1 << 19)

D: Active hold

Definition at line 352 of file sip.h.

Referenced by change_hold_state().

◆ SIP_PAGE2_CALL_ONHOLD_INACTIVE

#define SIP_PAGE2_CALL_ONHOLD_INACTIVE   (3 << 19)

D: Inactive hold

Definition at line 354 of file sip.h.

Referenced by add_sdp(), and change_hold_state().

◆ SIP_PAGE2_CALL_ONHOLD_ONEDIR

#define SIP_PAGE2_CALL_ONHOLD_ONEDIR   (2 << 19)

D: One directional hold

Definition at line 353 of file sip.h.

Referenced by add_sdp(), and change_hold_state().

◆ SIP_PAGE2_CONNECTLINEUPDATE_PEND

#define SIP_PAGE2_CONNECTLINEUPDATE_PEND   (1 << 6)

Definition at line 329 of file sip.h.

Referenced by __transmit_response(), and update_connectedline().

◆ SIP_PAGE2_DIALOG_ESTABLISHED

#define SIP_PAGE2_DIALOG_ESTABLISHED   (1 << 23)

◆ SIP_PAGE2_FAX_DETECT

#define SIP_PAGE2_FAX_DETECT   (3 << 24)

DP: Fax Detection support

Definition at line 360 of file sip.h.

Referenced by handle_common_options(), and reload_config().

◆ SIP_PAGE2_FAX_DETECT_BOTH

#define SIP_PAGE2_FAX_DETECT_BOTH   (3 << 24)

DP: Fax Detection support - detect both

Definition at line 363 of file sip.h.

Referenced by handle_common_options().

◆ SIP_PAGE2_FAX_DETECT_CNG

#define SIP_PAGE2_FAX_DETECT_CNG   (1 << 24)

DP: Fax Detection support - detect CNG in audio

Definition at line 361 of file sip.h.

Referenced by enable_dsp_detect(), handle_common_options(), and sip_read().

◆ SIP_PAGE2_FAX_DETECT_T38

#define SIP_PAGE2_FAX_DETECT_T38   (2 << 24)

DP: Fax Detection support - detect T.38 reinvite from peer

Definition at line 362 of file sip.h.

Referenced by handle_common_options(), process_sdp(), and sip_call().

◆ SIP_PAGE2_FLAGS_TO_COPY

#define SIP_PAGE2_FLAGS_TO_COPY

◆ SIP_PAGE2_HAVEPEERCONTEXT

#define SIP_PAGE2_HAVEPEERCONTEXT   (1 << 28) /*< Are we associated with a configured peer context? */

Definition at line 367 of file sip.h.

Referenced by build_peer(), and get_destination().

◆ SIP_PAGE2_IGNORESDPVERSION

#define SIP_PAGE2_IGNORESDPVERSION   (1 << 16)

GDP: Ignore the SDP session version number we receive and treat all sessions as new

Definition at line 344 of file sip.h.

Referenced by _sip_show_peer(), handle_common_options(), process_sdp_o(), reload_config(), and sip_show_settings().

◆ SIP_PAGE2_PREFERRED_CODEC

#define SIP_PAGE2_PREFERRED_CODEC   (1 << 9)

GDP: Only respond with single most preferred joint codec

Definition at line 332 of file sip.h.

Referenced by build_peer(), process_sdp(), and reload_config().

◆ SIP_PAGE2_Q850_REASON

#define SIP_PAGE2_Q850_REASON   (1 << 3)

DP: Get/send cause code via Reason header

Definition at line 326 of file sip.h.

Referenced by __transmit_response(), _sip_show_peer(), build_peer(), reload_config(), sip_show_settings(), transmit_request_with_auth(), and use_reason_header().

◆ SIP_PAGE2_RFC2833_COMPENSATE

#define SIP_PAGE2_RFC2833_COMPENSATE   (1 << 21)

DP: Compensate for buggy RFC2833 implementations

Definition at line 356 of file sip.h.

Referenced by create_addr_from_peer(), dialog_initialize_rtp(), handle_common_options(), handle_request_invite(), process_sdp(), and sip_show_settings().

◆ SIP_PAGE2_RPID_IMMEDIATE

#define SIP_PAGE2_RPID_IMMEDIATE   (1 << 7)

Definition at line 330 of file sip.h.

Referenced by handle_common_options(), and update_connectedline().

◆ SIP_PAGE2_RPID_UPDATE

#define SIP_PAGE2_RPID_UPDATE   (1 << 2)

Definition at line 325 of file sip.h.

Referenced by handle_common_options(), and set_pvt_allowed_methods().

◆ SIP_PAGE2_RPORT_PRESENT

#define SIP_PAGE2_RPORT_PRESENT   (1 << 8)

Was rport received in the Via header?

Definition at line 331 of file sip.h.

Referenced by check_user_full(), and check_via().

◆ SIP_PAGE2_RTAUTOCLEAR

#define SIP_PAGE2_RTAUTOCLEAR   (1 << 1)

GP: Should we clean memory from peers after expiry?

Definition at line 324 of file sip.h.

Referenced by expire_register(), realtime_peer(), reload_config(), and sip_show_settings().

◆ SIP_PAGE2_RTCACHEFRIENDS

#define SIP_PAGE2_RTCACHEFRIENDS   (1 << 0)

GP: Should we keep RT objects in memory for extended time?

Definition at line 323 of file sip.h.

Referenced by build_peer(), parse_register_contact(), realtime_peer(), reload_config(), sip_destroy_peer(), sip_prune_realtime(), sip_show_settings(), and update_peer().

◆ SIP_PAGE2_STATECHANGEQUEUE

#define SIP_PAGE2_STATECHANGEQUEUE   (1 << 5)

D: Unsent state pending change exists

Definition at line 328 of file sip.h.

Referenced by extensionstate_update(), and handle_response_notify().

◆ SIP_PAGE2_SUBSCRIBEMWIONLY

#define SIP_PAGE2_SUBSCRIBEMWIONLY   (1 << 15)

GP: Only issue MWI notification if subscribed to

Definition at line 343 of file sip.h.

Referenced by build_peer(), handle_request_subscribe(), and sip_send_mwi_to_peer().

◆ SIP_PAGE2_SYMMETRICRTP

#define SIP_PAGE2_SYMMETRICRTP   (1 << 4)

◆ SIP_PAGE2_T38SUPPORT

#define SIP_PAGE2_T38SUPPORT   (3 << 17)

◆ SIP_PAGE2_T38SUPPORT_UDPTL

#define SIP_PAGE2_T38SUPPORT_UDPTL   (1 << 17)

GDP: T.38 Fax Support (no error correction)

Definition at line 347 of file sip.h.

Referenced by handle_t38_options(), and set_t38_capabilities().

◆ SIP_PAGE2_T38SUPPORT_UDPTL_FEC

#define SIP_PAGE2_T38SUPPORT_UDPTL_FEC   (2 << 17)

GDP: T.38 Fax Support (FEC error correction)

Definition at line 348 of file sip.h.

Referenced by handle_t38_options(), and set_t38_capabilities().

◆ SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY

#define SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY   (3 << 17)

GDP: T.38 Fax Support (redundancy error correction)

Definition at line 349 of file sip.h.

Referenced by handle_t38_options(), and set_t38_capabilities().

◆ SIP_PAGE2_TEXTSUPPORT

#define SIP_PAGE2_TEXTSUPPORT   (1 << 11)

GDP: Global text enable

Definition at line 334 of file sip.h.

Referenced by _sip_show_peer(), _sip_show_peers_one(), dialog_initialize_rtp(), handle_common_options(), reload_config(), and sip_show_settings().

◆ SIP_PAGE2_TRUST_ID_OUTBOUND

#define SIP_PAGE2_TRUST_ID_OUTBOUND   (3 << 30)

DP: Do we trust the peer with private presence information?

Definition at line 370 of file sip.h.

Referenced by _sip_show_peer(), add_rpid(), and handle_common_options().

◆ SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY

#define SIP_PAGE2_TRUST_ID_OUTBOUND_LEGACY   (0 << 30)

Legacy, Do not provide private presence information, but include PAI/RPID when private

Definition at line 371 of file sip.h.

Referenced by add_rpid(), and handle_common_options().

◆ SIP_PAGE2_TRUST_ID_OUTBOUND_NO

#define SIP_PAGE2_TRUST_ID_OUTBOUND_NO   (1 << 30)

No, Do not provide private presence information, do not include PAI/RPID when private

Definition at line 372 of file sip.h.

Referenced by add_rpid(), and handle_common_options().

◆ SIP_PAGE2_TRUST_ID_OUTBOUND_YES

#define SIP_PAGE2_TRUST_ID_OUTBOUND_YES   (2 << 30)

Yes, provide private presence information in PAI/RPID headers

Definition at line 373 of file sip.h.

Referenced by add_rpid(), and handle_common_options().

◆ SIP_PAGE2_UDPTL_DESTINATION

#define SIP_PAGE2_UDPTL_DESTINATION   (1 << 26)

DP: Use source IP of RTP as destination if NAT is enabled

Definition at line 365 of file sip.h.

Referenced by handle_t38_options(), and process_sdp().

◆ SIP_PAGE2_USE_SRTP

#define SIP_PAGE2_USE_SRTP   (1 << 29)

DP: Whether we should offer (only) SRTP

Definition at line 368 of file sip.h.

Referenced by _sip_show_peer(), build_peer(), function_sippeer(), process_sdp(), sip_call(), sip_queryoption(), and sip_setoption().

◆ SIP_PAGE2_VIDEOSUPPORT

#define SIP_PAGE2_VIDEOSUPPORT   (1 << 10)

DP: Video supported if offered?

Definition at line 333 of file sip.h.

Referenced by _sip_show_peer(), _sip_show_peers_one(), dialog_initialize_rtp(), handle_common_options(), reload_config(), and sip_show_settings().

◆ SIP_PAGE2_VIDEOSUPPORT_ALWAYS

#define SIP_PAGE2_VIDEOSUPPORT_ALWAYS   (1 << 27)

DP: Always set up video, even if endpoints don't support it

Definition at line 366 of file sip.h.

Referenced by _sip_show_peer(), dialog_initialize_rtp(), handle_common_options(), reload_config(), and sip_new().

◆ SIP_PAGE3_DIRECT_MEDIA_OUTGOING

#define SIP_PAGE3_DIRECT_MEDIA_OUTGOING   (1 << 4)

DP: Only send direct media reinvites on outgoing calls

Definition at line 388 of file sip.h.

Referenced by handle_common_options(), and sip_set_rtp_peer().

◆ SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL

#define SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL   (1 << 8)

DGP: Stop telling the peer to start music on hold

Definition at line 392 of file sip.h.

Referenced by build_peer(), process_sdp(), and reload_config().

◆ SIP_PAGE3_FLAGS_TO_COPY

#define SIP_PAGE3_FLAGS_TO_COPY
Value:
SIP_PAGE3_DIRECT_MEDIA_OUTGOING | SIP_PAGE3_USE_AVPF | SIP_PAGE3_ICE_SUPPORT | SIP_PAGE3_IGNORE_PREFCAPS | \
SIP_PAGE3_DISCARD_REMOTE_HOLD_RETRIEVAL | SIP_PAGE3_FORCE_AVP | SIP_PAGE3_RTCP_MUX)
#define SIP_PAGE3_ICE_SUPPORT
Definition: sip.h:390
#define SIP_PAGE3_RTCP_MUX
Definition: sip.h:394
#define SIP_PAGE3_SNOM_AOC
Definition: sip.h:384
#define SIP_PAGE3_FORCE_AVP
Definition: sip.h:393
#define SIP_PAGE3_NAT_AUTO_RPORT
Definition: sip.h:386
#define SIP_PAGE3_NAT_AUTO_COMEDIA
Definition: sip.h:387
#define SIP_PAGE3_SRTP_TAG_32
Definition: sip.h:385
#define SIP_PAGE3_IGNORE_PREFCAPS
Definition: sip.h:391
#define SIP_PAGE3_USE_AVPF
Definition: sip.h:389

Definition at line 396 of file sip.h.

Referenced by __sip_alloc(), check_peer_ok(), create_addr_from_peer(), set_peer_defaults(), and sip_poke_peer().

◆ SIP_PAGE3_FORCE_AVP

#define SIP_PAGE3_FORCE_AVP   (1 << 9)

DGP: Force 'RTP/AVP' for all streams, even DTLS

Definition at line 393 of file sip.h.

Referenced by add_sdp(), and build_peer().

◆ SIP_PAGE3_ICE_SUPPORT

#define SIP_PAGE3_ICE_SUPPORT   (1 << 6)

DGP: Enable ICE support

Definition at line 390 of file sip.h.

Referenced by add_sdp(), build_peer(), dialog_initialize_rtp(), and reload_config().

◆ SIP_PAGE3_IGNORE_PREFCAPS

#define SIP_PAGE3_IGNORE_PREFCAPS   (1 << 7)

DP: Ignore prefcaps when setting up an outgoing call leg

Definition at line 391 of file sip.h.

Referenced by add_sdp(), and build_peer().

◆ SIP_PAGE3_NAT_AUTO_COMEDIA

#define SIP_PAGE3_NAT_AUTO_COMEDIA   (1 << 3)

DGP: Set SIP_PAGE2_SYMMETRICRTP when NAT is detected

Definition at line 387 of file sip.h.

Referenced by _sip_show_peer(), _sip_show_peers_one(), check_for_nat(), comedia_string(), match_nat_options(), set_peer_nat(), sip_parse_nat_option(), and sip_request_call().

◆ SIP_PAGE3_NAT_AUTO_RPORT

#define SIP_PAGE3_NAT_AUTO_RPORT   (1 << 2)

◆ SIP_PAGE3_RTCP_MUX

#define SIP_PAGE3_RTCP_MUX   (1 << 10)

DGP: Attempt to negotiate RFC 5761 RTCP multiplexing

Definition at line 394 of file sip.h.

Referenced by _sip_show_peer(), add_sdp(), configure_rtcp(), handle_common_options(), process_sdp_a_ice(), set_ice_components(), sip_new(), and sip_show_settings().

◆ SIP_PAGE3_SNOM_AOC

#define SIP_PAGE3_SNOM_AOC   (1 << 0)

DPG: Allow snom aoc messages

Definition at line 384 of file sip.h.

Referenced by build_peer(), reload_config(), and sip_indicate().

◆ SIP_PAGE3_SRTP_TAG_32

#define SIP_PAGE3_SRTP_TAG_32   (1 << 1)

DP: Use a 32bit auth tag in INVITE not 80bit

Definition at line 385 of file sip.h.

Referenced by add_sdp(), and build_peer().

◆ SIP_PAGE3_USE_AVPF

#define SIP_PAGE3_USE_AVPF   (1 << 5)

DGP: Support a minimal AVPF-compatible profile

Definition at line 389 of file sip.h.

Referenced by add_sdp(), build_peer(), and process_sdp().

◆ SIP_PENDINGBYE

#define SIP_PENDINGBYE   (1 << 5)

D: Need to send bye after we ack?

Definition at line 262 of file sip.h.

Referenced by check_pendings(), handle_response_invite(), interpret_t38_parameters(), register_verify(), sip_hangup(), sip_sendhtml(), and sip_set_rtp_peer().

◆ SIP_PROG_INBAND

#define SIP_PROG_INBAND   (3 << 25)

DP: three settings, uses two bits

Definition at line 300 of file sip.h.

Referenced by handle_common_options(), sip_indicate(), and sip_show_settings().

◆ SIP_PROG_INBAND_NEVER

#define SIP_PROG_INBAND_NEVER   (1 << 25)

Definition at line 302 of file sip.h.

Referenced by handle_common_options(), sip_indicate(), and sip_show_settings().

◆ SIP_PROG_INBAND_NO

#define SIP_PROG_INBAND_NO   (0 << 25)

Definition at line 301 of file sip.h.

Referenced by sip_show_settings().

◆ SIP_PROG_INBAND_YES

#define SIP_PROG_INBAND_YES   (2 << 25)

Definition at line 303 of file sip.h.

Referenced by handle_common_options(), and sip_indicate().

◆ SIP_PROGRESS_SENT

#define SIP_PROGRESS_SENT   (1 << 3)

D: Have sent 183 message progress

Definition at line 260 of file sip.h.

Referenced by handle_response_invite(), sip_answer(), sip_indicate(), sip_write(), and update_connectedline().

◆ SIP_PROMISCREDIR

#define SIP_PROMISCREDIR   (1 << 11)

DP: Promiscuous redirection

Definition at line 269 of file sip.h.

Referenced by _sip_show_peer(), handle_common_options(), parse_moved_contact(), sip_show_channel(), and sip_show_settings().

◆ sip_ref_peer

#define sip_ref_peer (   peer,
  tag 
)    ao2_t_bump(peer, tag)

◆ SIP_REINVITE

#define SIP_REINVITE   (7 << 20)

DP: four settings, uses three bits

Definition at line 287 of file sip.h.

Referenced by handle_common_options(), and sip_call().

◆ SIP_REINVITE_NONE

#define SIP_REINVITE_NONE   (0 << 20)

DP: no reinvite allowed

Definition at line 288 of file sip.h.

◆ SIP_REINVITE_UPDATE

#define SIP_REINVITE_UPDATE   (4 << 20)

DP: use UPDATE (RFC3311) when reinviting this peer

Definition at line 291 of file sip.h.

Referenced by handle_common_options(), transmit_reinvite_with_sdp(), and update_connectedline().

◆ SIP_RESERVED

#define SIP_RESERVED   ";/?:@&=+$,# "

Reserved characters in the username part of the URI

Definition at line 60 of file sip.h.

◆ SIP_RINGING

#define SIP_RINGING   (1 << 2)

D: Have sent 180 ringing

Definition at line 259 of file sip.h.

Referenced by sip_indicate(), and update_connectedline().

◆ SIP_SENDRPID

#define SIP_SENDRPID   (3 << 29)

◆ SIP_SENDRPID_NO

#define SIP_SENDRPID_NO   (0 << 29)

Definition at line 307 of file sip.h.

◆ SIP_SENDRPID_PAI

#define SIP_SENDRPID_PAI   (1 << 29)

Use "P-Asserted-Identity" for rpid

Definition at line 308 of file sip.h.

Referenced by add_rpid(), and handle_common_options().

◆ SIP_SENDRPID_RPID

#define SIP_SENDRPID_RPID   (2 << 29)

Use "Remote-Party-ID" for rpid

Definition at line 309 of file sip.h.

Referenced by handle_common_options().

◆ SIP_TRANS_TIMEOUT

#define SIP_TRANS_TIMEOUT   64 * DEFAULT_TIMER_T1

SIP request timeout (rfc 3261) 64*T1

Todo:
Use known T1 for timeout (peerpoke)

Definition at line 102 of file sip.h.

Referenced by manager_sipnotify(), sip_cli_notify(), and sip_sipredirect().

◆ SIP_TRUSTRPID

#define SIP_TRUSTRPID   (1 << 12)

DP: Trust RPID headers?

Definition at line 270 of file sip.h.

Referenced by _sip_show_peer(), get_rpid(), handle_common_options(), and sip_show_settings().

◆ sip_unref_peer

#define sip_unref_peer (   peer,
  tag 
)    ({ ao2_t_cleanup(peer, tag); (NULL); })

◆ SIP_USECLIENTCODE

#define SIP_USECLIENTCODE   (1 << 14)

DP: Trust X-ClientCode info message

Definition at line 272 of file sip.h.

Referenced by handle_common_options(), handle_request_info(), and sip_show_settings().

◆ SIP_USEPATH

#define SIP_USEPATH   (1 << 27)

GDP: Trust and use incoming Path headers?

Definition at line 305 of file sip.h.

Referenced by _sip_show_peer(), add_supported(), build_path(), handle_common_options(), parse_register_contact(), respprep(), and sip_show_settings().

◆ SIP_USEREQPHONE

#define SIP_USEREQPHONE   (1 << 13)

DP: Add user=phone to numeric URI. Default off

Definition at line 271 of file sip.h.

Referenced by _sip_show_peer(), build_peer(), initreqprep(), reload_config(), and sip_show_settings().

◆ SIPBUFSIZE

#define SIPBUFSIZE   512

◆ STANDARD_SIP_PORT

#define STANDARD_SIP_PORT   5060

◆ STANDARD_TLS_PORT

#define STANDARD_TLS_PORT   5061

◆ SUPPORTED

#define SUPPORTED   1

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... This is nothing we can configure, we learn by the dialog Supported: header on the REGISTER (peer) or the INVITE (other devices) We are not using many of these today, but will in the future. This is documented in RFC 3261

Definition at line 142 of file sip.h.

Referenced by parse_sip_options().

◆ TRUE

#define TRUE   1

Definition at line 48 of file sip.h.

◆ XMIT_ERROR

#define XMIT_ERROR   -2

Typedef Documentation

◆ esc_publish_callback

typedef int(* const esc_publish_callback) (struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *)

Definition at line 1761 of file sip.h.

Enumeration Type Documentation

◆ autocreatepeer_mode

Automatic peer registration behavior.

Enumerator
AUTOPEERS_DISABLED 

Automatic peer creation disabled

AUTOPEERS_VOLATILE 

Automatic peers dropped on sip reload (pre-1.8 behavior)

AUTOPEERS_PERSIST 

Automatic peers survive sip configuration reload

Definition at line 590 of file sip.h.

◆ can_create_dialog

States whether a SIP message can create a dialog in Asterisk.

Enumerator
CAN_NOT_CREATE_DIALOG 
CAN_CREATE_DIALOG 
CAN_CREATE_DIALOG_UNSUPPORTED_METHOD 

Definition at line 597 of file sip.h.

605  {

◆ check_auth_result

Authentication result from check_auth* functions.

Enumerator
AUTH_DONT_KNOW 

no result, need to check further

AUTH_SUCCESSFUL 
AUTH_CHALLENGE_SENT 
AUTH_SECRET_FAILED 
AUTH_USERNAME_MISMATCH 
AUTH_NOT_FOUND 

returned by register_verify

AUTH_UNKNOWN_DOMAIN 
AUTH_PEER_NOT_DYNAMIC 
AUTH_ACL_FAILED 
AUTH_BAD_TRANSPORT 
AUTH_RTP_FAILED 
AUTH_SESSION_LIMIT 

Definition at line 517 of file sip.h.

527  {
528  REG_STATE_UNREGISTERED = 0, /*!< We are not registered
529  * \note Initial state. We should have a timeout scheduled for the initial
530  * (or next) registration transmission, calling sip_reregister
531  */

◆ digest_keys

Enumerator
K_RESP 
K_URI 
K_USER 
K_NONCE 
K_LAST 

Definition at line 702 of file sip.h.

714  {

◆ domain_mode

Modes for SIP domain handling in the PBX.

Enumerator
SIP_DOMAIN_AUTO 

This domain is auto-configured

SIP_DOMAIN_CONFIG 

This domain is from configuration

Definition at line 647 of file sip.h.

651  {

◆ inv_req_result

The results from handling an invite request.

Note
Start at these values so we do not conflict with check_auth_results values when returning from handle_request_invite. check_auth_results only returned during authentication routines
Enumerator
INV_REQ_SUCCESS 

Success code

INV_REQ_FAILED 

Failure code

INV_REQ_ERROR 

Error code

Definition at line 432 of file sip.h.

434  {
435  INV_NONE = 0, /*!< No state at all, maybe not an INVITE dialog */
436  INV_CALLING = 1, /*!< Invite sent, no answer */
Definition: sip.h:442

◆ invitestates

States for the INVITE transaction, not the dialog.

Note
this is for the INVITE that sets up the dialog
Enumerator
INV_NONE 

No state at all, maybe not an INVITE dialog

INV_CALLING 

Invite sent, no answer

INV_PROCEEDING 

We got/sent 1xx message

INV_EARLY_MEDIA 

We got 18x message with to-tag back

INV_COMPLETED 

Got final response with error. Wait for ACK, then CONFIRMED

INV_CONFIRMED 

Confirmed response - we've got an ack (Incoming calls only)

INV_TERMINATED 

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 

Transaction cancelled by client or server in non-terminated state

Definition at line 441 of file sip.h.

450  {
451  XMIT_CRITICAL = 2, /*!< Transmit critical SIP message reliably, with re-transmits.

◆ media_type

enum media_type

Media types generate different "dummy answers" for not accepting the offer of a media stream. We need to add definitions for each RTP profile. Secure RTP is not the same as normal RTP and will require a new definition.

Enumerator
SDP_AUDIO 

RTP/AVP Audio

SDP_VIDEO 

RTP/AVP Video

SDP_IMAGE 

Image udptl, not TCP or RTP

SDP_TEXT 

RTP/AVP Realtime Text

SDP_UNKNOWN 

Unknown media type

Definition at line 489 of file sip.h.

495  {

◆ notifycid_setting

Settings for the 'notifycid' option, see sip.conf.sample for details.

Enumerator
DISABLED 
ENABLED 
IGNORE_CONTEXT 

Definition at line 640 of file sip.h.

640  {
641  SIP_DOMAIN_AUTO, /*!< This domain is auto-configured */
642  SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
643 };
644 

◆ notifyringing_setting

Setting for the 'notifyringing' option, see sip.conf.sample for details.

Enumerator
NOTIFYRINGING_DISABLED 
NOTIFYRINGING_ENABLED 
NOTIFYRINGING_NOTINUSE 

Definition at line 633 of file sip.h.

633  {
634  DISABLED = 0,
635  ENABLED = 1,
636  IGNORE_CONTEXT = 2,
637 };
Definition: sip.h:642
Definition: sip.h:641

◆ parse_register_result

Results from the parse_register() function.

Enumerator
PARSE_REGISTER_DENIED 
PARSE_REGISTER_FAILED 
PARSE_REGISTER_UPDATE 
PARSE_REGISTER_QUERY 

Definition at line 465 of file sip.h.

466  {
467  NONE = 0,
468  XPIDF_XML,
Definition: sip.h:474
Definition: sip.h:475

◆ referstatus

Parameters to know status of transfer.

Enumerator
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

Definition at line 674 of file sip.h.

679  {
680  SIP_TYPE_PEER = (1 << 0),
681  SIP_TYPE_USER = (1 << 1),
682 };
683 
684 enum t38_action_flag {
t38_action_flag
Definition: sip.h:691

◆ sip_auth_type

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.
Enumerator
PROXY_AUTH 
WWW_AUTH 

Definition at line 502 of file sip.h.

510  {

◆ sip_cc_notify_state

The states that can be represented in a SIP call-completion NOTIFY.

Enumerator
CC_QUEUED 

Queued, i.e. unavailable

CC_READY 

Ready, i.e. available

Definition at line 1552 of file sip.h.

1555  {
1556  /*!
1557  * \brief Unknown

◆ sip_cc_publish_state

The states that can be represented in a SIP call-completion PUBLISH.

SIP PUBLISH support! PUBLISH support was added to chan_sip due to its use in the call-completion event package. In order to suspend and unsuspend monitoring of a called party, a PUBLISH message must be sent. Rather than try to hack in PUBLISH transmission and reception solely for the purposes of handling call-completion-related messages, an effort has been made to create a generic framework for handling PUBLISH messages.

There are two main components to the effort, the event publication agent (EPA) and the event state compositor (ESC). Both of these terms appear in RFC 3903, and the implementation in Asterisk conforms to the defintions there. An EPA is a UAC that transmits PUBLISH requests. An ESC is a UAS that receives PUBLISH requests and acts appropriately based on the content of those requests.

ESC: The main structure in chan_sip is the event_state_compositor. There is an event_state_compositor structure for each event package supported (as of Nov 2009 this is only the call-completion package). The structure contains data which is intrinsic to the event package itself, such as the name of the package and a set of callbacks for handling incoming PUBLISH requests. In addition, the event_state_compositor struct contains an ao2_container of sip_esc_entries.

A sip_esc_entry corresponds to an entity which has sent a PUBLISH to Asterisk. We are able to match the incoming PUBLISH to a sip_esc_entry using the Sip-If-Match header of the message. Of course, if none is present, then a new sip_esc_entry will be created.

Once it is determined what type of PUBLISH request has come in (from RFC 3903, it may be an initial, modify, refresh, or remove), then the event package-specific callbacks may be called. If your event package doesn't need to take any specific action for a specific PUBLISH type, it is perfectly safe to not define the callback at all. The callback only needs to take care of application-specific information. If there is a problem, it is up to the callback to take care of sending an appropriate 4xx or 5xx response code. In such a case, the callback should return -1. This will tell the function that called the handler that an appropriate error response has been sent. If the callback returns 0, however, then the caller of the callback will generate a new entity tag and send a 200 OK response.

ESC entries are reference-counted, however as an implementor of a specific event package, this should be transparent, since the reference counts are handled by the general ESC framework.

EPA: The event publication agent in chan_sip is structured quite a bit differently than the ESC. With an ESC, an appropriate entry has to be found based on the contents of an incoming PUBLISH message. With an EPA, the application interested in sending the PUBLISH can maintain a reference to the appropriate EPA entry instead. Similarly, when matching a PUBLISH response to an appropriate EPA entry, the sip_pvt can maintain a reference to the corresponding EPA entry. The result of this train of thought is that there is no compelling reason to maintain a container of these entries.

Instead, there is only the sip_epa_entry structure. Every sip_epa_entry has an entity tag that it maintains so that subsequent PUBLISH requests will be identifiable by the ESC on the far end. In addition, there is a static_data field which contains information that is common to all sip_epa_entries for a specific event package. This static data includes the name of the event package and callbacks for handling specific responses for outgoing PUBLISHes. Also, there is a field for pointing to instance-specific data. This can include the current published state or other identifying information that is specific to an instance of an EPA entry of a particular event package.

When an application wishes to send a PUBLISH request, it simply will call create_epa_entry, followed by transmit_publish in order to send the PUBLISH. That's all that is necessary. Like with ESC entries, sip_epa_entries are reference counted. Unlike ESC entries, though, sip_epa_entries reference counts have to be maintained to some degree by the application making use of the sip_epa_entry. The application will acquire a reference to the EPA entry when it calls create_epa_entry. When the application has finished using the EPA entry (which may not be until after several PUBLISH transactions have taken place) it must use ao2_ref to decrease the reference count by 1.

Enumerator
CC_CLOSED 

Closed, i.e. unavailable

CC_OPEN 

Open, i.e. available

Definition at line 1542 of file sip.h.

1545  {
1546  /*! Queued, i.e. unavailable */
1547  CC_QUEUED,

◆ sip_debug_e

debugging state We store separately the debugging requests from the config file and requests from the CLI. Debugging is enabled if either is set (which means that if sipdebug is set in the config file, we can only turn it off by reloading the config).

Enumerator
sip_debug_none 
sip_debug_config 
sip_debug_console 

Definition at line 658 of file sip.h.

658  {
659  T38_DISABLED = 0, /*!< Not enabled */
660  T38_LOCAL_REINVITE, /*!< Offered from local - REINVITE */
661  T38_PEER_REINVITE, /*!< Offered from peer - REINVITE */
662  T38_ENABLED, /*!< Negotiated (enabled) */

◆ sip_get_dest_result

Result from get_destination function.

Enumerator
SIP_GET_DEST_EXTEN_MATCHMORE 
SIP_GET_DEST_EXTEN_FOUND 
SIP_GET_DEST_EXTEN_NOT_FOUND 
SIP_GET_DEST_REFUSED 
SIP_GET_DEST_INVALID_URI 

Definition at line 508 of file sip.h.

510  {
511  AUTH_DONT_KNOW = -100, /*!< no result, need to check further */
512  /* XXX maybe this is the same as AUTH_NOT_FOUND */
513  AUTH_SUCCESSFUL = 0,

◆ sip_mailbox_status

Enumerator
SIP_MAILBOX_STATUS_UNKNOWN 
SIP_MAILBOX_STATUS_EXISTING 
SIP_MAILBOX_STATUS_NEW 

Definition at line 1249 of file sip.h.

1254  {

◆ sip_peer_type

Enumerator
SIP_TYPE_PEER 
SIP_TYPE_USER 

Definition at line 686 of file sip.h.

690  {

◆ sip_publish_type

The types of PUBLISH messages defined in RFC 3903.

Enumerator
SIP_PUBLISH_UNKNOWN 

Unknown.

This actually is not defined in RFC 3903. We use this as a constant to indicate that an incoming PUBLISH does not fit into any of the other categories and is thus invalid.

SIP_PUBLISH_INITIAL 

Initial.

The first PUBLISH sent. This will contain a non-zero Expires header as well as a body that indicates the current state of the endpoint that has sent the message. The initial PUBLISH is the only type of PUBLISH to not contain a Sip-If-Match header in it.

SIP_PUBLISH_REFRESH 

Refresh.

Used to keep a published state from expiring. This will contain a non-zero Expires header but no body since its purpose is not to update state.

SIP_PUBLISH_MODIFY 

Modify.

Used to change state from its previous value. This will contain a body updating the published state. May or may not contain an Expires header.

SIP_PUBLISH_REMOVE 

Remove.

Used to remove published state from an ESC. This will contain an Expires header set to 0 and likely no body.

SIP_PUBLISH_UNKNOWN 

Unknown.

This actually is not defined in RFC 3903. We use this as a constant to indicate that an incoming PUBLISH does not fit into any of the other categories and is thus invalid.

SIP_PUBLISH_INITIAL 

Initial.

The first PUBLISH sent. This will contain a non-zero Expires header as well as a body that indicates the current state of the endpoint that has sent the message. The initial PUBLISH is the only type of PUBLISH to not contain a Sip-If-Match header in it.

SIP_PUBLISH_REFRESH 

Refresh.

Used to keep a published state from expiring. This will contain a non-zero Expires header but no body since its purpose is not to update state.

SIP_PUBLISH_MODIFY 

Modify.

Used to change state from its previous value. This will contain a body updating the published state. May or may not contain an Expires header.

SIP_PUBLISH_REMOVE 

Remove.

Used to remove published state from an ESC. This will contain an Expires header set to 0 and likely no body.

Definition at line 1562 of file sip.h.

1607  {
1608  /*! The event type */

◆ sip_result

enum sip_result

The result of a lot of functions.

Enumerator
AST_SUCCESS 

FALSE means success, funny enough

AST_FAILURE 

Failure code

Definition at line 420 of file sip.h.

425  {

◆ sip_tcptls_alert

Enumerator
TCPTLS_ALERT_DATA 

There is new data to be sent out.

TCPTLS_ALERT_STOP 

A request to stop the tcp_handler thread.

Definition at line 697 of file sip.h.

714  {

◆ sipmethod

enum sipmethod

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 not doing the right thing. If you think there are changes needed, get someone else to review them first before submitting a patch. If these two lists do not match properly bad things will happen.
Enumerator
SIP_UNKNOWN 

Unknown response

SIP_RESPONSE 

Not request, response to outbound request

SIP_REGISTER 

Registration to the mothership, tell us where you are located

SIP_OPTIONS 

Check capabilities of a device, used for "ping" too

SIP_NOTIFY 

Status update, Part of the event package standard, result of a SUBSCRIBE or a REFER

SIP_INVITE 

Set up a session

SIP_ACK 

End of a three-way handshake started with INVITE.

SIP_PRACK 

Reliable pre-call signalling. Not supported in Asterisk.

SIP_BYE 

End of a session

SIP_REFER 

Refer to another URI (transfer)

SIP_SUBSCRIBE 

Subscribe for updates (voicemail, session status, device status, presence)

SIP_MESSAGE 

Text messaging

SIP_UPDATE 

Update a dialog. We can send UPDATE; but not accept it

SIP_INFO 

Information updates during a session

SIP_CANCEL 

Cancel an INVITE

SIP_PUBLISH 

Not supported in Asterisk

SIP_PING 

Not supported at all, no standard but still implemented out there

Definition at line 612 of file sip.h.

◆ sipregistrystate

States for outbound registrations (with register= lines in sip.conf.

Enumerator
REG_STATE_UNREGISTERED 

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

Note
sent initial request, waiting for an ack or a timeout to retransmit the initial request.
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

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 about to expire, renewing registration

REG_STATE_NOAUTH 

We have no accepted credentials

Note
fatal - no chance to proceed
REG_STATE_FAILED 

Registration failed after several tries

Note
fatal - no chance to proceed

Definition at line 534 of file sip.h.

561  {
562  SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */
563  SESSION_TIMER_MODE_ACCEPT, /*!< Honor inbound Session-Timer requests */
564  SESSION_TIMER_MODE_ORIGINATE, /*!< Originate outbound and honor inbound requests */
565  SESSION_TIMER_MODE_REFUSE /*!< Ignore inbound Session-Timers requests */

◆ st_mode

enum st_mode

Modes in which Asterisk can be configured to run SIP Session-Timers.

Enumerator
SESSION_TIMER_MODE_INVALID 

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

Definition at line 568 of file sip.h.

569  {
570  SESSION_TIMER_REFRESHER_AUTO, /*!< Negotiated */
571  SESSION_TIMER_REFRESHER_US, /*!< Initially prefer session refresh by Asterisk */
572  SESSION_TIMER_REFRESHER_THEM, /*!< Initially prefer session refresh by the other side */
573 };

◆ st_refresher

The entity playing the refresher role for Session-Timers.

Enumerator
SESSION_TIMER_REFRESHER_AUTO 

Negotiated

SESSION_TIMER_REFRESHER_US 

Initially prefer session refresh by Asterisk

SESSION_TIMER_REFRESHER_THEM 

Initially prefer session refresh by the other side

Definition at line 576 of file sip.h.

583  {

◆ st_refresher_param

Enumerator
SESSION_TIMER_REFRESHER_PARAM_UNKNOWN 
SESSION_TIMER_REFRESHER_PARAM_UAC 
SESSION_TIMER_REFRESHER_PARAM_UAS 

Definition at line 582 of file sip.h.

583  {
584  AUTOPEERS_DISABLED = 0, /*!< Automatic peer creation disabled */
585  AUTOPEERS_VOLATILE, /*!< Automatic peers dropped on sip reload (pre-1.8 behavior) */
586  AUTOPEERS_PERSIST /*!< Automatic peers survive sip configuration reload */

◆ subscriptiontype

Type of subscription, based on the packages we do support, see subscription_types.

Enumerator
NONE 
XPIDF_XML 
DIALOG_INFO_XML 
CPIM_PIDF_XML 
PIDF_XML 
MWI_NOTIFICATION 
CALL_COMPLETION 

Definition at line 473 of file sip.h.

482  {

◆ t38_action_flag

Enumerator
SDP_T38_NONE 

Do not modify T38 information at all

SDP_T38_INITIATE 

Remote side has requested T38 with us

SDP_T38_ACCEPT 

Remote side accepted our T38 request

Definition at line 691 of file sip.h.

695  {

◆ t38state

enum t38state

T38 States for a call.

Enumerator
T38_DISABLED 

Not enabled

T38_LOCAL_REINVITE 

Offered from local - REINVITE

T38_PEER_REINVITE 

Offered from peer - REINVITE

T38_ENABLED 

Negotiated (enabled)

T38_REJECTED 

Refused

Definition at line 665 of file sip.h.

667  {
668  REFER_IDLE, /*!< No REFER is in progress */
669  REFER_SENT, /*!< Sent REFER to transferee */
670  REFER_RECEIVED, /*!< Received REFER from transferrer */
671  REFER_CONFIRMED, /*!< Refer confirmed with a 100 TRYING (unused) */

◆ transfermodes

Authorization scheme for call transfers.

Note
Not a bitfield flag, since there are plans for other modes, like "only allow transfers for authenticated devices"
Enumerator
TRANSFER_OPENFORALL 

Allow all SIP transfers

TRANSFER_CLOSED 

Allow no SIP transfers

Definition at line 414 of file sip.h.

425  {

◆ xmittype

enum xmittype

When sending a SIP message, we can send with a few options, depending on type of SIP request. UNRELIABLE is moslty used for responses to repeated requests, where the original response would be sent RELIABLE in an INVITE transaction.

Enumerator
XMIT_CRITICAL 

Transmit critical SIP message reliably, with re-transmits. If it fails, it's critical and will cause a teardown of the session

XMIT_RELIABLE 

Transmit SIP message reliably, with re-transmits

XMIT_UNRELIABLE 

Transmit SIP message without bothering with re-transmits

Definition at line 457 of file sip.h.

Function Documentation

◆ __init_check_auth_buf()

static void __init_check_auth_buf ( void  )
static

Definition at line 1883 of file sip.h.

1888 { ao2_t_cleanup(peer, tag); (NULL); })
#define ao2_t_cleanup(obj, tag)
Definition: astobj2.h:1959
#define NULL
Definition: resample.c:96

◆ sip_auth_headers()

void sip_auth_headers ( enum sip_auth_type  code,
char **  header,
char **  respheader 
)

return the request and response header for a 401 or 407 code

Definition at line 16549 of file chan_sip.c.

References ast_verbose(), PROXY_AUTH, and WWW_AUTH.

Referenced by check_auth(), do_message_auth(), do_proxy_auth(), do_register_auth(), sip_report_security_event(), and transmit_request_with_auth().

16550 {
16551  if (code == WWW_AUTH) { /* 401 */
16552  *header = "WWW-Authenticate";
16553  *respheader = "Authorization";
16554  } else if (code == PROXY_AUTH) { /* 407 */
16555  *header = "Proxy-Authenticate";
16556  *respheader = "Proxy-Authorization";
16557  } else {
16558  ast_verbose("-- wrong response code %u\n", code);
16559  *header = *respheader = "Invalid";
16560  }
16561 }
void ast_verbose(const char *fmt,...)
Definition: extconf.c:2207
Definition: sip.h:504

◆ sip_find_peer()

struct sip_peer* sip_find_peer ( const char *  peer,
struct ast_sockaddr addr,
int  realtime,
int  which_objects,
int  devstate_only,
int  transport 
)

Locate device by name or ip address.

Parameters
peer,addr,realtime,devstate_only,transport
which_objectsDefine which objects should be matched when doing a lookup by name. Valid options are FINDUSERS, FINDPEERS, or FINDALLDEVICES. Note that this option is not used at all when doing a lookup by IP.

This is used on find matching device on name or ip/port. If the device was declared as type=peer, we don't match on peer name on incoming INVITEs.

Note
Avoid using this function in new functions if there is a way to avoid it, since it might cause a database lookup.

Definition at line 5851 of file chan_sip.c.

References NULL, and sip_find_peer_full().

Referenced by _sip_qualify_peer(), _sip_show_peer(), check_peer_ok(), create_addr(), function_sippeer(), handle_request_notify(), manager_sip_peer_status(), receive_message(), register_verify(), sip_devicestate(), sip_do_debug_peer(), sip_msg_send(), sip_report_security_event(), sip_show_user(), sip_unregister(), and transmit_register().

5852 {
5853  return sip_find_peer_full(peer, addr, NULL, realtime, which_objects, devstate_only, transport);
5854 }
#define NULL
Definition: resample.c:96
static struct sip_peer * sip_find_peer_full(const char *peer, struct ast_sockaddr *addr, char *callbackexten, int realtime, int which_objects, int devstate_only, int transport)
Definition: chan_sip.c:5789

◆ sip_get_header()

const char* sip_get_header ( const struct sip_request req,
const char *  name 
)

Get header from SIP request.

Returns
Always return something, so don't check for NULL because it won't happen :-)

Definition at line 8600 of file chan_sip.c.

References __get_header().

Referenced by __find_call(), __sip_alloc(), __transmit_response(), build_route(), cc_handle_publish_error(), change_redirecting_information(), check_auth(), check_user_full(), check_via(), copy_header(), extract_uri(), find_sdp(), get_also_info(), get_destination(), get_pai(), get_rdnis(), get_realm(), get_refer_info(), get_rpid(), gettag(), handle_cc_notify(), handle_cc_subscribe(), handle_incoming(), handle_request_bye(), handle_request_do(), handle_request_info(), handle_request_invite(), handle_request_invite_st(), handle_request_notify(), handle_request_publish(), handle_request_register(), handle_request_subscribe(), handle_request_update(), handle_response(), handle_response_invite(), handle_response_notify(), handle_response_publish(), handle_response_refer(), handle_response_register(), handle_response_subscribe(), handle_response_update(), parse_allowed_methods(), parse_moved_contact(), parse_ok_contact(), parse_oli(), parse_register_contact(), proc_422_rsp(), process_via(), receive_message(), register_verify(), reqprep(), respprep(), send_check_user_failure_response(), send_request(), send_response(), sip_get_cc_information(), sip_pidf_validate(), sip_report_security_event(), sip_sipredirect(), transmit_fake_auth_response(), transmit_invite(), transmit_refer(), transmit_response_with_auth(), transmit_response_with_sdp(), transmit_response_with_t38_sdp(), transmit_state_notify(), uac_sips_contact(), uas_sips_contact(), and use_reason_header().

8601 {
8602  int start = 0;
8603  return __get_header(req, name, &start);
8604 }
static const char * __get_header(const struct sip_request *req, const char *name, int *start)
Definition: chan_sip.c:8562
static const char name[]
Definition: cdr_mysql.c:74

◆ sip_get_transport()

const char* sip_get_transport ( enum ast_transport  t)

Return transport as string.

Definition at line 3725 of file chan_sip.c.

References AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, AST_TRANSPORT_WS, and AST_TRANSPORT_WSS.

Referenced by _sip_show_peer(), ast_sip_ouraddrfor(), build_contact(), get_transport_pvt(), handle_request_do(), parse_moved_contact(), sip_report_security_event(), sip_show_settings(), sip_show_tcp(), and transmit_notify_with_mwi().

3726 {
3727  switch (t) {
3728  case AST_TRANSPORT_UDP:
3729  return "UDP";
3730  case AST_TRANSPORT_TCP:
3731  return "TCP";
3732  case AST_TRANSPORT_TLS:
3733  return "TLS";
3734  case AST_TRANSPORT_WS:
3735  case AST_TRANSPORT_WSS:
3736  return "WS";
3737  }
3738 
3739  return "UNKNOWN";
3740 }

Variable Documentation

◆ check_auth_buf

struct ast_threadstorage check_auth_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_check_auth_buf , .custom_init = NULL , }
static

Definition at line 1883 of file sip.h.

Referenced by check_auth(), sip_report_security_event(), and transmit_fake_auth_response().

◆ sip_options

const struct cfsip_options sip_options[]
static