Summary:ASTERISK-22135: res_sip: Restructure ast_sip_endpoint to have better structure
Reporter:Matt Jordan (mjordan)Labels:Asterisk12
Date Opened:2013-07-20 16:42:27Date Closed:2013-07-30 10:26:01
Versions:12 Frequency of
Description:It has gotten quite large:

* \brief An entity with which Asterisk communicates
struct ast_sip_endpoint {
/*! Context to send incoming calls to */
/*! Name of an explicit transport to use */
/*! Outbound proxy to use */
/*! Explicit AORs to dial if none are specified */
               /*! Musiconhold class to suggest that the other side use when placing on hold */
/*! Optional external media address to use in SDP */
/*! Configured voicemail boxes for this endpoint. Used for MWI */
/*! Configured RTP engine for this endpoint. */
/*! Configured tone zone for this endpoint. */
/*! Configured language for this endpoint. */
/*! Feature to enact when one-touch recording INFO with Record: On is received */
/*! Feature to enact when one-touch recording INFO with Record: Off is received */
/*! SDP origin username */
/*! SDP session name */
/*! Default username to place in From header */
/*! Domain to place in From header */
/*! Username to use when sending MWI NOTIFYs to this endpoint */
/*! Identification information for this endpoint */
struct ast_party_id id;
/*! Domain to which this endpoint belongs */
struct ast_sip_domain *domain;
/*! Address of record for incoming registrations */
struct ast_sip_aor *aor;
/*! Codec preferences */
struct ast_codec_pref prefs;
/*! Configured codecs */
struct ast_format_cap *codecs;
/*! Names of inbound authentication credentials */
const char **sip_inbound_auths;
/*! Number of configured auths */
size_t num_inbound_auths;
/*! Names of outbound authentication credentials */
const char **sip_outbound_auths;
/*! Number of configured outbound auths */
size_t num_outbound_auths;
/*! DTMF mode to use with this endpoint */
enum ast_sip_dtmf_mode dtmf;
/*! Whether IPv6 RTP is enabled or not */
unsigned int rtp_ipv6;
/*! Whether symmetric RTP is enabled or not */
unsigned int rtp_symmetric;
/*! Whether ICE support is enabled or not */
unsigned int ice_support;
/*! Whether to use the "ptime" attribute received from the endpoint or not */
unsigned int use_ptime;
/*! Whether to force using the source IP address/port for sending responses */
unsigned int force_rport;
/*! Whether to rewrite the Contact header with the source IP address/port or not */
unsigned int rewrite_contact;
/*! Enabled SIP extensions */
unsigned int extensions;
/*! Minimum session expiration period, in seconds */
unsigned int min_se;
/*! Session expiration period, in seconds */
unsigned int sess_expires;
/*! List of outbound registrations */
AST_LIST_HEAD_NOLOCK(, ast_sip_registration) registrations;
/*! Method(s) by which the endpoint should be identified. */
enum ast_sip_endpoint_identifier_type ident_method;
/*! Boolean indicating if direct_media is permissible */
unsigned int direct_media;
/*! When using direct media, which method should be used */
enum ast_sip_session_refresh_method direct_media_method;
/*! When performing connected line update, which method should be used */
enum ast_sip_session_refresh_method connected_line_method;
/*! Take steps to mitigate glare for direct media */
enum ast_sip_direct_media_glare_mitigation direct_media_glare_mitigation;
/*! Do not attempt direct media session refreshes if a media NAT is detected */
unsigned int disable_direct_media_on_nat;
/*! Do we trust the endpoint with our outbound identity? */
unsigned int trust_id_outbound;
/*! Do we trust identity information that originates externally (e.g. P-Asserted-Identity header)? */
unsigned int trust_id_inbound;
/*! Do we send P-Asserted-Identity headers to this endpoint? */
unsigned int send_pai;
/*! Do we send Remote-Party-ID headers to this endpoint? */
unsigned int send_rpid;
/*! Do we add Diversion headers to applicable outgoing requests/responses? */
unsigned int send_diversion;
/*! Should unsolicited MWI be aggregated into a single NOTIFY? */
unsigned int aggregate_mwi;
/*! Do we use media encryption? what type? */
enum ast_sip_session_media_encryption media_encryption;
/*! Do we use AVPF exclusively for this endpoint? */
unsigned int use_avpf;
/*! Is one-touch recording permitted? */
unsigned int one_touch_recording;
/*! Boolean indicating if ringing should be sent as inband progress */
unsigned int inband_progress;
/*! Call group */
ast_group_t callgroup;
/*! Pickup group */
ast_group_t pickupgroup;
/*! Named call group */
struct ast_namedgroups *named_callgroups;
/*! Named pickup group */
struct ast_namedgroups *named_pickupgroups;
/*! Pointer to the persistent Asterisk endpoint */
struct ast_endpoint *persistent;
/*! The number of channels at which busy device state is returned */
unsigned int devicestate_busy_at;
/*! Determines if transfers (using REFER) are allowed by this endpoint */
unsigned int allowtransfer;
/*! DSCP TOS bits for audio streams */
unsigned int tos_audio;
/*! Priority for audio streams */
unsigned int cos_audio;
/*! DSCP TOS bits for video streams */
unsigned int tos_video;
/*! Priority for video streams */
unsigned int cos_video;
/*! Indicates if endpoint is allowed to initiate subscriptions */
unsigned int allowsubscribe;
/*! The minimum allowed expiration for subscriptions from endpoint */
unsigned int subminexpiry;

Things that could be grouped together:

* Media settings
** With possible media subtypes. This will also eliminate a lot of {{thing_type}} as a convention.
* Authentication/Trust (maybe)
* Transport/NAT settings
* Party Identification