You could create a daemon like this that listens for the CHANNEL_HANGUP_COMPLETE event and send your CDR to the db.<br><br><a href="http://fisheye.freeswitch.org/browse/FreeSWITCH/contrib/diegoviola/ruby/callcard/cdr.rb">http://fisheye.freeswitch.org/browse/FreeSWITCH/contrib/diegoviola/ruby/callcard/cdr.rb</a><br>
<br>Then do the billing stuff outside FreeSWITCH or use mod_nibblebill.<br><br>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).<br>
<br>Diego<br><br><div class="gmail_quote">On Fri, Sep 11, 2009 at 4:40 AM, Ahmed Munir <span dir="ltr">&lt;<a href="mailto:ahmedmunir007@gmail.com">ahmedmunir007@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for reply, well actually I&#39;m doing billing after call hangup. If h extension is interupts I&#39;m sending to it to addcdr context which interupts perl script for billing purpose. As I&#39;m listing down below asterisk configuration;<div class="im">
<br>
<br><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">h =&gt;<br>
    {<br>
        NOOP(&quot;Call Completed with Carrier ${CARRIER}&quot;);<br>
        goto add_cdr|h|1;<br>
    };</span></font></font><br><br></div><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">
context add_cdr<br>{<br>    _X. =&gt;<br>    {<br>        Hangup();<br>    };<br>    h =&gt;<br>    {<br>        Set(CALL_END_TIME=${EPOCH});<br>        //&amp;print_variables();<br>        NOOP(&quot;Call Ended: Card:${CARDNUM} Destination:${CALLEDNUM} Caller-ID:${CALLERID(num)}&quot;);<br>

        if (${DIALEXECUTED}=YES)<br>        {<br>            NOOP(&quot;Dial-Status:${DIALSTATUS}&quot;);<br>        }else<br>        {<br>            NOOP(&quot;Dial was not Executed&quot;);<br>        };<br>        DeadAGI(/vopium/agi/billing.pl);<br>

        NOOP();<br>    };<br><br>};<br><br>Kindly advice me how I pass/translate h extension in FS in this situation i.e. &lt;action application=&quot;api_hangup_hook&quot; data=&quot;addcdr 1&quot;/&gt; or there is other way around???<div class="im">
<br>

<hr size="3" width="95%" align="center"><b>From: </b>Michael Collins &lt;<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>&gt;<br>
<b>Reply-To: </b>&lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
<b>Date: </b>Thu, 10 Sep 2009 00:55:02 -0700<br>
<b>To: </b>&lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br>
<b>Subject: </b>Re: [Freeswitch-users] Implementing h extension in FS<br>
<br>
<br>
<br></div><div class="im">
On Wed, Sep 9, 2009 at 10:16 PM, Ahmed Munir &lt;<a href="mailto:ahmedmunir007@gmail.com" target="_blank">ahmedmunir007@gmail.com</a>&gt; wrote:<br>
</div></span></font></font><div class="im"><blockquote><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">HI,<br>
<br>
I&#39;m newbie in FS, I want to know how to implement h extension of asterisk to FS. As I listed down below;<br>
<br>
h =&gt;<br>
    {<br>
        NOOP(&quot;Call Completed with Carrier ${CARRIER}&quot;);<br>
        goto add_cdr|h|1;<br>
    };<br>
<br>
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.<br>
<br>
<br>
Kindly advice me soon.<br>
<br>
-- <br>
Regards,<br>
<font color="#888888"><br>
Ahmed Munir<br>
<br>
</font></span></font></font></blockquote></div><div class="im"><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
It depends on what you are trying to accomplish, but the closest thing
you&#39;ll find in FS to the &#39;h&#39; 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&#39;ll do our best to offer advice.<br>
-MC</span></font></font><br clear="all"><br></div>-- <br>Regards,<br><font color="#888888"><br>Ahmed Munir<br><br><br>
</font><br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>