[asterisk-commits] mmichelson: branch group/CCSS r229722 - /team/group/CCSS/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Nov 12 11:26:32 CST 2009
Author: mmichelson
Date: Thu Nov 12 11:26:27 2009
New Revision: 229722
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=229722
Log:
Provide an example of publish callback use and such.
Modified:
team/group/CCSS/channels/chan_sip.c
Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=229722&r1=229721&r2=229722
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Thu Nov 12 11:26:27 2009
@@ -1736,13 +1736,23 @@
struct event_state_compositor;
-typedef int (*publish_callback)(struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *);
+typedef int (* const publish_callback)(struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *);
struct sip_publish_callbacks {
- publish_callback initial_handler;
- publish_callback refresh_handler;
- publish_callback modify_handler;
- publish_callback remove_handler;
+ const publish_callback initial_handler;
+ const publish_callback refresh_handler;
+ const publish_callback modify_handler;
+ const publish_callback remove_handler;
+};
+
+static int cc_publish_initial_handler(struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *);
+static int cc_publish_modify_handler(struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *);
+static int cc_publish_remove_handler(struct sip_pvt *, struct sip_request *, struct event_state_compositor *, struct sip_esc_entry *);
+
+static const struct sip_publish_callbacks cc_publish_callbacks = {
+ .initial_handler = cc_publish_initial_handler,
+ .modify_handler = cc_publish_modify_handler,
+ .remove_handler = cc_publish_remove_handler,
};
/*!
@@ -1760,10 +1770,10 @@
static struct event_state_compositor {
enum subscriptiontype event;
const char * name;
+ const struct sip_publish_callbacks *callbacks;
struct ao2_container *compositor;
- struct sip_publish_callbacks *callbacks;
} event_state_compositors [] = {
- {CALL_COMPLETION, "call-completion", },
+ {CALL_COMPLETION, "call-completion", &cc_publish_callbacks},
};
static const int ESC_MAX_BUCKETS = 37;
More information about the asterisk-commits
mailing list