[asterisk-commits] mmichelson: branch group/pimp_my_sip r379266 - /team/group/pimp_my_sip/includ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 16 12:45:08 CST 2013


Author: mmichelson
Date: Wed Jan 16 12:45:05 2013
New Revision: 379266

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=379266
Log:
Add some necessary structures for actually doing anything.

These items will get linked into sorcery later.


Modified:
    team/group/pimp_my_sip/include/asterisk/res_sip.h

Modified: team/group/pimp_my_sip/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/include/asterisk/res_sip.h?view=diff&rev=379266&r1=379265&r2=379266
==============================================================================
--- team/group/pimp_my_sip/include/asterisk/res_sip.h (original)
+++ team/group/pimp_my_sip/include/asterisk/res_sip.h Wed Jan 16 12:45:05 2013
@@ -19,6 +19,13 @@
 #ifndef _RES_SIP_H
 #define _RES_SIP_H
 
+#include "asterisk/stringfields.h"
+/* Needed for struct ast_sockaddr */
+#include "asterisk/netsock2.h"
+/* Needed for linked list macros */
+#include "asterisk/linkedlists.h"
+/* Needed for ast_party_id */
+#include "asterisk/channel.h"
 
 /* Forward declarations of PJSIP stuff */
 struct pjsip_rx_data;
@@ -30,7 +37,130 @@
  * \brief Opaque structure representing related SIP tasks
  */
 struct ast_sip_work;
-struct ast_sip_endpoint;
+
+/*!
+ * Details about a SIP domain
+ */
+struct ast_sip_domain {
+	AST_DECLARE_STRING_FIELDS(
+		/*! The name of the domain */
+		AST_STRING_FIELD(name);
+		/*! Incoming context for authenticated calls from the domain */
+		AST_STRING_FIELD(context);
+	);
+};
+
+/*!
+ * \brief Types of supported transports
+ */
+enum ast_sip_transport_type {
+	AST_SIP_TRANSPORT_UDP,
+	AST_SIP_TRANSPORT_TCP,
+	AST_SIP_TRANSPORT_TLS,
+	/* XXX Websocket ? */
+};
+
+/*!
+ * \brief Transport to bind to
+ */
+struct ast_sip_transport {
+	AST_DECLARE_STRING_FIELDS(
+		/*! Name for identifying the transport */
+		AST_STRING_FIELD(name);
+	);
+	/*! Type of transport */
+	enum ast_sip_transport_type type;
+	/*! Address and port to bind to */
+	struct ast_sockaddr host;
+};
+
+/*!
+ * \brief Contact associated with an address of record
+ */
+struct ast_sip_contact {
+	AST_DECLARE_STRING_FIELDS(
+		/* XXX This may work better as an object instead of a string */
+		/*! Full URI of the contact */
+		AST_STRING_FIELD(uri);
+	);
+	/*! Absolute time that this contact expires */
+	time_t expiration_time;
+	/*! Next list item */
+	AST_LIST_ENTRY(ast_sip_contact) next;
+};
+
+/*!
+ * \brief A SIP address of record
+ */
+struct ast_sip_aor {
+	AST_DECLARE_STRING_FIELDS(
+		/*! Name of the address of record */
+		AST_STRING_FIELD(name);
+	);
+	/*! Default contact expiration if one is not provided in the contact */
+	int expiration;
+	/*! Domain for the AOR */
+	struct ast_sip_domain *domain;
+	/*! Contacts bound to this AOR */
+	AST_LIST_HEAD_NOLOCK(, ast_sip_contact) contacts;
+};
+
+/*!
+ * \brief Outbound registration
+ */
+struct ast_sip_registration {
+	AST_DECLARE_STRING_FIELDS(
+		/*! Username for the registration */
+		AST_STRING_FIELD(username);
+		/*! Password for the registration */
+		AST_STRING_FIELD(password);
+	);
+	/*! Host to send registration to. Address and port */
+	struct ast_sockaddr host;
+	/*! Next registration in the list */
+	AST_LIST_ENTRY(ast_sip_registration) next;
+};
+
+/*!
+ * \brief DTMF modes for SIP endpoints
+ */
+enum ast_sip_dtmf_mode {
+	/*! No DTMF to be used */
+	AST_SIP_DTMF_NONE,
+	/* XXX Should this be 2833 instead? */
+	/*! Use RFC 4733 events for DTMF */
+	AST_SIP_DTMF_RFC_4733,
+	/*! Use DTMF in the audio stream */
+	AST_SIP_DTMF_INBAND,
+	/*! Use SIP INFO DTMF (blech) */
+	AST_SIP_DTMF_INFO,
+};
+
+/*!
+ * \brief An entity with which Asterisk communicates
+ */
+struct ast_sip_endpoint {
+	AST_DECLARE_STRING_FIELDS(
+		/*! Name of the endpoint */
+		AST_STRING_FIELD(name);
+		/*! Context to send incoming calls to */
+		AST_STRING_FIELD(context);
+	);
+	/*! Identification information for this endpoint */
+	struct ast_party_id id;
+	/*! Domain to which this endpoint belongs */
+	struct ast_sip_domain *domain;
+	/*! Transport used to send messages to the endpoint */
+	struct ast_sip_transport *transport;
+	/*! Address of record for incoming registrations */
+	struct ast_sip_aor *aor;
+	/*! Configured codecs */
+	struct ast_format_cap *codecs;
+	/*! DTMF mode to use with this endpoint */
+	enum ast_sip_dtmf_mode dtmf;
+	/*! List of outbound registrations */
+	AST_LIST_HEAD_NOLOCK(, ast_sip_registration) registrations;
+};
  
 /*!
  * \brief Data used for creating authentication challenges.




More information about the asterisk-commits mailing list