Account-wide global variables and shared code capability
Posted: Thu Nov 20, 2014 9:03 pm
Hi there,
I'm a new customer of SS. Looks like it's going to suit my needs quite well.
I'm a programmer -- How long because I can't remember -- just not all that familiar with Ruby and the particular limits (if any) imposed on the Ruby implementation that is customer-facing. My background is Python, C, Pascal, Bash, (and... err... MS Basic, Quickbasic, CP/M Basic on an Osborne 1 at the age of 8.... err am I showinig my age???!!)
I want to head off the development of my Ruby dialplans in the best way possible, so I have the following questions:
1. Is it possible to have account-wide global variables? If so, how? My use case would be to have global variables holding the name(s) of outbound providers for a call to be connected via. By having this in a global, if that provider goes down (or I want to drop them), I can just change the one global variable and all my dialplans will automagically switch to using the new provider.
If globals are not available, what is an alternate way to achieve this? (Perhaps, provisioning a dedicated SS account called "out-primary-1" where all outbound calls are forwarded to, and the outbound DP for that account contains the details of the specific VSP to forward on to. All other outbound dialplans forward to "out-primary-1" instead of any hard-coded URI?)
2. Is there any method to "import" blocks of Ruby code into a DP so that code is not duplicated across multiple DP's? I'm planning to roll SS out for my employer and so I envisage that employee-specific DP's will eventually proliferate and some kind of "import" mechanism (a-la Python) would eliminate the potential administrative nightmare of having to keep duplicates of certain Ruby code blocks up to date over time.
I look forward to any assistance or insight anyone can provide.
Many thanks in advance,
john
I'm a new customer of SS. Looks like it's going to suit my needs quite well.
I'm a programmer -- How long because I can't remember -- just not all that familiar with Ruby and the particular limits (if any) imposed on the Ruby implementation that is customer-facing. My background is Python, C, Pascal, Bash, (and... err... MS Basic, Quickbasic, CP/M Basic on an Osborne 1 at the age of 8.... err am I showinig my age???!!)
I want to head off the development of my Ruby dialplans in the best way possible, so I have the following questions:
1. Is it possible to have account-wide global variables? If so, how? My use case would be to have global variables holding the name(s) of outbound providers for a call to be connected via. By having this in a global, if that provider goes down (or I want to drop them), I can just change the one global variable and all my dialplans will automagically switch to using the new provider.
If globals are not available, what is an alternate way to achieve this? (Perhaps, provisioning a dedicated SS account called "out-primary-1" where all outbound calls are forwarded to, and the outbound DP for that account contains the details of the specific VSP to forward on to. All other outbound dialplans forward to "out-primary-1" instead of any hard-coded URI?)
2. Is there any method to "import" blocks of Ruby code into a DP so that code is not duplicated across multiple DP's? I'm planning to roll SS out for my employer and so I envisage that employee-specific DP's will eventually proliferate and some kind of "import" mechanism (a-la Python) would eliminate the potential administrative nightmare of having to keep duplicates of certain Ruby code blocks up to date over time.
I look forward to any assistance or insight anyone can provide.
Many thanks in advance,
john