[asterisk-commits] mmichelson: branch group/CCSS r214063 - /team/group/CCSS/main/ccss.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 25 13:42:30 CDT 2009
Author: mmichelson
Date: Tue Aug 25 13:42:26 2009
New Revision: 214063
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=214063
Log:
Create struct for holding pending CC offers.
Modified:
team/group/CCSS/main/ccss.c
Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=214063&r1=214062&r2=214063
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Tue Aug 25 13:42:26 2009
@@ -363,9 +363,64 @@
}
}
+/*!
+ * \brief Struct for CC offers, before a monitor is created
+ *
+ * When we are going to offer CC to a caller, a lightweight
+ * container of structures is used. Once the caller requests
+ * CC, and the core creates the appropriate monitor structures,
+ * then the core_pending_cc_offer can be destroyed.
+ *
+ * These structs are stored in an ao2_container which is hashed
+ * based on the core_id of each element for easy lookup.
+ */
+struct core_pending_cc_offer {
+ /*!
+ * A unique identifier for this CC offer. Essentially, this
+ * is an identifier for the instance of the core for which
+ * this offer belongs. So even after the offer matures into
+ * an official request for CC, the same core_id will be used
+ * when making state machine transactions and the like.
+ */
+ unsigned int core_id;
+ /*!
+ * Text identifying the caller. Tentatively, this is just the
+ * device name of the calling channel. However, this may need
+ * to be modified to include CID information or something to
+ * more uniquely identify the caller. For instance, if an
+ * inbound call over a trunk may be from one of several users,
+ * so using just the device name as an identifier is not good
+ * enough.
+ */
+ const char *caller;
+ /*!
+ * The reference-counted "tree" of interfaces dialed by the
+ * caller. In reality this is a linked list which has fields
+ * which help to "point" to where a node's parent is in the
+ * list.
+ */
+ struct ast_cc_interface_tree *called_tree;
+ /*!
+ * A handle to the agent for this particular CC offer.
+ */
+ struct ast_cc_agent *agent;
+};
+
int ast_cc_core_init_instance(struct ast_channel *caller, struct ast_cc_interface_tree *called_tree)
{
- ao2_ref(called_tree, +1);
- /* ADD REST OF LOGIC LATER */
+
+ /* First, we need to kill off other pending CC offers to caller. If the caller is going
+ * to request a CC service, it may only be for the latest call he made.
+ */
+
+ /* Next, we need to allocate the structure we will use to store the tree. */
+
+ /* Next, we need to store this new tree in a container */
+
+ /* Next, we need to create the agent for this caller */
+
+ /* Finally, start the state machine! */
+
+ /*ao2_ref(called_tree, +1);*/
return 0;
}
More information about the asterisk-commits
mailing list