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"><<a href="mailto:ahmedmunir007@gmail.com">ahmedmunir007@gmail.com</a>></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'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;<div class="im">
<br>
<br><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">h =><br>
{<br>
NOOP("Call Completed with Carrier ${CARRIER}");<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. =><br> {<br> Hangup();<br> };<br> h =><br> {<br> Set(CALL_END_TIME=${EPOCH});<br> //&print_variables();<br> NOOP("Call Ended: Card:${CARDNUM} Destination:${CALLEDNUM} Caller-ID:${CALLERID(num)}");<br>
if (${DIALEXECUTED}=YES)<br> {<br> NOOP("Dial-Status:${DIALSTATUS}");<br> }else<br> {<br> NOOP("Dial was not Executed");<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. <action application="api_hangup_hook" data="addcdr 1"/> or there is other way around???<div class="im">
<br>
<hr size="3" width="95%" align="center"><b>From: </b>Michael Collins <<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>><br>
<b>Reply-To: </b><<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>><br>
<b>Date: </b>Thu, 10 Sep 2009 00:55:02 -0700<br>
<b>To: </b><<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>><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 <<a href="mailto:ahmedmunir007@gmail.com" target="_blank">ahmedmunir007@gmail.com</a>> 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'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 =><br>
{<br>
NOOP("Call Completed with Carrier ${CARRIER}");<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'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.<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>