[ASTPPCOM-811] Issue with package minutes when using localization Created: 13/Oct/21 Updated: 03/Feb/23 Resolved: 03/Feb/23 |
|
| Status: | Closed |
| Project: | ASTPP Community |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | v5.0 |
| Type: | Bug | Priority: | High |
| Reporter: | Fernando Dorna (Inactive) | Assignee: | Neetu Nogia |
| Resolution: | Done | Votes: | 0 |
| Labels: | Suggestion | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Reproducibility: | always |
| Category: | Functional |
| Edition: | Community |
| Description |
|
Hello team! the problem occurs when using package and localization. For example. I want to have a package of 1000 free minutes to Argentina Mobile. the e.164 format for that destination is 549xxxxxxxxxx (54 AR country code and 9 for mobiles). This is the prefix we have either in origination and termination rates. the customers does not dial in e.164 format of course, they dial like 1530571422 for a local Buenos Aires mobile and after passing the localization that number becomes 5491130571422 (e.164 format) and then, to the gateway... Now the problem is when we want to use package. As you now, the package uses the prefixes defined in the origination rate, in this case 549 form AR Mobile... Seeing the debug in FS, you have the following:
2021-10-13 13:54:22.560093 [DEBUG] switch_cpp.cpp:1365 [ASTPP] [GET_PACKAGE_INFO] Query :SELECT *,P.id as package_id,P.product_id as product_id FROM packages_view as P inner join package_patterns as PKGPTR on P.product_id = PKGPTR.product_id WHERE (patterns = '^1530571422.' OR patterns = '^153057142.' OR patterns = '^15305714.' OR patterns = '^1530571.' OR patterns = '^153057.' OR patterns = '^15305.' OR patterns = '^1530.' OR patterns = '^153.' OR patterns = '^15.' OR patterns = '^1.' OR patterns ='--') AND accountid = 15 ORDER BY LENGTH(PKGPTR.patterns) DESC
As you can see, package match occurs before localization and it does not find any coincidence. The question is: Is there any way to do the package match after the localization [DONUMBERTRANSLATION]?
Thank you!! |
| Comments |
| Comment by Fernando Dorna (Inactive) [ 22/Oct/21 ] |
|
I managed to achieve this by adding this portion of code in function function package_calculation located at /usr/share/freeswitch/scripts/astpp/lib/astpp.functions.lua file: original: function package_calculation (destination_number,userinfo,call_direction)
introduced portion of code:
function package_calculation (destination_number,userinfo,call_direction) if (tonumber(userinfo['localization_id']) > 0) then if (call_direction == 'outbound' and tonumber(userinfo['localization_id']) > 0 and ar_localization and ar_localization['number_originate'] ~= nil) then
.................
Whit that add-on, you can make localization prior to package search.
Regards, Fernando |
| Comment by Neetu Nogia [ 30/Jun/22 ] |
|
Hello Fernando Dorna Good day, Can you please share with us the system configuration screenshot and Freeswitch call logs as well, so we can check accordingly? Thank You |