feature request: switchvox.outgoingCallRules.getList output

Talk with others about developing applications for Switchvox

Moderators: bmdhacks, dpodolsky, tristand, jwitt, joshuas

feature request: switchvox.outgoingCallRules.getList output

Postby sterlingmarking » Wed Mar 14, 2012 8:08 am

The switchvox.outgoingCallRules.getList method returns a list of the outgoing call rules but the pattern it returns is a string (the string used in the admin website). Could this be changed to allow sending the same fields that .add and .update take?

output from getList:
Code: Select all
{
   "call_through" : {
      "internal" : {}
   },
   "priority" : "48",
   "name" : "0048 1900call9or1x",
   "description" : "20120313",
   "failovers" : {},
   "is_final" : "1",
   "pattern" : "Begins with (9|1)900 and the remainder is 7 digits in length.",
   "id" : "1998",
   "context_type" : "USER"
}


Output from getInfo:
Code: Select all
{
   "call_through" : {
      "internal" : {}
   },
   "priority" : "48",
   "pattern_prepend" : "850",
   "dependents" : {},
   "pattern_max" : "7",
   "name" : "0048 1900call9or1x",
   "pattern_min" : "7",
   "pattern_begin" : "(9|1)900",
   "description" : "20120313",
   "pattern_trim" : "11",
   "failovers" : {},
   "is_final" : "1",
   "context_type" : "USER",
   "id" : "1998"
}


Currently to check if the rules we have are equal to the new rules we're generating, I have to get the list, then iterate over the list by priority and get the id numbers for each rule, then loop through those calling .getInfo. From .getInfo I then compare the name, pattern_begin, pattern_max, etc with the rule I'm adding to see if it already exists.

I would like the fields from get Info to show up in the response from getList, or a flag added that gives you either the string or the broken out fields. I do not want to have to parse out the string when updating call rules.

Thanks.
Jesse Carlton
Systems Administrator
Sterling Marking Products Inc.
sterlingmarking
Oldsterisk
 
Posts: 100
Joined: Mon Mar 22, 2010 9:42 am
Location: London, Ontario

Re: feature request: switchvox.outgoingCallRules.getList output

Postby dpodolsky » Wed Mar 14, 2012 9:37 am

Reasonable and feasible request. May I ask, what are you building? If we make changes or improvements to APIs we like to have the big picture on what a developer is making. If its top secret feel free to PM me with details.
dpodolsky
Oldsterisk
 
Posts: 325
Joined: Thu Apr 23, 2009 2:35 pm

Re: feature request: switchvox.outgoingCallRules.getList output

Postby sterlingmarking » Fri Mar 16, 2012 12:27 pm

it's definitely not top secret, it's more of an inconvenience really. We have 5 pilot number for 5 different calling areas, and our VOIP provider only gives us 5 digit routing codes to send a call out over that number. They don't do any least cost or failover, they just take whatever number we give them and dial it, if it fails it fails.

So to do least cost routing, ie send calls that are local to toronto out using the toronto pilot number so it is a free call, we have to manage the routing codes. I took it a step further and created outgoing call rules so that any 10 digit number in north america can be dialed with or without a 9, 1, or both and it will always use the trunk that would be a local call, and fail over to our main number if all the "lines" for that city are in use.

Support tells me that it is a very bad idea to do it this way, but it saves us about $500-$1500 a month in long distance charges, and other than the 7.9 million warnings that show up in the advanced call logs when I reboot the server, the system runs fine, and outgoing calls start ringing within 3 seconds of pressing 'dial' on the phone.

The only downside to this is when there are area code changes or new exchanges added to an area code, they will fail because the call rules say they are long distance and the voip provider says they are local. One reason I'm doing the update the way I am is so that the ID number of each call rule doesn't reach some ridiculous number, I just update the existing rules and add rules if I run out of existing ones.

If there was some other way of doing this I would love to hear it. Or I could throw in a feature request to modify the system. You could have a system in place where you provide the pilot numbers available to you and switchvox handles the routing internally automatically...that would be nice.
Jesse Carlton
Systems Administrator
Sterling Marking Products Inc.
sterlingmarking
Oldsterisk
 
Posts: 100
Joined: Mon Mar 22, 2010 9:42 am
Location: London, Ontario


Return to Switchvox Developers

Who is online

Users browsing this forum: No registered users and 3 guests