[asterisk-commits] mmichelson: branch group/CCSS r236017 - /team/group/CCSS/channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 21 14:35:22 CST 2009
Author: mmichelson
Date: Mon Dec 21 14:35:20 2009
New Revision: 236017
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=236017
Log:
Make sure we only send a single CC frame when we're
in the "needringing" state.
Modified:
team/group/CCSS/channels/chan_dahdi.c
Modified: team/group/CCSS/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_dahdi.c?view=diff&rev=236017&r1=236016&r2=236017
==============================================================================
--- team/group/CCSS/channels/chan_dahdi.c (original)
+++ team/group/CCSS/channels/chan_dahdi.c Mon Dec 21 14:35:20 2009
@@ -655,6 +655,7 @@
unsigned int needunhold:1;
unsigned int linear:1;
unsigned int inthreeway:1;
+ unsigned int ccframesent:1;
struct dahdi_confinfo curconf;
};
@@ -8048,23 +8049,27 @@
#endif
if (p->subs[idx].needringing) {
- /* XXX Note to Mark. Re-examine when you get back to the
- * office
- */
- char device_name[256];
- ast_channel_get_device_name(p->owner, device_name, sizeof(device_name));
- if (dahdi_cc_is_possible(p->owner, device_name)) {
- /* XXX I'm going to need an indication that I've sent a CC frame so I don't
- * just keep sending them forever
+ if (!p->subs[idx].ccframesent) {
+ char device_name[256];
+ ast_channel_get_device_name(p->owner, device_name, sizeof(device_name));
+ if (dahdi_cc_is_possible(p->owner, device_name)) {
+ /* XXX I'm going to need an indication that I've sent a CC frame so I don't
+ * just keep sending them forever
+ */
+ if (!ast_cc_build_frame(p->owner, p->cc_params, device_name, p->dialstring, AST_CC_CCNR, &p->subs[idx].f)) {
+ p->subs[idx].needringing = 0;
+ return &p->subs[idx].f;
+ }
+ }
+ /* Even if we didn't really send a CC frame, we need to set this
+ * true so that we don't repeatedly attempt to send them and never
+ * send a ringing frame.
*/
- if (!ast_cc_build_frame(p->owner, p->cc_params, device_name, p->dialstring, AST_CC_CCNR, &p->subs[idx].f)) {
- p->subs[idx].needringing = 0;
- return &p->subs[idx].f;
- }
- }
- /* If CC isn't possible or if we can't build the CC frame properly,
- * then we drop into the typical behavior instead
- */
+ p->subs[idx].ccframesent = 1;
+ /* If CC isn't possible or if we can't build the CC frame properly,
+ * then we drop into the typical behavior instead
+ */
+ }
/* Send ringing frame if requested */
p->subs[idx].needringing = 0;
p->subs[idx].f.frametype = AST_FRAME_CONTROL;
More information about the asterisk-commits
mailing list