Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
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 REQ_OFFSET_TO_STR(req, offset)   (ast_str_buffer((req)->data) + ((req)->offset))
 given a sip_request and an offset, return the char * that resides there More...
 
#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_ref_peer(peer, tag)   ao2_t_bump(peer, tag)
 
#define SIP_RESERVED   ";/?:@&=+$,# "
 
#define SIP_TRANS_TIMEOUT   64 * DEFAULT_TIMER_T1
 
#define sip_unref_peer(peer, tag)   ({ ao2_t_cleanup(peer, tag); (NULL); })
 
#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_ACCEPT_OUTOFCALL_MESSAGE   TRUE
 
#define DEFAULT_ALLOW_EXT_DOM   TRUE
 
#define DEFAULT_ALLOWGUEST   TRUE
 
#define DEFAULT_ALWAYSAUTHREJECT   TRUE
 
#define DEFAULT_AUTH_MESSAGE   TRUE
 
#define DEFAULT_AUTH_OPTIONS   FALSE
 
#define DEFAULT_AUTOCREATEPEER   AUTOPEERS_DISABLED
 
#define DEFAULT_CALLCOUNTER   FALSE
 
#define DEFAULT_CALLERID   "asterisk"
 
#define DEFAULT_COMPACTHEADERS   FALSE
 
#define DEFAULT_CONTEXT   "default"
 
#define DEFAULT_COS_AUDIO   5
 
#define DEFAULT_COS_SIP   4
 
#define DEFAULT_COS_TEXT   5
 
#define DEFAULT_COS_VIDEO   6
 
#define DEFAULT_DOMAINSASREALM   FALSE
 
#define DEFAULT_ENGINE   "asterisk"
 
#define DEFAULT_KEEPALIVE   0
 
#define DEFAULT_KEEPALIVE_INTERVAL   60
 
#define DEFAULT_LEGACY_USEROPTION_PARSING   FALSE
 
#define DEFAULT_MATCHEXTERNADDRLOCALLY   FALSE
 
#define DEFAULT_MAX_CALL_BITRATE   (384)
 
#define DEFAULT_MOHINTERPRET   "default"
 
#define DEFAULT_MOHSUGGEST   ""
 
#define DEFAULT_MWI_FROM   ""
 
#define DEFAULT_NOTIFYCID   DISABLED
 
#define DEFAULT_NOTIFYMIME   "application/simple-message-summary"
 
#define DEFAULT_NOTIFYRINGING   NOTIFYRINGING_ENABLED
 
#define DEFAULT_PEDANTIC   TRUE
 
#define DEFAULT_QUALIFY   FALSE
 
#define DEFAULT_REALM   "asterisk"
 
#define DEFAULT_RECORD_FEATURE   "automon"
 
#define DEFAULT_REGEXTENONQUALIFY   FALSE
 
#define DEFAULT_RTPKEEPALIVE   0
 
#define DEFAULT_SDPOWNER   "root"
 
#define DEFAULT_SDPSESSION   "Asterisk PBX"
 
#define DEFAULT_SEND_DIVERSION   TRUE
 
#define DEFAULT_SRVLOOKUP   TRUE
 
#define DEFAULT_STORE_SIP_CAUSE   FALSE
 
#define DEFAULT_T1MIN   100
 
#define DEFAULT_TOS_AUDIO   0
 
#define DEFAULT_TOS_SIP   0
 
#define DEFAULT_TOS_TEXT   0
 
#define DEFAULT_TOS_VIDEO   0
 
#define DEFAULT_USERAGENT   "Asterisk PBX"
 
#define DEFAULT_VMEXTEN   "asterisk"
 
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_CALL_LIMIT   (1 << 7)
 
#define SIP_DEFER_BYE_ON_TRANSFER   (1 << 10)
 
#define SIP_DIRECT_MEDIA   (1 << 20)
 
#define SIP_DIRECT_MEDIA_NAT   (2 << 20)
 
#define SIP_DTMF   (7 << 15)
 
#define SIP_DTMF_AUTO   (3 << 15)
 
#define SIP_DTMF_INBAND   (1 << 15)
 
#define SIP_DTMF_INFO   (2 << 15)
 
#define SIP_DTMF_RFC2833   (0 << 15)
 
#define SIP_DTMF_SHORTINFO   (4 << 15)
 
#define SIP_FLAGS_TO_COPY
 Flags to copy from peer/user to dialog. More...
 
#define SIP_G726_NONSTANDARD   (1 << 31)
 
#define SIP_GOTREFER   (1 << 6)
 
#define SIP_INC_COUNT   (1 << 8)
 
#define SIP_INC_RINGING   (1 << 9)
 
#define SIP_INSECURE   (3 << 23)
 
#define SIP_INSECURE_INVITE   (1 << 24)
 
#define SIP_INSECURE_NONE   (0 << 23)
 
#define SIP_INSECURE_PORT   (1 << 23)
 
#define SIP_NAT_FORCE_RPORT   (1 << 18)
 
#define SIP_NAT_RPORT_PRESENT   (1 << 19)
 
#define SIP_NEEDREINVITE   (1 << 4)
 
#define SIP_OFFER_CC   (1 << 1)
 
#define SIP_OUTGOING   (1 << 0)
 
#define SIP_PENDINGBYE   (1 << 5)
 
#define SIP_PROG_INBAND   (3 << 25)
 
#define SIP_PROG_INBAND_NEVER   (1 << 25)
 
#define SIP_PROG_INBAND_NO   (0 << 25)
 
#define SIP_PROG_INBAND_YES   (2 << 25)
 
#define SIP_PROGRESS_SENT   (1 << 3)
 
#define SIP_PROMISCREDIR   (1 << 11)
 
#define SIP_REINVITE   (7 << 20)
 
#define SIP_REINVITE_NONE   (0 << 20)
 
#define SIP_REINVITE_UPDATE   (4 << 20)
 
#define SIP_RINGING   (1 << 2)
 
#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_TRUSTRPID   (1 << 12)
 
#define SIP_USECLIENTCODE   (1 << 14)
 
#define SIP_USEPATH   (1 << 27)
 
#define SIP_USEREQPHONE   (1 << 13)
 
SIPflags2

a second page of flags (for flags[1]

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

Typedefs

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

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_cc_notify_state { CC_QUEUED , CC_READY }
 The states that can be represented in a SIP call-completion NOTIFY. More...
 
enum  sip_cc_publish_state { CC_CLOSED , CC_OPEN }
 The states that can be represented in a SIP call-completion PUBLISH. 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_mailbox_status { SIP_MAILBOX_STATUS_UNKNOWN = 0 , SIP_MAILBOX_STATUS_EXISTING , SIP_MAILBOX_STATUS_NEW }
 
enum  sip_peer_type { SIP_TYPE_PEER = (1 << 0) , SIP_TYPE_USER = (1 << 1) }
 
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...
 
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 mostly used for responses to repeated requests, where the original response would be sent RELIABLE in an INVITE transaction. More...
 

Functions

static void __init_check_auth_buf (void)
 
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...
 
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...
 
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...
 

Variables

static struct ast_threadstorage check_auth_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_check_auth_buf , .custom_init = NULL , }
 
static const struct cfsip_options sip_options []
 

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 166 of file sip.h.

◆ CALLERID_UNKNOWN

#define CALLERID_UNKNOWN   "Anonymous"

Definition at line 88 of file sip.h.

◆ CHECK_AUTH_BUF_INITLEN

#define CHECK_AUTH_BUF_INITLEN   256

Definition at line 398 of file sip.h.

◆ DEC_CALL_LIMIT

#define DEC_CALL_LIMIT   0

Definition at line 120 of file sip.h.

◆ DEC_CALL_RINGING

#define DEC_CALL_RINGING   2

Definition at line 122 of file sip.h.

◆ DEFAULT_ACCEPT_OUTOFCALL_MESSAGE

#define DEFAULT_ACCEPT_OUTOFCALL_MESSAGE   TRUE

Definition at line 226 of file sip.h.

◆ DEFAULT_ALLOW_EXT_DOM

#define DEFAULT_ALLOW_EXT_DOM   TRUE

Allow external domains

Definition at line 212 of file sip.h.

◆ DEFAULT_ALLOWGUEST

#define DEFAULT_ALLOWGUEST   TRUE

Definition at line 199 of file sip.h.

◆ DEFAULT_ALWAYSAUTHREJECT

#define DEFAULT_ALWAYSAUTHREJECT   TRUE

Don't reject authentication requests always

Definition at line 223 of file sip.h.

◆ DEFAULT_AUTH_MESSAGE

#define DEFAULT_AUTH_MESSAGE   TRUE

Definition at line 225 of file sip.h.

◆ DEFAULT_AUTH_OPTIONS

#define DEFAULT_AUTH_OPTIONS   FALSE

Definition at line 224 of file sip.h.

◆ DEFAULT_AUTHLIMIT

#define DEFAULT_AUTHLIMIT   100

Definition at line 69 of file sip.h.

◆ DEFAULT_AUTHTIMEOUT

#define DEFAULT_AUTHTIMEOUT   30

Definition at line 70 of file sip.h.

◆ DEFAULT_AUTOCREATEPEER

#define DEFAULT_AUTOCREATEPEER   AUTOPEERS_DISABLED

Don't create peers automagically

Definition at line 218 of file sip.h.

◆ DEFAULT_CALLCOUNTER

#define DEFAULT_CALLCOUNTER   FALSE

Do not enable call counters by default

Definition at line 201 of file sip.h.

◆ DEFAULT_CALLERID

#define DEFAULT_CALLERID   "asterisk"

Default caller ID

Definition at line 196 of file sip.h.

◆ DEFAULT_COMPACTHEADERS

#define DEFAULT_COMPACTHEADERS   FALSE

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

Definition at line 203 of file sip.h.

◆ DEFAULT_CONTEXT

#define DEFAULT_CONTEXT   "default"

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

Definition at line 191 of file sip.h.

◆ DEFAULT_COS_AUDIO

#define DEFAULT_COS_AUDIO   5

Level 2 class of service for audio media

Definition at line 209 of file sip.h.

◆ DEFAULT_COS_SIP

#define DEFAULT_COS_SIP   4

Level 2 class of service for SIP signalling

Definition at line 208 of file sip.h.

◆ DEFAULT_COS_TEXT

#define DEFAULT_COS_TEXT   5

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

Definition at line 211 of file sip.h.

◆ DEFAULT_COS_VIDEO

#define DEFAULT_COS_VIDEO   6

Level 2 class of service for video media

Definition at line 210 of file sip.h.

◆ DEFAULT_DEFAULT_EXPIRY

#define DEFAULT_DEFAULT_EXPIRY   120

Definition at line 62 of file sip.h.

◆ DEFAULT_DOMAINSASREALM

#define DEFAULT_DOMAINSASREALM   FALSE

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

Definition at line 214 of file sip.h.

◆ DEFAULT_ENGINE

#define DEFAULT_ENGINE   "asterisk"

Default RTP engine to use for sessions

Definition at line 236 of file sip.h.

◆ DEFAULT_EXPIRY

#define DEFAULT_EXPIRY   900

Expire slowly

Definition at line 83 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 93 of file sip.h.

◆ DEFAULT_KEEPALIVE

#define DEFAULT_KEEPALIVE   0

Don't send keep alive packets

Definition at line 221 of file sip.h.

◆ DEFAULT_KEEPALIVE_INTERVAL

#define DEFAULT_KEEPALIVE_INTERVAL   60

Send keep alive packets at 60 second intervals

Definition at line 222 of file sip.h.

◆ DEFAULT_LEGACY_USEROPTION_PARSING

#define DEFAULT_LEGACY_USEROPTION_PARSING   FALSE

Definition at line 228 of file sip.h.

◆ DEFAULT_MATCHEXTERNADDRLOCALLY

#define DEFAULT_MATCHEXTERNADDRLOCALLY   FALSE

Match extern IP locally default setting

Definition at line 219 of file sip.h.

◆ DEFAULT_MAX_CALL_BITRATE

#define DEFAULT_MAX_CALL_BITRATE   (384)

Max bitrate for video

Definition at line 231 of file sip.h.

◆ DEFAULT_MAX_EXPIRY

#define DEFAULT_MAX_EXPIRY   3600

Definition at line 64 of file sip.h.

◆ DEFAULT_MAX_FORWARDS

#define DEFAULT_MAX_FORWARDS   70

Definition at line 67 of file sip.h.

◆ DEFAULT_MAX_SE

#define DEFAULT_MAX_SE   1800

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

Definition at line 112 of file sip.h.

◆ DEFAULT_MAXMS

#define DEFAULT_MAXMS   2000

Qualification: Must be faster than 2 seconds by default

Definition at line 91 of file sip.h.

◆ DEFAULT_MIN_EXPIRY

#define DEFAULT_MIN_EXPIRY   60

Definition at line 63 of file sip.h.

◆ DEFAULT_MIN_SE

#define DEFAULT_MIN_SE   90

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

Definition at line 113 of file sip.h.

◆ DEFAULT_MOHINTERPRET

#define DEFAULT_MOHINTERPRET   "default"

The default music class

Definition at line 193 of file sip.h.

◆ DEFAULT_MOHSUGGEST

#define DEFAULT_MOHSUGGEST   ""

Definition at line 194 of file sip.h.

◆ DEFAULT_MWI_EXPIRY

#define DEFAULT_MWI_EXPIRY   3600

Definition at line 65 of file sip.h.

◆ DEFAULT_MWI_FROM

#define DEFAULT_MWI_FROM   ""

Definition at line 197 of file sip.h.

◆ DEFAULT_NOTIFYCID

#define DEFAULT_NOTIFYCID   DISABLED

Include CID with ringing notifications

Definition at line 216 of file sip.h.

◆ DEFAULT_NOTIFYMIME

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

Definition at line 198 of file sip.h.

◆ DEFAULT_NOTIFYRINGING

#define DEFAULT_NOTIFYRINGING   NOTIFYRINGING_ENABLED

Notify devicestate system on ringing state

Definition at line 215 of file sip.h.

◆ DEFAULT_PEDANTIC

#define DEFAULT_PEDANTIC   TRUE

Follow SIP standards for dialog matching

Definition at line 217 of file sip.h.

◆ DEFAULT_QUALIFY

#define DEFAULT_QUALIFY   FALSE

Don't monitor devices

Definition at line 220 of file sip.h.

◆ DEFAULT_QUALIFY_GAP

#define DEFAULT_QUALIFY_GAP   100

Definition at line 85 of file sip.h.

◆ DEFAULT_QUALIFY_PEERS

#define DEFAULT_QUALIFY_PEERS   1

Definition at line 86 of file sip.h.

◆ DEFAULT_QUALIFYFREQ

#define DEFAULT_QUALIFYFREQ   60 * 1000

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

Definition at line 92 of file sip.h.

◆ DEFAULT_REALM

#define DEFAULT_REALM   "asterisk"

Realm for HTTP digest authentication

Definition at line 213 of file sip.h.

◆ DEFAULT_RECORD_FEATURE

#define DEFAULT_RECORD_FEATURE   "automon"

The default feature specified for use with INFO

Definition at line 192 of file sip.h.

◆ DEFAULT_REGEXTENONQUALIFY

#define DEFAULT_REGEXTENONQUALIFY   FALSE

Definition at line 227 of file sip.h.

◆ DEFAULT_REGISTRATION_TIMEOUT

#define DEFAULT_REGISTRATION_TIMEOUT   20

Definition at line 66 of file sip.h.

◆ DEFAULT_RETRANS

#define DEFAULT_RETRANS   1000

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

Definition at line 95 of file sip.h.

◆ DEFAULT_RTPKEEPALIVE

#define DEFAULT_RTPKEEPALIVE   0

Default RTPkeepalive setting

Definition at line 200 of file sip.h.

◆ DEFAULT_SDPOWNER

#define DEFAULT_SDPOWNER   "root"

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

Definition at line 235 of file sip.h.

◆ DEFAULT_SDPSESSION

#define DEFAULT_SDPSESSION   "Asterisk PBX"

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

Definition at line 234 of file sip.h.

◆ DEFAULT_SEND_DIVERSION

#define DEFAULT_SEND_DIVERSION   TRUE

Definition at line 229 of file sip.h.

◆ DEFAULT_SRVLOOKUP

#define DEFAULT_SRVLOOKUP   TRUE

Recommended setting is ON

Definition at line 202 of file sip.h.

◆ 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 237 of file sip.h.

◆ DEFAULT_T1MIN

#define DEFAULT_T1MIN   100

100 MS for minimal roundtrip time

Definition at line 230 of file sip.h.

◆ DEFAULT_TIMER_T1

#define DEFAULT_TIMER_T1   500

SIP timer T1 (according to RFC 3261)

Definition at line 96 of file sip.h.

◆ 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 205 of file sip.h.

◆ 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 204 of file sip.h.

◆ 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 207 of file sip.h.

◆ 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 206 of file sip.h.

◆ DEFAULT_TRANS_TIMEOUT

#define DEFAULT_TRANS_TIMEOUT   -1

Use default SIP transaction timeout

Definition at line 100 of file sip.h.

◆ DEFAULT_USERAGENT

#define DEFAULT_USERAGENT   "Asterisk PBX"

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

Definition at line 233 of file sip.h.

◆ DEFAULT_VMEXTEN

#define DEFAULT_VMEXTEN   "asterisk"

Default voicemail extension

Definition at line 195 of file sip.h.

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

◆ 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 80 of file sip.h.

◆ EXPIRY_GUARD_PCT

#define EXPIRY_GUARD_PCT   0.20

Percentage of expires timeout to use when below EXPIRY_GUARD_LIMIT

Definition at line 82 of file sip.h.

◆ EXPIRY_GUARD_SECS

#define EXPIRY_GUARD_SECS   15

How long before expiry do we reregister

Definition at line 74 of file sip.h.

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

◆ FINDPEERS

#define FINDPEERS   (1 << 1)

Definition at line 53 of file sip.h.

◆ FINDUSERS

#define FINDUSERS   (1 << 0)

Definition at line 52 of file sip.h.

◆ FROMDOMAIN_INVALID

#define FROMDOMAIN_INVALID   "anonymous.invalid"

Definition at line 89 of file sip.h.

◆ INC_CALL_LIMIT

#define INC_CALL_LIMIT   1

Definition at line 121 of file sip.h.

◆ INC_CALL_RINGING

#define INC_CALL_RINGING   3

Definition at line 123 of file sip.h.

◆ INITIAL_CSEQ

#define INITIAL_CSEQ   101

Our initial sip sequence number

Definition at line 110 of file sip.h.

◆ MAX_AUTHTRIES

#define MAX_AUTHTRIES   3

Try authentication three times, then fail

Definition at line 102 of file sip.h.

◆ MAX_HISTORY_ENTRIES

#define MAX_HISTORY_ENTRIES   50

Max entires in the history list for a sip_pvt

Definition at line 108 of file sip.h.

◆ NO_RTP

#define NO_RTP   0

Definition at line 118 of file sip.h.

◆ NOT_SUPPORTED

#define NOT_SUPPORTED   0

Definition at line 136 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 481 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 101 of file sip.h.

◆ REQ_OFFSET_TO_STR

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

given a sip_request and an offset, return the char * that resides there

It used to be that rlpart1, rlpart2, and the header and line arrays were character pointers. They are now offsets into the ast_str portion of the sip_request structure. To avoid adding a bunch of redundant pointer arithmetic to the code, this macro is provided to retrieve the string at a particular offset within the request's buffer

Definition at line 857 of file sip.h.

◆ RTP

#define RTP   1

Definition at line 117 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 115 of file sip.h.

◆ SIP_CALL_LIMIT

#define SIP_CALL_LIMIT   (1 << 7)

D: Call limit enforced for this call

Definition at line 259 of file sip.h.

◆ SIP_DEFER_BYE_ON_TRANSFER

#define SIP_DEFER_BYE_ON_TRANSFER   (1 << 10)

D: Do not hangup at first ast_hangup

Definition at line 262 of file sip.h.

◆ SIP_DIRECT_MEDIA

#define SIP_DIRECT_MEDIA   (1 << 20)

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

Definition at line 284 of file sip.h.

◆ SIP_DIRECT_MEDIA_NAT

#define SIP_DIRECT_MEDIA_NAT   (2 << 20)

DP: allow media reinvite when new peer is behind NAT

Definition at line 285 of file sip.h.

◆ SIP_DTMF

#define SIP_DTMF   (7 << 15)

DP: DTMF Support: five settings, uses three bits

Definition at line 270 of file sip.h.

◆ SIP_DTMF_AUTO

#define SIP_DTMF_AUTO   (3 << 15)

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

Definition at line 274 of file sip.h.

◆ SIP_DTMF_INBAND

#define SIP_DTMF_INBAND   (1 << 15)

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

Definition at line 272 of file sip.h.

◆ SIP_DTMF_INFO

#define SIP_DTMF_INFO   (2 << 15)

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

Definition at line 273 of file sip.h.

◆ SIP_DTMF_RFC2833

#define SIP_DTMF_RFC2833   (0 << 15)

DP: DTMF Support: RTP DTMF - "rfc2833"

Definition at line 271 of file sip.h.

◆ SIP_DTMF_SHORTINFO

#define SIP_DTMF_SHORTINFO   (4 << 15)

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

Definition at line 275 of file sip.h.

◆ SIP_FLAGS_TO_COPY

#define SIP_FLAGS_TO_COPY
Value:
SIP_USEREQPHONE | SIP_INSECURE | SIP_USEPATH)
#define SIP_DTMF
Definition: sip.h:270
#define SIP_INSECURE
Definition: sip.h:289
#define SIP_REINVITE
Definition: sip.h:282
#define SIP_USECLIENTCODE
Definition: sip.h:267
#define SIP_SENDRPID
Definition: sip.h:301
#define SIP_G726_NONSTANDARD
Definition: sip.h:305
#define SIP_USEPATH
Definition: sip.h:300
#define SIP_TRUSTRPID
Definition: sip.h:265
#define SIP_NAT_FORCE_RPORT
Definition: sip.h:278
#define SIP_PROMISCREDIR
Definition: sip.h:264

Flags to copy from peer/user to dialog.

Definition at line 308 of file sip.h.

◆ SIP_G726_NONSTANDARD

#define SIP_G726_NONSTANDARD   (1 << 31)

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

Definition at line 305 of file sip.h.

◆ SIP_GOTREFER

#define SIP_GOTREFER   (1 << 6)

D: Got a refer?

Definition at line 258 of file sip.h.

◆ SIP_INC_COUNT

#define SIP_INC_COUNT   (1 << 8)

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

Definition at line 260 of file sip.h.

◆ SIP_INC_RINGING

#define SIP_INC_RINGING   (1 << 9)

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

Definition at line 261 of file sip.h.

◆ SIP_INSECURE

#define SIP_INSECURE   (3 << 23)

DP: three settings, uses two bits

Definition at line 289 of file sip.h.

◆ SIP_INSECURE_INVITE

#define SIP_INSECURE_INVITE   (1 << 24)

DP: don't require authentication for incoming INVITEs

Definition at line 292 of file sip.h.

◆ SIP_INSECURE_NONE

#define SIP_INSECURE_NONE   (0 << 23)

DP: secure mode

Definition at line 290 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 291 of file sip.h.

◆ SIP_MAX_HEADERS

#define SIP_MAX_HEADERS   64

Max amount of SIP headers to read

Definition at line 104 of file sip.h.

◆ SIP_MAX_LINES

#define SIP_MAX_LINES   256

Max amount of lines in SIP attachment (like SDP)

Definition at line 105 of file sip.h.

◆ SIP_MAX_PACKET_SIZE

#define SIP_MAX_PACKET_SIZE   20480

Max SIP packet size

Definition at line 106 of file sip.h.

◆ SIP_MIN_PACKET

#define SIP_MIN_PACKET   4096

Initialize size of memory to allocate for packets

Definition at line 107 of file sip.h.

◆ SIP_NAT_FORCE_RPORT

#define SIP_NAT_FORCE_RPORT   (1 << 18)

DP: Force rport even if not present in the request

Definition at line 278 of file sip.h.

◆ SIP_NAT_RPORT_PRESENT

#define SIP_NAT_RPORT_PRESENT   (1 << 19)

DP: rport was present in the request

Definition at line 279 of file sip.h.

◆ SIP_NEEDREINVITE

#define SIP_NEEDREINVITE   (1 << 4)

D: Do we need to send another reinvite?

Definition at line 256 of file sip.h.

◆ SIP_OFFER_CC

#define SIP_OFFER_CC   (1 << 1)

D: Offer CC on subsequent responses

Definition at line 253 of file sip.h.

◆ SIP_OPT_100REL

#define SIP_OPT_100REL   (1 << 1)

Definition at line 140 of file sip.h.

◆ SIP_OPT_EARLY_SESSION

#define SIP_OPT_EARLY_SESSION   (1 << 3)

Definition at line 142 of file sip.h.

◆ SIP_OPT_EVENTLIST

#define SIP_OPT_EVENTLIST   (1 << 11)

Definition at line 150 of file sip.h.

◆ SIP_OPT_FROMCHANGE

#define SIP_OPT_FROMCHANGE   (1 << 17)

Definition at line 156 of file sip.h.

◆ SIP_OPT_GRUU

#define SIP_OPT_GRUU   (1 << 12)

Definition at line 151 of file sip.h.

◆ SIP_OPT_HISTINFO

#define SIP_OPT_HISTINFO   (1 << 15)

Definition at line 154 of file sip.h.

◆ SIP_OPT_JOIN

#define SIP_OPT_JOIN   (1 << 4)

Definition at line 143 of file sip.h.

◆ SIP_OPT_NOREFERSUB

#define SIP_OPT_NOREFERSUB   (1 << 14)

Definition at line 153 of file sip.h.

◆ SIP_OPT_OUTBOUND

#define SIP_OPT_OUTBOUND   (1 << 20)

Definition at line 159 of file sip.h.

◆ SIP_OPT_PATH

#define SIP_OPT_PATH   (1 << 5)

Definition at line 144 of file sip.h.

◆ SIP_OPT_PRECONDITION

#define SIP_OPT_PRECONDITION   (1 << 7)

Definition at line 146 of file sip.h.

◆ SIP_OPT_PREF

#define SIP_OPT_PREF   (1 << 6)

Definition at line 145 of file sip.h.

◆ SIP_OPT_PRIVACY

#define SIP_OPT_PRIVACY   (1 << 8)

Definition at line 147 of file sip.h.

◆ SIP_OPT_RECLISTINV

#define SIP_OPT_RECLISTINV   (1 << 18)

Definition at line 157 of file sip.h.

◆ SIP_OPT_RECLISTSUB

#define SIP_OPT_RECLISTSUB   (1 << 19)

Definition at line 158 of file sip.h.

◆ SIP_OPT_REPLACES

#define SIP_OPT_REPLACES   (1 << 0)

Definition at line 139 of file sip.h.

◆ SIP_OPT_RESPRIORITY

#define SIP_OPT_RESPRIORITY   (1 << 16)

Definition at line 155 of file sip.h.

◆ SIP_OPT_SDP_ANAT

#define SIP_OPT_SDP_ANAT   (1 << 9)

Definition at line 148 of file sip.h.

◆ SIP_OPT_SEC_AGREE

#define SIP_OPT_SEC_AGREE   (1 << 10)

Definition at line 149 of file sip.h.

◆ SIP_OPT_TARGET_DIALOG

#define SIP_OPT_TARGET_DIALOG   (1 << 13)

Definition at line 152 of file sip.h.

◆ SIP_OPT_TIMER

#define SIP_OPT_TIMER   (1 << 2)

Definition at line 141 of file sip.h.

◆ SIP_OPT_UNKNOWN

#define SIP_OPT_UNKNOWN   (1 << 21)

Definition at line 160 of file sip.h.

◆ SIP_OUTGOING

#define SIP_OUTGOING   (1 << 0)

D: Direction of the last transaction in this dialog

Definition at line 252 of file sip.h.

◆ SIP_PAGE2_ALLOWOVERLAP

#define SIP_PAGE2_ALLOWOVERLAP   (3 << 13)

DP: Allow overlap dialing ?

Definition at line 334 of file sip.h.

◆ SIP_PAGE2_ALLOWOVERLAP_DTMF

#define SIP_PAGE2_ALLOWOVERLAP_DTMF   (2 << 13)

Yes, using the DTMF transmission through Early Media

Definition at line 337 of file sip.h.

◆ SIP_PAGE2_ALLOWOVERLAP_NO

#define SIP_PAGE2_ALLOWOVERLAP_NO   (0 << 13)

No, terminate with 404 Not found

Definition at line 335 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 338 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 336 of file sip.h.

◆ SIP_PAGE2_ALLOWSUBSCRIBE

#define SIP_PAGE2_ALLOWSUBSCRIBE   (1 << 12)

GP: Allow subscriptions from this peer?

Definition at line 332 of file sip.h.

◆ SIP_PAGE2_BUGGY_MWI

#define SIP_PAGE2_BUGGY_MWI   (1 << 22)

DP: Buggy CISCO MWI fix

Definition at line 354 of file sip.h.

◆ SIP_PAGE2_CALL_ONHOLD

#define SIP_PAGE2_CALL_ONHOLD   (3 << 19)

D: Call hold states:

Definition at line 348 of file sip.h.

◆ SIP_PAGE2_CALL_ONHOLD_ACTIVE

#define SIP_PAGE2_CALL_ONHOLD_ACTIVE   (1 << 19)

D: Active hold

Definition at line 349 of file sip.h.

◆ SIP_PAGE2_CALL_ONHOLD_INACTIVE

#define SIP_PAGE2_CALL_ONHOLD_INACTIVE   (3 << 19)

D: Inactive hold

Definition at line 351 of file sip.h.

◆ SIP_PAGE2_CALL_ONHOLD_ONEDIR

#define SIP_PAGE2_CALL_ONHOLD_ONEDIR   (2 << 19)

D: One directional hold

Definition at line 350 of file sip.h.

◆ SIP_PAGE2_CONNECTLINEUPDATE_PEND

#define SIP_PAGE2_CONNECTLINEUPDATE_PEND   (1 << 6)

Definition at line 326 of file sip.h.

◆ SIP_PAGE2_DIALOG_ESTABLISHED

#define SIP_PAGE2_DIALOG_ESTABLISHED   (1 << 23)

29: Has a dialog been established?

Definition at line 355 of file sip.h.

◆ SIP_PAGE2_FAX_DETECT

#define SIP_PAGE2_FAX_DETECT   (3 << 24)

DP: Fax Detection support

Definition at line 357 of file sip.h.

◆ SIP_PAGE2_FAX_DETECT_BOTH

#define SIP_PAGE2_FAX_DETECT_BOTH   (3 << 24)

DP: Fax Detection support - detect both

Definition at line 360 of file sip.h.

◆ SIP_PAGE2_FAX_DETECT_CNG

#define SIP_PAGE2_FAX_DETECT_CNG   (1 << 24)

DP: Fax Detection support - detect CNG in audio

Definition at line 358 of file sip.h.

◆ 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 359 of file sip.h.

◆ SIP_PAGE2_FLAGS_TO_COPY

#define SIP_PAGE2_FLAGS_TO_COPY

Definition at line 372 of file sip.h.

◆ SIP_PAGE2_HAVEPEERCONTEXT

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

Definition at line 364 of file sip.h.

◆ 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 341 of file sip.h.

◆ SIP_PAGE2_PREFERRED_CODEC

#define SIP_PAGE2_PREFERRED_CODEC   (1 << 9)

GDP: Only respond with single most preferred joint codec

Definition at line 329 of file sip.h.

◆ SIP_PAGE2_Q850_REASON

#define SIP_PAGE2_Q850_REASON   (1 << 3)

DP: Get/send cause code via Reason header

Definition at line 323 of file sip.h.

◆ SIP_PAGE2_RFC2833_COMPENSATE

#define SIP_PAGE2_RFC2833_COMPENSATE   (1 << 21)

DP: Compensate for buggy RFC2833 implementations

Definition at line 353 of file sip.h.

◆ SIP_PAGE2_RPID_IMMEDIATE

#define SIP_PAGE2_RPID_IMMEDIATE   (1 << 7)

Definition at line 327 of file sip.h.

◆ SIP_PAGE2_RPID_UPDATE

#define SIP_PAGE2_RPID_UPDATE   (1 << 2)

Definition at line 322 of file sip.h.

◆ SIP_PAGE2_RPORT_PRESENT

#define SIP_PAGE2_RPORT_PRESENT   (1 << 8)

Was rport received in the Via header?

Definition at line 328 of file sip.h.

◆ SIP_PAGE2_RTAUTOCLEAR

#define SIP_PAGE2_RTAUTOCLEAR   (1 << 1)

GP: Should we clean memory from peers after expiry?

Definition at line 321 of file sip.h.

◆ SIP_PAGE2_RTCACHEFRIENDS

#define SIP_PAGE2_RTCACHEFRIENDS   (1 << 0)

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

Definition at line 320 of file sip.h.

◆ SIP_PAGE2_STATECHANGEQUEUE

#define SIP_PAGE2_STATECHANGEQUEUE   (1 << 5)

D: Unsent state pending change exists

Definition at line 325 of file sip.h.

◆ SIP_PAGE2_SUBSCRIBEMWIONLY

#define SIP_PAGE2_SUBSCRIBEMWIONLY   (1 << 15)

GP: Only issue MWI notification if subscribed to

Definition at line 340 of file sip.h.

◆ SIP_PAGE2_SYMMETRICRTP

#define SIP_PAGE2_SYMMETRICRTP   (1 << 4)

GDP: Whether symmetric RTP is enabled or not

Definition at line 324 of file sip.h.

◆ SIP_PAGE2_T38SUPPORT

#define SIP_PAGE2_T38SUPPORT   (3 << 17)

GDP: T.38 Fax Support

Definition at line 343 of file sip.h.

◆ SIP_PAGE2_T38SUPPORT_UDPTL

#define SIP_PAGE2_T38SUPPORT_UDPTL   (1 << 17)

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

Definition at line 344 of file sip.h.

◆ SIP_PAGE2_T38SUPPORT_UDPTL_FEC

#define SIP_PAGE2_T38SUPPORT_UDPTL_FEC   (2 << 17)

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

Definition at line 345 of file sip.h.

◆ SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY

#define SIP_PAGE2_T38SUPPORT_UDPTL_REDUNDANCY   (3 << 17)

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

Definition at line 346 of file sip.h.

◆ SIP_PAGE2_TEXTSUPPORT

#define SIP_PAGE2_TEXTSUPPORT   (1 << 11)

GDP: Global text enable

Definition at line 331 of file sip.h.

◆ 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 367 of file sip.h.

◆ 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 368 of file sip.h.

◆ 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 369 of file sip.h.

◆ 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 370 of file sip.h.

◆ 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 362 of file sip.h.

◆ SIP_PAGE2_USE_SRTP

#define SIP_PAGE2_USE_SRTP   (1 << 29)

DP: Whether we should offer (only) SRTP

Definition at line 365 of file sip.h.

◆ SIP_PAGE2_VIDEOSUPPORT

#define SIP_PAGE2_VIDEOSUPPORT   (1 << 10)

DP: Video supported if offered?

Definition at line 330 of file sip.h.

◆ 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 363 of file sip.h.

◆ 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 385 of file sip.h.

◆ 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 389 of file sip.h.

◆ 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_USE_AVPF
Definition: sip.h:386
#define SIP_PAGE3_IGNORE_PREFCAPS
Definition: sip.h:388
#define SIP_PAGE3_RTCP_MUX
Definition: sip.h:391
#define SIP_PAGE3_ICE_SUPPORT
Definition: sip.h:387
#define SIP_PAGE3_SRTP_TAG_32
Definition: sip.h:382
#define SIP_PAGE3_NAT_AUTO_COMEDIA
Definition: sip.h:384
#define SIP_PAGE3_SNOM_AOC
Definition: sip.h:381
#define SIP_PAGE3_FORCE_AVP
Definition: sip.h:390
#define SIP_PAGE3_NAT_AUTO_RPORT
Definition: sip.h:383

Definition at line 393 of file sip.h.

◆ SIP_PAGE3_FORCE_AVP

#define SIP_PAGE3_FORCE_AVP   (1 << 9)

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

Definition at line 390 of file sip.h.

◆ SIP_PAGE3_ICE_SUPPORT

#define SIP_PAGE3_ICE_SUPPORT   (1 << 6)

DGP: Enable ICE support

Definition at line 387 of file sip.h.

◆ SIP_PAGE3_IGNORE_PREFCAPS

#define SIP_PAGE3_IGNORE_PREFCAPS   (1 << 7)

DP: Ignore prefcaps when setting up an outgoing call leg

Definition at line 388 of file sip.h.

◆ 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 384 of file sip.h.

◆ SIP_PAGE3_NAT_AUTO_RPORT

#define SIP_PAGE3_NAT_AUTO_RPORT   (1 << 2)

DGP: Set SIP_NAT_FORCE_RPORT when NAT is detected

Definition at line 383 of file sip.h.

◆ SIP_PAGE3_RTCP_MUX

#define SIP_PAGE3_RTCP_MUX   (1 << 10)

DGP: Attempt to negotiate RFC 5761 RTCP multiplexing

Definition at line 391 of file sip.h.

◆ SIP_PAGE3_SNOM_AOC

#define SIP_PAGE3_SNOM_AOC   (1 << 0)

DPG: Allow snom aoc messages

Definition at line 381 of file sip.h.

◆ 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 382 of file sip.h.

◆ SIP_PAGE3_USE_AVPF

#define SIP_PAGE3_USE_AVPF   (1 << 5)

DGP: Support a minimal AVPF-compatible profile

Definition at line 386 of file sip.h.

◆ SIP_PENDINGBYE

#define SIP_PENDINGBYE   (1 << 5)

D: Need to send bye after we ack?

Definition at line 257 of file sip.h.

◆ SIP_PROG_INBAND

#define SIP_PROG_INBAND   (3 << 25)

DP: three settings, uses two bits

Definition at line 295 of file sip.h.

◆ SIP_PROG_INBAND_NEVER

#define SIP_PROG_INBAND_NEVER   (1 << 25)

Definition at line 297 of file sip.h.

◆ SIP_PROG_INBAND_NO

#define SIP_PROG_INBAND_NO   (0 << 25)

Definition at line 296 of file sip.h.

◆ SIP_PROG_INBAND_YES

#define SIP_PROG_INBAND_YES   (2 << 25)

Definition at line 298 of file sip.h.

◆ SIP_PROGRESS_SENT

#define SIP_PROGRESS_SENT   (1 << 3)

D: Have sent 183 message progress

Definition at line 255 of file sip.h.

◆ SIP_PROMISCREDIR

#define SIP_PROMISCREDIR   (1 << 11)

DP: Promiscuous redirection

Definition at line 264 of file sip.h.

◆ sip_ref_peer

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

Definition at line 1893 of file sip.h.

◆ SIP_REINVITE

#define SIP_REINVITE   (7 << 20)

DP: four settings, uses three bits

Definition at line 282 of file sip.h.

◆ SIP_REINVITE_NONE

#define SIP_REINVITE_NONE   (0 << 20)

DP: no reinvite allowed

Definition at line 283 of file sip.h.

◆ SIP_REINVITE_UPDATE

#define SIP_REINVITE_UPDATE   (4 << 20)

DP: use UPDATE (RFC3311) when reinviting this peer

Definition at line 286 of file sip.h.

◆ 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 254 of file sip.h.

◆ SIP_SENDRPID

#define SIP_SENDRPID   (3 << 29)

DP: Remote Party-ID Support

Definition at line 301 of file sip.h.

◆ SIP_SENDRPID_NO

#define SIP_SENDRPID_NO   (0 << 29)

Definition at line 302 of file sip.h.

◆ SIP_SENDRPID_PAI

#define SIP_SENDRPID_PAI   (1 << 29)

Use "P-Asserted-Identity" for rpid

Definition at line 303 of file sip.h.

◆ SIP_SENDRPID_RPID

#define SIP_SENDRPID_RPID   (2 << 29)

Use "Remote-Party-ID" for rpid

Definition at line 304 of file sip.h.

◆ 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 99 of file sip.h.

◆ SIP_TRUSTRPID

#define SIP_TRUSTRPID   (1 << 12)

DP: Trust RPID headers?

Definition at line 265 of file sip.h.

◆ sip_unref_peer

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

Definition at line 1894 of file sip.h.

◆ SIP_USECLIENTCODE

#define SIP_USECLIENTCODE   (1 << 14)

DP: Trust X-ClientCode info message

Definition at line 267 of file sip.h.

◆ SIP_USEPATH

#define SIP_USEPATH   (1 << 27)

GDP: Trust and use incoming Path headers?

Definition at line 300 of file sip.h.

◆ SIP_USEREQPHONE

#define SIP_USEREQPHONE   (1 << 13)

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

Definition at line 266 of file sip.h.

◆ SIPBUFSIZE

#define SIPBUFSIZE   512

Buffer size for many operations

Definition at line 56 of file sip.h.

◆ STANDARD_SIP_PORT

#define STANDARD_SIP_PORT   5060

Standard SIP unsecure port for UDP and TCP from RFC 3261. DO NOT CHANGE THIS.

Definition at line 169 of file sip.h.

◆ STANDARD_TLS_PORT

#define STANDARD_TLS_PORT   5061

Standard SIP TLS port from RFC 3261. DO NOT CHANGE THIS.

Definition at line 171 of file sip.h.

◆ 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 135 of file sip.h.

◆ TRUE

#define TRUE   1

Definition at line 48 of file sip.h.

◆ XMIT_ERROR

#define XMIT_ERROR   -2

Definition at line 58 of file sip.h.

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 1760 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 587 of file sip.h.

587  {
588  AUTOPEERS_DISABLED = 0, /*!< Automatic peer creation disabled */
589  AUTOPEERS_VOLATILE, /*!< Automatic peers dropped on sip reload (pre-1.8 behavior) */
590  AUTOPEERS_PERSIST /*!< Automatic peers survive sip configuration reload */
591 };
@ AUTOPEERS_DISABLED
Definition: sip.h:588
@ AUTOPEERS_VOLATILE
Definition: sip.h:589
@ AUTOPEERS_PERSIST
Definition: sip.h:590

◆ 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 594 of file sip.h.

594  {
598 };
@ CAN_CREATE_DIALOG_UNSUPPORTED_METHOD
Definition: sip.h:597
@ CAN_CREATE_DIALOG
Definition: sip.h:596
@ CAN_NOT_CREATE_DIALOG
Definition: sip.h:595

◆ 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 514 of file sip.h.

514  {
515  AUTH_DONT_KNOW = -100, /*!< no result, need to check further */
516  /* XXX maybe this is the same as AUTH_NOT_FOUND */
517  AUTH_SUCCESSFUL = 0,
519  AUTH_SECRET_FAILED = -1,
521  AUTH_NOT_FOUND = -3, /*!< returned by register_verify */
522  AUTH_UNKNOWN_DOMAIN = -5,
524  AUTH_ACL_FAILED = -7,
525  AUTH_BAD_TRANSPORT = -8,
526  AUTH_RTP_FAILED = -9,
527  AUTH_SESSION_LIMIT = -10,
528 };
@ AUTH_BAD_TRANSPORT
Definition: sip.h:525
@ AUTH_RTP_FAILED
Definition: sip.h:526
@ AUTH_NOT_FOUND
Definition: sip.h:521
@ AUTH_UNKNOWN_DOMAIN
Definition: sip.h:522
@ AUTH_USERNAME_MISMATCH
Definition: sip.h:520
@ AUTH_SECRET_FAILED
Definition: sip.h:519
@ AUTH_PEER_NOT_DYNAMIC
Definition: sip.h:523
@ AUTH_CHALLENGE_SENT
Definition: sip.h:518
@ AUTH_SESSION_LIMIT
Definition: sip.h:527
@ AUTH_SUCCESSFUL
Definition: sip.h:517
@ AUTH_DONT_KNOW
Definition: sip.h:515
@ AUTH_ACL_FAILED
Definition: sip.h:524

◆ digest_keys

Enumerator
K_RESP 
K_URI 
K_USER 
K_NONCE 
K_LAST 

Definition at line 699 of file sip.h.

699  {
700  K_RESP,
701  K_URI,
702  K_USER,
703  K_NONCE,
704  K_LAST
705 };
@ K_USER
Definition: sip.h:702
@ K_LAST
Definition: sip.h:704
@ K_URI
Definition: sip.h:701
@ K_NONCE
Definition: sip.h:703
@ K_RESP
Definition: sip.h:700

◆ 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 644 of file sip.h.

644  {
645  SIP_DOMAIN_AUTO, /*!< This domain is auto-configured */
646  SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
647 };
@ SIP_DOMAIN_CONFIG
Definition: sip.h:646
@ SIP_DOMAIN_AUTO
Definition: sip.h:645

◆ 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 429 of file sip.h.

429  {
430  INV_REQ_SUCCESS = 11, /*!< Success code */
431  INV_REQ_FAILED = 10, /*!< Failure code */
432  INV_REQ_ERROR = 9, /*!< Error code */
433 };
@ INV_REQ_SUCCESS
Definition: sip.h:430
@ INV_REQ_FAILED
Definition: sip.h:431
@ INV_REQ_ERROR
Definition: sip.h:432

◆ 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 438 of file sip.h.

438  {
439  INV_NONE = 0, /*!< No state at all, maybe not an INVITE dialog */
440  INV_CALLING = 1, /*!< Invite sent, no answer */
441  INV_PROCEEDING = 2, /*!< We got/sent 1xx message */
442  INV_EARLY_MEDIA = 3, /*!< We got 18x message with to-tag back */
443  INV_COMPLETED = 4, /*!< Got final response with error. Wait for ACK, then CONFIRMED */
444  INV_CONFIRMED = 5, /*!< Confirmed response - we've got an ack (Incoming calls only) */
445  INV_TERMINATED = 6, /*!< Transaction done - either successful (AST_STATE_UP) or failed, but done
446  The only way out of this is a BYE from one side */
447  INV_CANCELLED = 7, /*!< Transaction cancelled by client or server in non-terminated state */
448 };
@ INV_NONE
Definition: sip.h:439
@ INV_TERMINATED
Definition: sip.h:445
@ INV_CANCELLED
Definition: sip.h:447
@ INV_CONFIRMED
Definition: sip.h:444
@ INV_CALLING
Definition: sip.h:440
@ INV_COMPLETED
Definition: sip.h:443
@ INV_EARLY_MEDIA
Definition: sip.h:442
@ INV_PROCEEDING
Definition: sip.h:441

◆ 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 486 of file sip.h.

486  {
487  SDP_AUDIO, /*!< RTP/AVP Audio */
488  SDP_VIDEO, /*!< RTP/AVP Video */
489  SDP_IMAGE, /*!< Image udptl, not TCP or RTP */
490  SDP_TEXT, /*!< RTP/AVP Realtime Text */
491  SDP_UNKNOWN, /*!< Unknown media type */
492 };
@ SDP_AUDIO
Definition: sip.h:487
@ SDP_IMAGE
Definition: sip.h:489
@ SDP_VIDEO
Definition: sip.h:488
@ SDP_TEXT
Definition: sip.h:490
@ SDP_UNKNOWN
Definition: sip.h:491

◆ notifycid_setting

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

Enumerator
DISABLED 
ENABLED 
IGNORE_CONTEXT 

Definition at line 637 of file sip.h.

637  {
638  DISABLED = 0,
639  ENABLED = 1,
640  IGNORE_CONTEXT = 2,
641 };
@ DISABLED
Definition: sip.h:638
@ IGNORE_CONTEXT
Definition: sip.h:640
@ ENABLED
Definition: sip.h:639

◆ notifyringing_setting

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

Enumerator
NOTIFYRINGING_DISABLED 
NOTIFYRINGING_ENABLED 
NOTIFYRINGING_NOTINUSE 

Definition at line 630 of file sip.h.

630  {
634 };
@ NOTIFYRINGING_ENABLED
Definition: sip.h:632
@ NOTIFYRINGING_DISABLED
Definition: sip.h:631
@ NOTIFYRINGING_NOTINUSE
Definition: sip.h:633

◆ 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 462 of file sip.h.

462  {
467 };
@ PARSE_REGISTER_DENIED
Definition: sip.h:463
@ PARSE_REGISTER_QUERY
Definition: sip.h:466
@ PARSE_REGISTER_FAILED
Definition: sip.h:464
@ PARSE_REGISTER_UPDATE
Definition: sip.h:465

◆ 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 671 of file sip.h.

671  {
672  REFER_IDLE, /*!< No REFER is in progress */
673  REFER_SENT, /*!< Sent REFER to transferee */
674  REFER_RECEIVED, /*!< Received REFER from transferrer */
675  REFER_CONFIRMED, /*!< Refer confirmed with a 100 TRYING (unused) */
676  REFER_ACCEPTED, /*!< Accepted by transferee */
677  REFER_RINGING, /*!< Target Ringing */
678  REFER_200OK, /*!< Answered by transfer target */
679  REFER_FAILED, /*!< REFER declined - go on */
680  REFER_NOAUTH /*!< We had no auth for REFER */
681 };
@ REFER_CONFIRMED
Definition: sip.h:675
@ REFER_NOAUTH
Definition: sip.h:680
@ REFER_ACCEPTED
Definition: sip.h:676
@ REFER_RECEIVED
Definition: sip.h:674
@ REFER_FAILED
Definition: sip.h:679
@ REFER_RINGING
Definition: sip.h:677
@ REFER_IDLE
Definition: sip.h:672
@ REFER_200OK
Definition: sip.h:678
@ REFER_SENT
Definition: sip.h:673

◆ 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 499 of file sip.h.

499  {
500  PROXY_AUTH = 407,
501  WWW_AUTH = 401,
502 };
@ WWW_AUTH
Definition: sip.h:501
@ PROXY_AUTH
Definition: sip.h:500

◆ 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 1551 of file sip.h.

1551  {
1552  /*! Queued, i.e. unavailable */
1553  CC_QUEUED,
1554  /*! Ready, i.e. available */
1555  CC_READY,
1556 };
@ CC_READY
Definition: sip.h:1555
@ CC_QUEUED
Definition: sip.h:1553

◆ 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 1541 of file sip.h.

1541  {
1542  /*! Closed, i.e. unavailable */
1543  CC_CLOSED,
1544  /*! Open, i.e. available */
1545  CC_OPEN,
1546 };
@ CC_OPEN
Definition: sip.h:1545
@ CC_CLOSED
Definition: sip.h:1543

◆ 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 655 of file sip.h.

655  {
656  sip_debug_none = 0,
657  sip_debug_config = 1,
658  sip_debug_console = 2,
659 };
@ sip_debug_config
Definition: sip.h:657
@ sip_debug_console
Definition: sip.h:658
@ sip_debug_none
Definition: sip.h:656

◆ 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 505 of file sip.h.

505  {
511 };
@ SIP_GET_DEST_EXTEN_FOUND
Definition: sip.h:507
@ SIP_GET_DEST_REFUSED
Definition: sip.h:509
@ SIP_GET_DEST_EXTEN_MATCHMORE
Definition: sip.h:506
@ SIP_GET_DEST_EXTEN_NOT_FOUND
Definition: sip.h:508
@ SIP_GET_DEST_INVALID_URI
Definition: sip.h:510

◆ sip_mailbox_status

Enumerator
SIP_MAILBOX_STATUS_UNKNOWN 
SIP_MAILBOX_STATUS_EXISTING 
SIP_MAILBOX_STATUS_NEW 

Definition at line 1248 of file sip.h.

1248  {
1252 };
@ SIP_MAILBOX_STATUS_NEW
Definition: sip.h:1251
@ SIP_MAILBOX_STATUS_UNKNOWN
Definition: sip.h:1249
@ SIP_MAILBOX_STATUS_EXISTING
Definition: sip.h:1250

◆ sip_peer_type

Enumerator
SIP_TYPE_PEER 
SIP_TYPE_USER 

Definition at line 683 of file sip.h.

683  {
684  SIP_TYPE_PEER = (1 << 0),
685  SIP_TYPE_USER = (1 << 1),
686 };
@ SIP_TYPE_USER
Definition: sip.h:685
@ SIP_TYPE_PEER
Definition: sip.h:684

◆ 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 1561 of file sip.h.

1561  {
1562  /*!
1563  * \brief Unknown
1564  *
1565  * \details
1566  * This actually is not defined in RFC 3903. We use this as a constant
1567  * to indicate that an incoming PUBLISH does not fit into any of the
1568  * other categories and is thus invalid.
1569  */
1571  /*!
1572  * \brief Initial
1573  *
1574  * \details
1575  * The first PUBLISH sent. This will contain a non-zero Expires header
1576  * as well as a body that indicates the current state of the endpoint
1577  * that has sent the message. The initial PUBLISH is the only type
1578  * of PUBLISH to not contain a Sip-If-Match header in it.
1579  */
1581  /*!
1582  * \brief Refresh
1583  *
1584  * \details
1585  * Used to keep a published state from expiring. This will contain a
1586  * non-zero Expires header but no body since its purpose is not to
1587  * update state.
1588  */
1590  /*!
1591  * \brief Modify
1592  *
1593  * \details
1594  * Used to change state from its previous value. This will contain
1595  * a body updating the published state. May or may not contain an
1596  * Expires header.
1597  */
1599  /*!
1600  * \brief Remove
1601  *
1602  * \details
1603  * Used to remove published state from an ESC. This will contain
1604  * an Expires header set to 0 and likely no body.
1605  */
1607 };
@ SIP_PUBLISH_REMOVE
Remove.
Definition: sip.h:1606
@ SIP_PUBLISH_REFRESH
Refresh.
Definition: sip.h:1589
@ SIP_PUBLISH_UNKNOWN
Unknown.
Definition: sip.h:1570
@ SIP_PUBLISH_MODIFY
Modify.
Definition: sip.h:1598
@ SIP_PUBLISH_INITIAL
Initial.
Definition: sip.h:1580

◆ 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 417 of file sip.h.

417  {
418  AST_SUCCESS = 0, /*!< FALSE means success, funny enough */
419  AST_FAILURE = -1, /*!< Failure code */
420 };
@ AST_SUCCESS
Definition: sip.h:418
@ AST_FAILURE
Definition: sip.h:419

◆ 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 694 of file sip.h.

694  {
695  TCPTLS_ALERT_DATA, /*!< \brief There is new data to be sent out */
696  TCPTLS_ALERT_STOP, /*!< \brief A request to stop the tcp_handler thread */
697 };
@ TCPTLS_ALERT_STOP
A request to stop the tcp_handler thread.
Definition: sip.h:696
@ TCPTLS_ALERT_DATA
There is new data to be sent out.
Definition: sip.h:695

◆ 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 609 of file sip.h.

609  {
610  SIP_UNKNOWN, /*!< Unknown response */
611  SIP_RESPONSE, /*!< Not request, response to outbound request */
612  SIP_REGISTER, /*!< Registration to the mothership, tell us where you are located */
613  SIP_OPTIONS, /*!< Check capabilities of a device, used for "ping" too */
614  SIP_NOTIFY, /*!< Status update, Part of the event package standard, result of a SUBSCRIBE or a REFER */
615  SIP_INVITE, /*!< Set up a session */
616  SIP_ACK, /*!< End of a three-way handshake started with INVITE. */
617  SIP_PRACK, /*!< Reliable pre-call signalling. Not supported in Asterisk. */
618  SIP_BYE, /*!< End of a session */
619  SIP_REFER, /*!< Refer to another URI (transfer) */
620  SIP_SUBSCRIBE, /*!< Subscribe for updates (voicemail, session status, device status, presence) */
621  SIP_MESSAGE, /*!< Text messaging */
622  SIP_UPDATE, /*!< Update a dialog. We can send UPDATE; but not accept it */
623  SIP_INFO, /*!< Information updates during a session */
624  SIP_CANCEL, /*!< Cancel an INVITE */
625  SIP_PUBLISH, /*!< Not supported in Asterisk */
626  SIP_PING, /*!< Not supported at all, no standard but still implemented out there */
627 };
@ SIP_RESPONSE
Definition: sip.h:611
@ SIP_BYE
Definition: sip.h:618
@ SIP_UNKNOWN
Definition: sip.h:610
@ SIP_PRACK
Definition: sip.h:617
@ SIP_PING
Definition: sip.h:626
@ SIP_OPTIONS
Definition: sip.h:613
@ SIP_INFO
Definition: sip.h:623
@ SIP_PUBLISH
Definition: sip.h:625
@ SIP_ACK
Definition: sip.h:616
@ SIP_SUBSCRIBE
Definition: sip.h:620
@ SIP_REGISTER
Definition: sip.h:612
@ SIP_UPDATE
Definition: sip.h:622
@ SIP_INVITE
Definition: sip.h:615
@ SIP_REFER
Definition: sip.h:619
@ SIP_MESSAGE
Definition: sip.h:621
@ SIP_NOTIFY
Definition: sip.h:614
@ SIP_CANCEL
Definition: sip.h:624

◆ 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 531 of file sip.h.

531  {
532  REG_STATE_UNREGISTERED = 0, /*!< We are not registered
533  * \note Initial state. We should have a timeout scheduled for the initial
534  * (or next) registration transmission, calling sip_reregister
535  */
536 
537  REG_STATE_REGSENT, /*!< Registration request sent
538  * \note sent initial request, waiting for an ack or a timeout to
539  * retransmit the initial request.
540  */
541 
542  REG_STATE_AUTHSENT, /*!< We have tried to authenticate
543  * \note entered after transmit_register with auth info,
544  * waiting for an ack.
545  */
546 
547  REG_STATE_REGISTERED, /*!< Registered and done */
548 
549  REG_STATE_REJECTED, /*!< Registration rejected
550  * \note only used when the remote party has an expire larger than
551  * our max-expire. This is a final state from which we do not
552  * recover (not sure how correctly).
553  */
554 
555  REG_STATE_TIMEOUT, /*!< Registration about to expire, renewing registration */
556 
557  REG_STATE_NOAUTH, /*!< We have no accepted credentials
558  * \note fatal - no chance to proceed */
559 
560  REG_STATE_FAILED, /*!< Registration failed after several tries
561  * \note fatal - no chance to proceed */
562 };
@ REG_STATE_REGSENT
Definition: sip.h:537
@ REG_STATE_TIMEOUT
Definition: sip.h:555
@ REG_STATE_AUTHSENT
Definition: sip.h:542
@ REG_STATE_NOAUTH
Definition: sip.h:557
@ REG_STATE_REGISTERED
Definition: sip.h:547
@ REG_STATE_REJECTED
Definition: sip.h:549
@ REG_STATE_FAILED
Definition: sip.h:560
@ REG_STATE_UNREGISTERED
Definition: sip.h:532

◆ 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 565 of file sip.h.

565  {
566  SESSION_TIMER_MODE_INVALID = 0, /*!< Invalid value */
567  SESSION_TIMER_MODE_ACCEPT, /*!< Honor inbound Session-Timer requests */
568  SESSION_TIMER_MODE_ORIGINATE, /*!< Originate outbound and honor inbound requests */
569  SESSION_TIMER_MODE_REFUSE /*!< Ignore inbound Session-Timers requests */
570 };
@ SESSION_TIMER_MODE_INVALID
Definition: sip.h:566
@ SESSION_TIMER_MODE_ACCEPT
Definition: sip.h:567
@ SESSION_TIMER_MODE_ORIGINATE
Definition: sip.h:568
@ SESSION_TIMER_MODE_REFUSE
Definition: sip.h:569

◆ 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 573 of file sip.h.

573  {
574  SESSION_TIMER_REFRESHER_AUTO, /*!< Negotiated */
575  SESSION_TIMER_REFRESHER_US, /*!< Initially prefer session refresh by Asterisk */
576  SESSION_TIMER_REFRESHER_THEM, /*!< Initially prefer session refresh by the other side */
577 };
@ SESSION_TIMER_REFRESHER_THEM
Definition: sip.h:576
@ SESSION_TIMER_REFRESHER_US
Definition: sip.h:575
@ SESSION_TIMER_REFRESHER_AUTO
Definition: sip.h:574

◆ st_refresher_param

Enumerator
SESSION_TIMER_REFRESHER_PARAM_UNKNOWN 
SESSION_TIMER_REFRESHER_PARAM_UAC 
SESSION_TIMER_REFRESHER_PARAM_UAS 

Definition at line 579 of file sip.h.

579  {
583 };
@ SESSION_TIMER_REFRESHER_PARAM_UAS
Definition: sip.h:582
@ SESSION_TIMER_REFRESHER_PARAM_UAC
Definition: sip.h:581
@ SESSION_TIMER_REFRESHER_PARAM_UNKNOWN
Definition: sip.h:580

◆ 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 470 of file sip.h.

470  {
471  NONE = 0,
472  XPIDF_XML,
475  PIDF_XML,
478 };
@ CPIM_PIDF_XML
Definition: sip.h:474
@ PIDF_XML
Definition: sip.h:475
@ CALL_COMPLETION
Definition: sip.h:477
@ MWI_NOTIFICATION
Definition: sip.h:476
@ NONE
Definition: sip.h:471
@ XPIDF_XML
Definition: sip.h:472
@ DIALOG_INFO_XML
Definition: sip.h:473

◆ 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 688 of file sip.h.

688  {
689  SDP_T38_NONE = 0, /*!< Do not modify T38 information at all */
690  SDP_T38_INITIATE, /*!< Remote side has requested T38 with us */
691  SDP_T38_ACCEPT, /*!< Remote side accepted our T38 request */
692 };
@ SDP_T38_NONE
Definition: sip.h:689
@ SDP_T38_INITIATE
Definition: sip.h:690
@ SDP_T38_ACCEPT
Definition: sip.h:691

◆ 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 662 of file sip.h.

662  {
663  T38_DISABLED = 0, /*!< Not enabled */
664  T38_LOCAL_REINVITE, /*!< Offered from local - REINVITE */
665  T38_PEER_REINVITE, /*!< Offered from peer - REINVITE */
666  T38_ENABLED, /*!< Negotiated (enabled) */
667  T38_REJECTED /*!< Refused */
668 };
@ T38_PEER_REINVITE
Definition: sip.h:665
@ T38_LOCAL_REINVITE
Definition: sip.h:664
@ T38_ENABLED
Definition: sip.h:666
@ T38_REJECTED
Definition: sip.h:667
@ T38_DISABLED
Definition: sip.h:663

◆ 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 411 of file sip.h.

411  {
412  TRANSFER_OPENFORALL, /*!< Allow all SIP transfers */
413  TRANSFER_CLOSED, /*!< Allow no SIP transfers */
414 };
@ TRANSFER_CLOSED
Definition: sip.h:413
@ TRANSFER_OPENFORALL
Definition: sip.h:412

◆ xmittype

enum xmittype

When sending a SIP message, we can send with a few options, depending on type of SIP request. UNRELIABLE is mostly 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 454 of file sip.h.

454  {
455  XMIT_CRITICAL = 2, /*!< Transmit critical SIP message reliably, with re-transmits.
456  * If it fails, it's critical and will cause a teardown of the session */
457  XMIT_RELIABLE = 1, /*!< Transmit SIP message reliably, with re-transmits */
458  XMIT_UNRELIABLE = 0, /*!< Transmit SIP message without bothering with re-transmits */
459 };
@ XMIT_CRITICAL
Definition: sip.h:455
@ XMIT_RELIABLE
Definition: sip.h:457
@ XMIT_UNRELIABLE
Definition: sip.h:458

Function Documentation

◆ __init_check_auth_buf()

static void __init_check_auth_buf ( void  )
static

Definition at line 1882 of file sip.h.

1894 { ao2_t_cleanup(peer, tag); (NULL); })
#define ao2_t_cleanup(obj, tag)
Definition: astobj2.h:1935
#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 16561 of file chan_sip.c.

16562 {
16563  if (code == WWW_AUTH) { /* 401 */
16564  *header = "WWW-Authenticate";
16565  *respheader = "Authorization";
16566  } else if (code == PROXY_AUTH) { /* 407 */
16567  *header = "Proxy-Authenticate";
16568  *respheader = "Proxy-Authorization";
16569  } else {
16570  ast_verbose("-- wrong response code %u\n", code);
16571  *header = *respheader = "Invalid";
16572  }
16573 }
void ast_verbose(const char *fmt,...)
Definition: extconf.c:2206

References ast_verbose(), PROXY_AUTH, and WWW_AUTH.

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

◆ 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 5862 of file chan_sip.c.

5863 {
5864  return sip_find_peer_full(peer, addr, NULL, realtime, which_objects, devstate_only, transport);
5865 }
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:5800

References NULL, and sip_find_peer_full().

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

◆ 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 8613 of file chan_sip.c.

8614 {
8615  int start = 0;
8616  return __get_header(req, name, &start);
8617 }
static const char * __get_header(const struct sip_request *req, const char *name, int *start)
Definition: chan_sip.c:8575
static const char name[]
Definition: format_mp3.c:68

References __get_header(), and name.

Referenced by __find_call(), __sip_alloc(), __transmit_response(), build_route(), cc_handle_publish_error(), change_redirecting_information(), check_peer_ok(), copy_header(), extract_uri(), find_sdp(), get_also_info(), get_destination(), get_pai(), 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(), match_req_to_dialog(), parse_allowed_methods(), parse_moved_contact(), parse_ok_contact(), parse_oli(), proc_422_rsp(), receive_message(), 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().

◆ sip_get_transport()

const char* sip_get_transport ( enum ast_transport  t)

Return transport as string.

Definition at line 3735 of file chan_sip.c.

3736 {
3737  switch (t) {
3738  case AST_TRANSPORT_UDP:
3739  return "UDP";
3740  case AST_TRANSPORT_TCP:
3741  return "TCP";
3742  case AST_TRANSPORT_TLS:
3743  return "TLS";
3744  case AST_TRANSPORT_WS:
3745  case AST_TRANSPORT_WSS:
3746  return "WS";
3747  }
3748 
3749  return "UNKNOWN";
3750 }
@ AST_TRANSPORT_WSS
Definition: netsock2.h:64
@ AST_TRANSPORT_WS
Definition: netsock2.h:63
@ AST_TRANSPORT_UDP
Definition: netsock2.h:60
@ AST_TRANSPORT_TLS
Definition: netsock2.h:62
@ AST_TRANSPORT_TCP
Definition: netsock2.h:61

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().

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 1882 of file sip.h.

Referenced by sip_report_security_event(), and transmit_fake_auth_response().

◆ sip_options

const struct cfsip_options sip_options[]
static