[svn-commits] dvossel: branch group/aoc r251935 - in /team/group/aoc: channels/ channels/si...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 11 17:26:02 CST 2010


Author: dvossel
Date: Thu Mar 11 17:25:58 2010
New Revision: 251935

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251935
Log:
addition snom_aoc_enabled sip config option

Modified:
    team/group/aoc/channels/chan_sip.c
    team/group/aoc/channels/sip/include/sip.h
    team/group/aoc/configs/sip.conf.sample

Modified: team/group/aoc/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/aoc/channels/chan_sip.c?view=diff&rev=251935&r1=251934&r2=251935
==============================================================================
--- team/group/aoc/channels/chan_sip.c (original)
+++ team/group/aoc/channels/chan_sip.c Thu Mar 11 17:25:58 2010
@@ -794,7 +794,7 @@
 static int regobjs = 0;       /*!< Registry objects */
 /* }@ */
 
-static struct ast_flags global_flags[2] = {{0}};  /*!< global SIP_ flags */
+static struct ast_flags global_flags[3] = {{0}};  /*!< global SIP_ flags */
 static int global_t38_maxdatagram;                /*!< global T.38 FaxMaxDatagram override */
 
 static char used_context[AST_MAX_CONTEXT];        /*!< name of automatically created context for unloading */
@@ -3882,6 +3882,7 @@
 
 	ast_copy_flags(&dialog->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&dialog->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+	ast_copy_flags(&dialog->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 	dialog->capability = peer->capability;
 	dialog->prefs = peer->prefs;
 	if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
@@ -5367,7 +5368,7 @@
 		update_redirecting(p, data, datalen);
 		break;
 	case AST_CONTROL_AOC:
-		{
+		if (ast_test_flag(&p->flags[2], SIP_PAGE3_SNOM_AOC)) {
 			struct ast_aoc_decoded *decoded = ast_aoc_decode((struct ast_aoc_encoded *) data, datalen);
 			if (decoded) {
 				transmit_info_with_aoc(p, decoded);
@@ -5990,6 +5991,7 @@
 	/* Copy global flags to this PVT at setup. */
 	ast_copy_flags(&p->flags[0], &global_flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&p->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+	ast_copy_flags(&p->flags[2], &global_flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 
 	p->do_history = recordhistory;
 
@@ -12998,6 +13000,7 @@
 	/* Take the peer */
 	ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&p->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+	ast_copy_flags(&p->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 
 	if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && p->udptl) {
 		p->t38_maxdatagram = peer->t38_maxdatagram;
@@ -13041,6 +13044,7 @@
 	if (!(res = check_auth(p, req, peer->name, p->peersecret, p->peermd5secret, sipmethod, uri2, reliable, req->ignore))) {
 		ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
 		ast_copy_flags(&p->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+		ast_copy_flags(&p->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 		/* If we have a call limit, set flag */
 		if (peer->call_limit)
 			ast_set_flag(&p->flags[0], SIP_CALL_LIMIT);
@@ -22142,6 +22146,7 @@
 	copy_socket_data(&p->socket, &peer->socket);
 	ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&p->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+	ast_copy_flags(&p->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 
 	/* Send OPTIONs to peer's fullcontact */
 	if (!ast_strlen_zero(peer->fullcontact))
@@ -22845,6 +22850,7 @@
 	peer->type = SIP_TYPE_PEER;
 	ast_copy_flags(&peer->flags[0], &global_flags[0], SIP_FLAGS_TO_COPY);
 	ast_copy_flags(&peer->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+	ast_copy_flags(&peer->flags[2], &global_flags[2], SIP_PAGE3_FLAGS_TO_COPY);
 	ast_string_field_set(peer, context, sip_cfg.default_context);
 	ast_string_field_set(peer, subscribecontext, sip_cfg.default_subscribecontext);
 	ast_string_field_set(peer, language, default_language);
@@ -22949,8 +22955,8 @@
 	int format = 0;		/* Ama flags */
 	int timerb_set = 0, timert1_set = 0;
 	time_t regseconds = 0;
-	struct ast_flags peerflags[2] = {{(0)}};
-	struct ast_flags mask[2] = {{(0)}};
+	struct ast_flags peerflags[3] = {{(0)}};
+	struct ast_flags mask[3] = {{(0)}};
 	char callback[256] = "";
 	struct sip_peer tmp_peer;
 	const char *srvlookup = NULL;
@@ -23312,6 +23318,8 @@
 				ast_string_field_set(peer, unsolicited_mailbox, v->value);
 			} else if (!strcasecmp(v->name, "use_q850_reason")) {
 				ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
+			} else if (!strcasecmp(v->name, "snom_aoc_enabled")) {
+				ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_SNOM_AOC);
 			}
 		}
 
@@ -23474,6 +23482,7 @@
 
 	ast_copy_flags(&peer->flags[0], &peerflags[0], mask[0].flags);
 	ast_copy_flags(&peer->flags[1], &peerflags[1], mask[1].flags);
+	ast_copy_flags(&peer->flags[2], &peerflags[2], mask[2].flags);
 	if (ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOWSUBSCRIBE)) {
 		sip_cfg.allowsubscribe = TRUE;	/* No global ban any more */
 	}
@@ -24202,6 +24211,8 @@
 			}
 		} else if (!strcasecmp(v->name, "use_q850_reason")) {
 			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
+		} else if (!strcasecmp(v->name, "snom_aoc_enabled")) {
+				ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_SNOM_AOC);
 		}
 	}
 

Modified: team/group/aoc/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/group/aoc/channels/sip/include/sip.h?view=diff&rev=251935&r1=251934&r2=251935
==============================================================================
--- team/group/aoc/channels/sip/include/sip.h (original)
+++ team/group/aoc/channels/sip/include/sip.h Thu Mar 11 17:25:58 2010
@@ -348,6 +348,12 @@
 	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
 	SIP_PAGE2_RPID_IMMEDIATE | SIP_PAGE2_RPID_UPDATE | SIP_PAGE2_SYMMETRICRTP | SIP_PAGE2_CONSTANT_SSRC |\
 	SIP_PAGE2_Q850_REASON)
+
+
+#define SIP_PAGE3_SNOM_AOC               (1 << 0)  /*!< DPG: Allow snom aoc messages */
+
+#define SIP_PAGE3_FLAGS_TO_COPY \
+	(SIP_PAGE3_SNOM_AOC)
 
 /*@}*/
 
@@ -935,7 +941,7 @@
 	ast_group_t callgroup;                  /*!< Call group */
 	ast_group_t pickupgroup;                /*!< Pickup group */
 	int lastinvite;                         /*!< Last Cseq of invite */
-	struct ast_flags flags[2];              /*!< SIP_ flags */
+	struct ast_flags flags[3];              /*!< SIP_ flags */
 
 	/* boolean flags that don't belong in flags */
 	unsigned short do_history:1;          /*!< Set if we want to record history */
@@ -1159,7 +1165,7 @@
 	struct ast_codec_pref prefs;    /*!<  codec prefs */
 	int lastmsgssent;
 	unsigned int sipoptions;        /*!<  Supported SIP options */
-	struct ast_flags flags[2];      /*!<  SIP_ flags */
+	struct ast_flags flags[3];      /*!<  SIP_ flags */
 
 	/*! Mailboxes that this peer cares about */
 	AST_LIST_HEAD_NOLOCK(, sip_mailbox) mailboxes;

Modified: team/group/aoc/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/group/aoc/configs/sip.conf.sample?view=diff&rev=251935&r1=251934&r2=251935
==============================================================================
--- team/group/aoc/configs/sip.conf.sample (original)
+++ team/group/aoc/configs/sip.conf.sample Thu Mar 11 17:25:58 2010
@@ -868,6 +868,12 @@
                                 ; it may be a mandatory requirement for some
                                 ; destinations which do not have a prior
                                 ; account relationship with your server.
+
+;------------------------------ Advice of Charge CONFIGURATION --------------------------
+; snom_aoc_enabled = yes;     ; This options turns on and off support for sending AOC-D and
+                              ; AOC-E to snom endpoints.  This option can be used both in the
+							  ; peer and global scope.  The default for this option is off.
+
 
 ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
 ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a




More information about the svn-commits mailing list