[Freeswitch-users] Implementing h extension in FS

Diego Viola diego.viola at gmail.com
Fri Sep 11 08:50:34 PDT 2009


You could create a daemon like this that listens for the
CHANNEL_HANGUP_COMPLETE event and send your CDR to the db.

http://fisheye.freeswitch.org/browse/FreeSWITCH/contrib/diegoviola/ruby/callcard/cdr.rb

Then do the billing stuff outside FreeSWITCH or use mod_nibblebill.

I suggest also that you enable mod_xml_cdr or mod_cdr_csv so you always have
a copy of the CDR on disk in case if something fails (like the db).

Diego

On Fri, Sep 11, 2009 at 4:40 AM, Ahmed Munir <ahmedmunir007 at gmail.com>wrote:

> Thanks for reply, well actually I'm doing billing after call hangup. If h
> extension is interupts I'm sending to it to addcdr context which interupts
> perl script for billing purpose. As I'm listing down below asterisk
> configuration;
>
> h =>
>     {
>         NOOP("Call Completed with Carrier ${CARRIER}");
>         goto add_cdr|h|1;
>     };
>
> context add_cdr
> {
>     _X. =>
>     {
>         Hangup();
>     };
>     h =>
>     {
>         Set(CALL_END_TIME=${EPOCH});
>         //&print_variables();
>         NOOP("Call Ended: Card:${CARDNUM} Destination:${CALLEDNUM}
> Caller-ID:${CALLERID(num)}");
>         if (${DIALEXECUTED}=YES)
>         {
>             NOOP("Dial-Status:${DIALSTATUS}");
>         }else
>         {
>             NOOP("Dial was not Executed");
>         };
>         DeadAGI(/vopium/agi/billing.pl);
>         NOOP();
>     };
>
> };
>
> Kindly advice me how I pass/translate h extension in FS in this situation
> i.e. <action application="api_hangup_hook" data="addcdr 1"/> or there is
> other way around???
> ------------------------------
> *From: *Michael Collins <msc at freeswitch.org>
> *Reply-To: *<freeswitch-users at lists.freeswitch.org>
> *Date: *Thu, 10 Sep 2009 00:55:02 -0700
> *To: *<freeswitch-users at lists.freeswitch.org>
> *Subject: *Re: [Freeswitch-users] Implementing h extension in FS
>
>
>
> On Wed, Sep 9, 2009 at 10:16 PM, Ahmed Munir <ahmedmunir007 at gmail.com>
> wrote:
>
> HI,
>
> I'm newbie in FS, I want to know how to implement h extension of asterisk
> to FS. As I listed down below;
>
> h =>
>     {
>         NOOP("Call Completed with Carrier ${CARRIER}");
>         goto add_cdr|h|1;
>     };
>
> My other question is, which application/function/class is use in mod_perl
> to check the channel status? i.e. busy, answer,hangup,ringing,etc.
>
>
> Kindly advice me soon.
>
> --
> Regards,
>
> Ahmed Munir
>
>
> It depends on what you are trying to accomplish, but the closest thing
> you'll find in FS to the 'h' extension is the channel variable
> api_hangup_hook which lets you launch an API at the end of the call. It
> sounds like you are working on CDR processing. Please tell us more about
> your application and we'll do our best to offer advice.
> -MC
>
> --
> Regards,
>
> Ahmed Munir
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090911/e14e3628/attachment-0002.html 


More information about the FreeSWITCH-users mailing list