diff options
author | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 18:10:15 +0000 |
---|---|---|
committer | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 18:10:15 +0000 |
commit | 245c5d9eb8a3742b31fe08e4d674100fe8292cc0 (patch) | |
tree | 985bf496a795d25e80f0f4948c0f68cbadb0f7ac /apps/app_queue.c | |
parent | 79137525f046203f58038a50d520f6d8536aed34 (diff) |
Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
(Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages
Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup
AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.
SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
'snom_aoc_enabled' sip.conf option.
IAX AOC Support
- Natively supports AOC pass-through through the use of the new
AST_CONTROL_AOC frame type
DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
example usage:
;requests AOC-S, AOC-D, and AOC-E on call setup
exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))
Review: https://reviewboard.asterisk.org/r/552/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@267096 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 68146ddea..1fdd97c5a 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -94,6 +94,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/strings.h" #include "asterisk/global_datastores.h" #include "asterisk/taskprocessor.h" +#include "asterisk/aoc.h" #include "asterisk/callerid.h" #include "asterisk/cel.h" #include "asterisk/data.h" @@ -820,6 +821,7 @@ struct callattempt { unsigned int pending_connected_update:1; /*! TRUE if caller id is not available for connected line */ unsigned int dial_callerid_absent:1; + struct ast_aoc_decoded *aoc_s_rate_list; }; @@ -2654,6 +2656,7 @@ static void hangupcalls(struct callattempt *outgoing, struct ast_channel *except } oo = outgoing; outgoing = outgoing->q_next; + ast_aoc_destroy_decoded(oo->aoc_s_rate_list); callattempt_free(oo); } } @@ -3335,6 +3338,14 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte ast_party_connected_line_free(&connected_caller); } } + if (o->aoc_s_rate_list) { + size_t encoded_size; + struct ast_aoc_encoded *encoded; + if ((encoded = ast_aoc_encode(o->aoc_s_rate_list, &encoded_size, o->chan))) { + ast_indicate_data(in, AST_CONTROL_AOC, encoded, encoded_size); + ast_aoc_destroy_encoded(encoded); + } + } peer = o; } } else if (o->chan && (o->chan == winner)) { @@ -3454,6 +3465,14 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte ast_party_connected_line_free(&connected_caller); } } + if (o->aoc_s_rate_list) { + size_t encoded_size; + struct ast_aoc_encoded *encoded; + if ((encoded = ast_aoc_encode(o->aoc_s_rate_list, &encoded_size, o->chan))) { + ast_indicate_data(in, AST_CONTROL_AOC, encoded, encoded_size); + ast_aoc_destroy_encoded(encoded); + } + } peer = o; } break; @@ -3523,6 +3542,17 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte } } break; + case AST_CONTROL_AOC: + { + struct ast_aoc_decoded *decoded = ast_aoc_decode(f->data.ptr, f->datalen, o->chan); + if (decoded && (ast_aoc_get_msg_type(decoded) == AST_AOC_S)) { + ast_aoc_destroy_decoded(o->aoc_s_rate_list); + o->aoc_s_rate_list = decoded; + } else { + ast_aoc_destroy_decoded(decoded); + } + } + break; case AST_CONTROL_REDIRECTING: if (!update_connectedline) { ast_verb(3, "Redirecting update to %s prevented\n", inchan_name); |