[asterisk-commits] russell: branch russell/aoc r198865 - in /team/russell/aoc: channels/ include...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 2 17:17:50 CDT 2009
Author: russell
Date: Tue Jun 2 17:17:43 2009
New Revision: 198865
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=198865
Log:
Add AOC control frame type and start adding definitions related to encoding.
Added:
team/russell/aoc/include/asterisk/aoc.h (with props)
Modified:
team/russell/aoc/channels/chan_alsa.c
team/russell/aoc/channels/chan_console.c
team/russell/aoc/channels/chan_dahdi.c
team/russell/aoc/channels/chan_h323.c
team/russell/aoc/channels/chan_mgcp.c
team/russell/aoc/channels/chan_misdn.c
team/russell/aoc/channels/chan_oss.c
team/russell/aoc/channels/chan_sip.c
team/russell/aoc/channels/chan_skinny.c
team/russell/aoc/channels/chan_unistim.c
team/russell/aoc/channels/iax2-parser.c
team/russell/aoc/include/asterisk/frame.h
team/russell/aoc/main/channel.c
Modified: team/russell/aoc/channels/chan_alsa.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_alsa.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_alsa.c (original)
+++ team/russell/aoc/channels/chan_alsa.c Tue Jun 2 17:17:43 2009
@@ -521,6 +521,9 @@
case AST_CONTROL_UNHOLD:
ast_verbose(" << Console Has Been Retrieved from Hold >> \n");
ast_moh_stop(chan);
+ break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
break;
default:
ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, chan->name);
Modified: team/russell/aoc/channels/chan_console.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_console.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_console.c (original)
+++ team/russell/aoc/channels/chan_console.c Tue Jun 2 17:17:43 2009
@@ -622,6 +622,9 @@
ast_verb(1, V_BEGIN "Console Has Been Retrieved from Hold" V_END);
ast_moh_stop(chan);
break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
+ break;
default:
ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n",
cond, chan->name);
Modified: team/russell/aoc/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_dahdi.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_dahdi.c (original)
+++ team/russell/aoc/channels/chan_dahdi.c Tue Jun 2 17:17:43 2009
@@ -8551,6 +8551,12 @@
case AST_CONTROL_SRCUPDATE:
res = 0;
break;
+ case AST_CONTROL_AOC:
+#ifdef HAVE_PRI
+ /* XXX TODO */
+#endif
+ res = 0;
+ break;
case -1:
res = tone_zone_play_tone(p->subs[idx].dfd, -1);
break;
Modified: team/russell/aoc/channels/chan_h323.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_h323.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_h323.c (original)
+++ team/russell/aoc/channels/chan_h323.c Tue Jun 2 17:17:43 2009
@@ -915,6 +915,10 @@
ast_rtp_instance_new_source(pvt->rtp);
res = 0;
break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
+ res = 0;
+ break;
case AST_CONTROL_PROCEEDING:
case -1:
break;
Modified: team/russell/aoc/channels/chan_mgcp.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_mgcp.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_mgcp.c (original)
+++ team/russell/aoc/channels/chan_mgcp.c Tue Jun 2 17:17:43 2009
@@ -1454,6 +1454,8 @@
break;
case AST_CONTROL_SRCUPDATE:
ast_rtp_instance_new_source(sub->rtp);
+ break;
+ case AST_CONTROL_AOC:
break;
case -1:
transmit_notify_request(sub, "");
Modified: team/russell/aoc/channels/chan_misdn.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_misdn.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_misdn.c (original)
+++ team/russell/aoc/channels/chan_misdn.c Tue Jun 2 17:17:43 2009
@@ -6782,6 +6782,9 @@
chan_misdn_log(1, p->bc->port, "* IND :\tredirecting info update pid:%d\n", p->bc->pid);
misdn_update_redirecting(ast, p->bc, p->originator);
break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
+ break;
default:
chan_misdn_log(1, p->bc->port, " --> * Unknown Indication:%d pid:%d\n", cond, p->bc->pid);
break;
Modified: team/russell/aoc/channels/chan_oss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_oss.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_oss.c (original)
+++ team/russell/aoc/channels/chan_oss.c Tue Jun 2 17:17:43 2009
@@ -776,6 +776,9 @@
ast_verbose(" << Console Has Been Retrieved from Hold >> \n");
ast_moh_stop(c);
break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
+ break;
default:
ast_log(LOG_WARNING, "Don't know how to display condition %d on %s\n", cond, c->name);
return -1;
Modified: team/russell/aoc/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_sip.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_sip.c (original)
+++ team/russell/aoc/channels/chan_sip.c Tue Jun 2 17:17:43 2009
@@ -6402,6 +6402,13 @@
case AST_CONTROL_REDIRECTING:
update_redirecting(p, data, datalen);
break;
+ case AST_CONTROL_AOC:
+ /* XXX TODO */
+ /*
+ * Snom implements AOC like this:
+ * http://wiki.snom.com/Advice_of_charge_(AOC)_in_SIP
+ */
+ break;
case -1:
res = -1;
break;
Modified: team/russell/aoc/channels/chan_skinny.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_skinny.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_skinny.c (original)
+++ team/russell/aoc/channels/chan_skinny.c Tue Jun 2 17:17:43 2009
@@ -4340,6 +4340,9 @@
break;
case AST_CONTROL_CONNECTED_LINE:
update_connectedline(sub, data, datalen);
+ break;
+ case AST_CONTROL_AOC:
+ /* XXX Can you send AoC over Skinny? */
break;
default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
Modified: team/russell/aoc/channels/chan_unistim.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/chan_unistim.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/chan_unistim.c (original)
+++ team/russell/aoc/channels/chan_unistim.c Tue Jun 2 17:17:43 2009
@@ -4133,6 +4133,7 @@
s->device->missed_call = 0;
break;
case AST_CONTROL_PROCEEDING:
+ case AST_CONTROL_AOC:
break;
default:
ast_log(LOG_WARNING, "Don't know how to indicate condition %d\n", ind);
Modified: team/russell/aoc/channels/iax2-parser.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/channels/iax2-parser.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/channels/iax2-parser.c (original)
+++ team/russell/aoc/channels/iax2-parser.c Tue Jun 2 17:17:43 2009
@@ -579,6 +579,7 @@
"TXFER ",
"CNLINE ",
"REDIR ",
+ "AOC ",
};
struct ast_iax2_full_hdr *fh;
char retries[20];
Added: team/russell/aoc/include/asterisk/aoc.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/include/asterisk/aoc.h?view=auto&rev=198865
==============================================================================
--- team/russell/aoc/include/asterisk/aoc.h (added)
+++ team/russell/aoc/include/asterisk/aoc.h Tue Jun 2 17:17:43 2009
@@ -1,0 +1,91 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2009, Digium, Inc.
+ *
+ * Russell Bryant <russell at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*!
+ * \file
+ * \brief Advice of Charge Support
+ * \author Russell Bryant <russell at digium.com>
+ */
+
+#ifndef __AST_AOC_H__
+#define __AST_AOC_H__
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+enum ast_aoc_type {
+ /*! \brief AOC at the beginning of a call */
+ AST_AOC_START = 0x0000,
+ /*! \brief AOC during a call */
+ AST_AOC_DURING = 0x0001,
+ /*! \brief AOC at the end of a call */
+ AST_AOC_END = 0x0002,
+};
+
+enum ast_aoc_charging_type {
+ /* \brief Call costs money. */
+ AST_AOC_CHARGING_YES,
+ /*! \brief Call is free. */
+ AST_AOC_CHARGING_NO,
+};
+
+enum ast_aoc_ie_type {
+ /*!
+ * \brief AOC type (ast_aoc_type)
+ * \note Required
+ * \note payload type uint32_t
+ */
+ AST_AOC_IE_TYPE = 0x0000,
+ /*!
+ * \brief Charging Type (ast_aoc_charging_type)
+ * \note Optional, assume YES if not present.
+ * \note payload type uint32_t
+ */
+ AST_AOC_IE_CHARGING = 0x0001,
+ /*!
+ * \brief An incremental update to charging units
+ * \note Optional
+ * \note payload type uint32_t
+ */
+ AST_AOC_IE_UNITS = 0x0002,
+ /*!
+ * \brief An update to accumulated charging units
+ * \note Optional
+ * \note payload type uint32_t
+ */
+ AST_AOC_IE_UNITS_TOTAL = 0x0003,
+ /*!
+ * \brief A multiplier for reported charging units
+ * \note Optional
+ * \note payload type string representation of a floating point number
+ */
+ AST_AOC_IE_MULTIPLIER = 0x0004,
+ /*!
+ * \brief Currency type
+ * \note Optional
+ * \note payload type string
+ */
+ AST_AOC_IE_CURRENCY = 0x0005,
+};
+
+#if defined(__cplusplus) || defined(c_plusplus)
+}
+#endif
+
+#endif /* __AST_AOC_H__ */
Propchange: team/russell/aoc/include/asterisk/aoc.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/russell/aoc/include/asterisk/aoc.h
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/russell/aoc/include/asterisk/aoc.h
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: team/russell/aoc/include/asterisk/frame.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/include/asterisk/frame.h?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/include/asterisk/frame.h (original)
+++ team/russell/aoc/include/asterisk/frame.h Tue Jun 2 17:17:43 2009
@@ -323,7 +323,8 @@
AST_CONTROL_SRCUPDATE = 20, /*!< Indicate source of media has changed */
AST_CONTROL_TRANSFER = 21, /*!< Indicate status of a transfer request */
AST_CONTROL_CONNECTED_LINE = 22,/*!< Indicate connected line has changed */
- AST_CONTROL_REDIRECTING = 23 /*!< Indicate redirecting id has changed */
+ AST_CONTROL_REDIRECTING = 23, /*!< Indicate redirecting id has changed */
+ AST_CONTROL_AOC = 24, /*!< Advice of Charge */
};
enum ast_control_t38 {
Modified: team/russell/aoc/main/channel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/russell/aoc/main/channel.c?view=diff&rev=198865&r1=198864&r2=198865
==============================================================================
--- team/russell/aoc/main/channel.c (original)
+++ team/russell/aoc/main/channel.c Tue Jun 2 17:17:43 2009
@@ -3344,6 +3344,7 @@
case AST_CONTROL_CONNECTED_LINE:
case AST_CONTROL_REDIRECTING:
case AST_CONTROL_TRANSFER:
+ case AST_CONTROL_AOC:
break;
case AST_CONTROL_CONGESTION:
@@ -3464,6 +3465,7 @@
case AST_CONTROL_TRANSFER:
case AST_CONTROL_CONNECTED_LINE:
case AST_CONTROL_REDIRECTING:
+ case AST_CONTROL_AOC:
/* Nothing left to do for these. */
res = 0;
break;
More information about the asterisk-commits
mailing list