<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I figured that out. I’ve updated the patch on my gist, and updated the rating doc to include a description of how the subtypes work.<div><br></div><div>I’m sending the patch to&nbsp;<a href="mailto:devel@ag-projects.com">devel@ag-projects.com</a> now.</div><div><br></div><div>Thanks!<br><div>
<div>--&nbsp;<br>David M. Lee<br>Digium, Inc. | Software Developer<br>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>Check us out at: &nbsp;<a href="http://www.digium.com">www.digium.com</a>&nbsp;&nbsp;&amp;&nbsp;<a href="http://www.asterisk.org">www.asterisk.org</a></div>

</div>
<br><div><div>On Jan 28, 2014, at 6:12 AM, Tijmen de Mes &lt;<a href="mailto:tijmen@ag-projects.com">tijmen@ag-projects.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Hi,</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I run into trouble and reversed the patch. In the rating engine (telnet) DebitBalance function does not return anything anymore with the patch applied, so something goes wrong.</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_sign_1390911047844851968" class="bloop_sign"><span style="font-family: helvetica, arial; font-size: 13px;"></span>--&nbsp;<br>Tijmen de Mes<br>AG-Projects</div><br><p style="color: rgb(160, 160, 168);">On 27 januari 2014 at 17:55:01, Tijmen de Mes (<a href="mailto:tijmen@ag-projects.com">tijmen@ag-projects.com</a>) wrote:</p><blockquote type="cite" class="clean_bq"><span><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Hi</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I tested the patch and for now I don’t see any problem with it. Before adding it to trunk, can you update the rating docs and record all changes in 1 patch using darcs? After that I can apply it directly on trunk with your credentials.</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">These instructions to submit the patch also apply on CDRTool:</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><a href="http://sipsimpleclient.org/projects/sipsimpleclient/wiki/SipSupport">http://sipsimpleclient.org/projects/sipsimpleclient/wiki/SipSupport</a></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">You don’t need to open a ticket however, just tell me after you send the patch.</div><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">&nbsp;</div><div id="bloop_sign_1390840988356192000" class="bloop_sign">--&nbsp;<br>Tijmen de Mes<br>AG-Projects</div><br><p style="color: rgb(160, 160, 168);">On 26 januari 2014 at 02:08:50, Duane Larson (<a href="mailto:duane.larson@gmail.com">duane.larson@gmail.com</a>) wrote:</p><blockquote type="cite" class="clean_bq"><div dir="ltr"><span>Ugh.... Nevermind. &nbsp;My "Max Duration" was set to 6 on the Destinations rate setup. &nbsp;I set it to zero and I think things are looking better now. &nbsp;Think I'm done for the day. &nbsp;Good work David! &nbsp;Really appreciate the patch.</span></div><div class="gmail_extra"><span><br><br></span><div class="gmail_quote"><span>On Sat, Jan 25, 2014 at 6:56 PM, Duane Larson<span class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br></span><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr">Not sure my "price" is being calculated correctly.<div><br></div><div>My audio.outbound should be $0.005</div><div>My audio.inbound should be $0.0035</div><div><br></div><div>Here is an example of a call that lasted 2:06 minutes and is audio.outbound</div><div><div>Increment=6 MinDuration=6 MaxDuration=6 ConnectFee=0.0000 CallId=dc1e32b1ba18ff91a3</div><div><a href="mailto:67aa8df81e8e3c@0:0:0:0:0:0:0:0">67aa8df81e8e3c@0:0:0:0:0:0:0:0</a> Span=1 Duration=6 DestId=1 default Profile=USA_Default Period=weekend Rate=USA_Default Interval=0-24 Cos</div><div>t=0.0050/60 Price=0.0005 PriceIn=0.0000</div></div><div><br></div><div>Here is an example of a call that lasted 1:33 minutes and is audio.inbound</div><div><div>Increment=6 MinDuration=6 MaxDuration=6 ConnectFee=0.0000 CallId=2e0334513a34964e7c0</div><div><a href="http://a18cd3be449dd@108.166.97.17:5060/" target="_blank">a18cd3be449dd@108.166.97.17:5060</a><span class="Apple-converted-space">&nbsp;</span>Span=1 Duration=6 DestId=1 default Profile=USA_Default Period=weekend Rate=USA_Default Interval=0-24 C</div><div>ost=0.0035/60 Price=0.0003 PriceIn=0.0000</div></div><div><br></div><div>Looks like no matter what the duration is for the inbound calls it costs $0.0003 and the outbound calls all cost $0.0005.</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jan 25, 2014 at 6:24 PM, Duane Larson<span class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:duane.larson@gmail.com" target="_blank">duane.larson@gmail.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr">David/Tijmen/Adrian,<div><br></div><div>It is working for me too. &nbsp;Both inbound and outbound are being recognized and the different rates are being applied. &nbsp;I will keep looking at it while more calls are being made to make sure there are no unforeseen issues.&nbsp;</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Fri, Jan 24, 2014 at 5:35 AM, Tijmen de Mes<span class="Apple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:tijmen@ag-projects.com" target="_blank">tijmen@ag-projects.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br></div><div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Hi David,</div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Thanks for the patch. If have some time Monday I will analyze it and give you some feedback so we include this in CDRTool.</div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><br></div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Besides the rating, I’ve to check if the code that now sets the the ‘route’ for the CDRs and if there are no problems.</div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><span><font color="#888888"><br></font></span></div><div style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><span><font color="#888888">&nbsp;&nbsp;</font></span></div><div><span><font color="#888888">--&nbsp;<br>Tijmen de Mes<br>AG-Projects</font></span></div><div><br><p style="color: rgb(160, 160, 168);">On 23 januari 2014 at 21:21:26, David M. Lee (<a href="mailto:dlee@digium.com" target="_blank">dlee@digium.com</a>) wrote:</p><blockquote type="cite"><span>I’ve got a first attempt at a patch:<br><a href="https://gist.github.com/leedm777/8585690" target="_blank">https://gist.github.com/leedm777/8585690</a><br><br>To get this to work, your CDR’s will have to record the application<br>subtype. For me, I set $avp(s:call_class) = “audio.inbound” or<br>“audio.outbound” as appropriate in the routes, and added<br>Sip-Application-Type=$avp(s:call_class) to “radius_extra”.<br><br>Billing rates will be matched on the full application, allowing<br>different rates depending on the application subtype.<br><br>It works with the simple testing I’ve been able to do on my desktop.<br>Feedback, of course, is greatly appreciated.<br><br>Duane - Does the patch work for you?<br><br>Adrian - Any objections/concerns with this approach?<br><br>If it looks good, I’ll work on updating the docs.<br><br>Thanks!<br>--<br>David M. Lee<br>Digium, Inc. | Software Developer<br>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>Check us out at:<span class="Apple-converted-space">&nbsp;</span><a href="http://www.digium.com/" target="_blank">www.digium.com</a><span class="Apple-converted-space">&nbsp;</span>&amp;<span class="Apple-converted-space">&nbsp;</span><a href="http://www.asterisk.org/" target="_blank">www.asterisk.org</a><br><br>On Jan 23, 2014, at 4:43 AM, Adrian Georgescu &lt;<a href="mailto:ag@ag-projects.com" target="_blank">ag@ag-projects.com</a>&gt; wrote:<br><br>&gt; I think it would be a good idea.<br>&gt;<br>&gt; Adrian<br>&gt;<br>&gt; On 22 Jan 2014, at 16:58, David Lee (digium) &lt;<a href="mailto:dlee@digium.com" target="_blank">dlee@digium.com</a>&gt; wrote:<br>&gt;<br>&gt;&gt; Duane Larson wrote:<br>&gt;&gt;&gt; I have been playing with CDRTool for a while but I am not sure if it is<br>&gt;&gt;&gt; possible to rate Origination (Inbound) calls differently than Termination<br>&gt;&gt;&gt; (Outbound) calls from my SIP Provider. For Origination I pay 0.0035 and<br>&gt;&gt;&gt; for Termination I pay 0.005. Keep in mind these costs are for destination<br>&gt;&gt;&gt; "1”.<br>&gt;&gt;<br>&gt;&gt; I've recently run into nearly the same situation.<br>&gt;&gt;<br>&gt;&gt; I tried overloading the Sip-Application-Type field, but it's limited<br>&gt;&gt; by the supportedApplicationTypes array in cdr_generic.php. There also<br>&gt;&gt; seems to be hard coded logic for the different application types.<br>&gt;&gt;<br>&gt;&gt; I think I will patch CDRTool so that you can have subtypes of<br>&gt;&gt; application types (audio.inbound, audio.outbound, etc.). This would<br>&gt;&gt; allow the billing rates to be a bit more specific for these<br>&gt;&gt; situations.<br>&gt;&gt;<br>&gt;&gt; Thoughts?<br>&gt;&gt; --<br>&gt;&gt; David M. Lee<br>&gt;&gt; Digium, Inc. | Software Developer<br>&gt;&gt; 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>&gt;&gt; Check us out at:<span class="Apple-converted-space">&nbsp;</span><a href="http://www.digium.com/" target="_blank">www.digium.com</a><span class="Apple-converted-space">&nbsp;</span>&amp;<span class="Apple-converted-space">&nbsp;</span><a href="http://www.asterisk.org/" target="_blank">www.asterisk.org</a><br>&gt;&gt; _______________________________________________<br>&gt;&gt; Users mailing list<br>&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>&gt;&gt;<span class="Apple-converted-space">&nbsp;</span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>&gt;<span class="Apple-converted-space">&nbsp;</span><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br><br><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></span></blockquote></div></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br><br></blockquote></div></div><br><br clear="all"><div><div><br></div>--<br>--<br>*--*--*--*--*--*<br>Duane<br>*--*--*--*--*--*<br>--</div></div></blockquote></div><br><br clear="all"><div><br></div>--<br>--<br>*--*--*--*--*--*<br>Duane<br>*--*--*--*--*--*<br>--</div></div></div></blockquote></div><br><br clear="all"><div><br></div>--<br>--<br>*--*--*--*--*--*<br>Duane<br>*--*--*--*--*--*<br>--</div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br></blockquote>_______________________________________________&nbsp;<br>Users mailing list&nbsp;<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>&nbsp;<br>http://lists.opensips.org/cgi-bin/mailman/listinfo/users&nbsp;<br></span></blockquote>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></div></blockquote></div><br></div></body></html>