[ASTPPCOM-54] Inbound calls from provider should not be rated through origination rates Created: 12/Aug/16 Updated: 01/Apr/21 Resolved: 01/Apr/21 |
|
| Status: | Done |
| Project: | ASTPP Community |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | v3.5 |
| Type: | New Feature | ||
| Reporter: | fozzygo4 | Assignee: | Samir Doshi |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Calls that are inbound via a provider should not get rated using the origination rates. These calls should only get rated via the DID table. Further more the CDR for inbound is inserting 2 records into the table and should only insert the CDR for the customer and not the provider. This is causing inaccurate reporting for the provider and customers. |
| Comments |
| Comment by fozzygo4 [ 12/Aug/16 ] |
|
I have made the following changes in /html/fs/lib/astpp.cdr.php that prevents the outbound CDR entry being added to CDR of the provider when the call is inbound from provider. Please let me know if this makes sense. At line: 118 + if($account_type != 3) + { $query = "INSERT INTO cdrs (uniqueid,accountid,type,callerid,callednum,billseconds,trunk_id,trunkip,callerip,disposition,callstart,debit,cost,provider_id,pricelist_id,package_id,pattern,notes,rate_cost,reseller_id,reseller_code,reseller_code_destination,reseller_cost,provider_code,provider_code_destination,provider_cost,provider_call_cost,call_direction,calltype,profile_start_stamp,answer_stamp,bridge_stamp,progress_stamp,progress_media_stamp,end_stamp,billmsec,answermsec,waitmsec,progress_mediamsec,flow_billmsec) values ($cdr_string)"; $logger->log($query); $db->run($query); + } |
| Comment by fozzygo4 [ 12/Aug/16 ] |
|
I have further modified the IF statement as follows: This now works correctly on CDR reports. It does the following:
This now works well on the basis that one does not bill customer A to customer B. Not sure how one would implement that. Also I have noticed that the balance of customer A is effected with call charge even though it is a free DID call. |
| Comment by fozzygo4 [ 14/Aug/16 ] |
|
After doing some further testing I have come to the following conclusion and some scenarios: I now understand the principle of the inbound call being rated through origination rates based on the fact that if a provider charges for inbound calls then you would want to pass that charge onto the customer. If not then you can simply add the DID to the origination rate and the call will not be billed but this still adds extra records to the CDR table which still makes the duration total inaccurate. The solution to this is to remove the extra DID entry from the CDR table but the record for the CDR from the provider will have a disposition of "STANDARD" and not DID. This also adds room for error if one adds a DID to a customer and forgets to add the DID to all the origination rates. So my conclusion is this is not practical. Another scenario and this is more practical but I feel needs extra work done on the DID rating system else it does not give the ability to have inbound charges calculated to the provider. Currently you can add a per min charge and intervals to the DID but this will bill the customer who owns the DID. perhaps add a cost field to the DID for the provider or a checkbox to enable or disable billing of the provider. Hope this makes sense to everyone. At this point as we are not charging for inbound calls in my country, I have made the following changes the the astpp.cdr.php file that makes my scenario work for me. // *** Function by Fozzy *** if($account_type == 0 && $dataVariable['provider_id'] != 0) { $query = "INSERT INTO cdrs (uniqueid,accountid,type,callerid,callednum,billseconds,trunk_id,trunkip,callerip,disposition,callstart,debit,cost,provider_id,pricelist_id,package_id,pattern,notes,rate_cost,reseller_id,reseller_code,reseller_code_destination,reseller_cost,provider_code,provider_code_destination,provider_cost,provider_call_cost,call_direction,calltype,profile_start_stamp,answer_stamp,bridge_stamp,progress_stamp,progress_media_stamp,end_stamp,billmsec,answermsec,waitmsec,progress_mediamsec,flow_billmsec) values ($cdr_string)"; $logger->log($query); $db->run($query); } // End Function by Foz //Update customer balance //if($debit > 0 && $dataVariable['calltype'] != "FREE") // Function modified my Fozzy if($debit > 0 && $dataVariable['calltype'] != "FREE" && $account_type == 0 && $dataVariable['provider_id'] != 0) { update_balance($accountid, $debit, 0, $logger, $db); } |
| Comment by Samir Doshi [ 05/Sep/17 ] |
|
We made it configurable. If you want to avoid it then you need to set variable INB_FREE="true" in /var/lib/astpp/astpp.lua. That will avoid billing of DID calls for provider. Update to ASTPP 3.5 and test it out. |
| Comment by Frank (Inactive) [ 02/Mar/18 ] |
|
i have same issue as fuzzy, i need to know my COST from provider on the DID... right now inbound call never show any cost in /reports/customerReport/ |
| Comment by Samir Doshi [ 05/Mar/18 ] |
|
We do not have DID buy rate option at the moment. Becuase of that you will not be able to get any value in COST field in DID calls. If you want to know the cost for the provider then you can create origination rate with DID prefix and define the amount in that. Then assign that rate group to provider. So whenever, we will get call from that provider, system will check origination rates and then route the call to DID. That way you will get 2 entries. 1 with provider account with debit value and 2nd with customer to whom DID is assigned. Note: Make sure you do not have INB_FREE configured in astpp-config.lua. |
| Comment by Frank (Inactive) [ 11/Mar/18 ] |
|
i did that put the full DID in the originator rate, i get this as cdr and astpp logs ` but doesnt show in cost still.. any other idea ? hard to figure my costs when all inbound shows no cost |
| Comment by Samir Doshi [ 12/Mar/18 ] |
|
Again, for DID calls, you will never get cost field. Cost field will have <https://mailtrack.io/> Sent with Mailtrack Best RegardsSamir Doshi Disclaimer: On Sun, Mar 11, 2018 at 6:57 PM, Frank <notifications@github.com> wrote: > i did that put the full DID in the originator rate, i get this as cdr |
| Comment by Frank (Inactive) [ 29/Mar/18 ] |
|
its a call from trunk.. landline --> telco --> pri -->provider SIP as 14185551212@astppIP (astpp) gets this from trunk provider aka gateway carrier etc |