Applies to VoipNow 3.X.X and 4.X.X!
To create a call cost file, you must use the following format. For more details on channel costs, visit this page.
This is an example of a valid cost file. Each line of the .csv file must be written in the following format:
<Area code>, <Cost>, <Charge interval>, <Description>, <Network>, <Setup cost>, <Maximum charge>
The following record is valid:
0033, 0.02, 60, Description, MobiCom, 8, 4999
This cost rule signifies that for calls prefixed with the 0033 code, the extension is charged 0.02 <currency> every 60 seconds, whereas the one time setup cost is 8 <currency> and the maximum amount allowed for this area code is 4,999 <currency>.
The <currency> is the one defined in the Unified Communications → Settings → Zero Priority → Charging Preferences page. This cost rule applies to the MobiComnetwork (the network code must be provided). The Description field can be used for associating a note to the cost rule.
Other examples of valid records:
043, 0.02, 60, Cheap land calls, LandTel, 0, 150
0040, 0.20, 30, Romania, RomTelCo, 0.99, 9999999
Another way to get a format example is to manually add costs in the interface, then export the file and use it as an example.
Here are some of the potential issues you might encounter.
Format is not correct
On VoipNow 3.5.0 and higher versions, you will get an error message telling you what lines to check.
You can take some lines from your cost file and upload them to check the format and thus avoid any file-size related issue.
You can first try to extend the size of the cost file for upload.
For that you should go to Unified Communications >> Web interface >> Interface Settings >> Maximum uploaded file size. If you still cannot upload it and you get timeouts, check the php_error.log:
During upload, you might get a memory-related error like this:
[11-Sep-2015 04:17:32 Pacific/Honolulu] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4097 bytes) in /usr/local/voipnow/admin/htdocs/plib/app_components/channel/class.Channel.php on line 269
If so, edit /usr/local/voipnow/admin/conf/fpm.conf and increase the memory allocated here to 512 MB for example:
php_admin_value[memory_limit] = 256M
#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))