[asterisk-dev] Help with AOC (Advice Of Charge) - price info on outbound calls

Marin Odrljin marin at maxcom.hr
Thu Nov 23 03:00:56 CST 2017


Thanks Matthew, now it is clear to me. Currently we (me and my colleagues) don't have time for creating a patch, but hopefully one day in near future we'll provide it.

Marin Odrljin
maxcom d.o.o. Croatia
 
> Unfortunately, AOC events don't have a JSON representation and aren't
> published to a Stasis topic that goes to ARI applications.
> 
> In aoc_publish_blob, you can see that we only publish the various AOC
> events to the Manager topic (via ast_manager_get_topic):
> 
> msg = stasis_message_create(msg_type, aoc_event);
> ao2_ref(aoc_event, -1);
> 
> stasis_publish(ast_manager_get_topic(), msg);
> 
> That pretty much limits AOC events to AMI today.
> 
> If you wanted this in ARI, you could pretty easily provide a patch to
> do so. You'd need to:
> 
> * Change the topic that the messages are published to one that is
> received by ARI. Assuming there is a channel involved, the easiest of
> these is the channel topic. If there is no channel, you could publish
> it to the generic 'all channels' topic. (Not all AOC events have a
> channel, so you'd need to make sure it goes to some topic that makes
> sense when that's the case.)
> 
> * Provide a JSON representation of the message. That means defining a
> .to_json callback here which formats the message into JSON:
> 
> STASIS_MESSAGE_TYPE_DEFN(
> aoc_s_type,
> .to_ami = aoc_s_to_ami);
> 
> STASIS_MESSAGE_TYPE_DEFN(
> aoc_d_type,
> .to_ami = aoc_d_to_ami);
> 
> STASIS_MESSAGE_TYPE_DEFN(
> aoc_e_type,
> .to_ami = aoc_e_to_ami);
> 
> * Add the JSON representation of the message to the Swagger
> specification (events.json) so that things get validated correctly.
> 
> 
> For what it's worth, the data models wiki page shows the various
> events that can be received:
> 
> https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+REST+Data+Models
> 
> --
> Matthew Jordan
> Digium, Inc. | CTO
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
> Check us out at: http://digium.com & http://asterisk.org
> 
> --
> __________________________________________________________
> ___________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list