Easy way to distribute calls?

Status
Not open for further replies.

millsey

Premier Customer
Joined
Dec 21, 2011
Messages
208
Reaction score
0
I want to have a VAd which puts one in five calls to an external number, and the rest to an internal group or another VAD. I can do this using HTML requests etc - but I don't want to have to rely on an external source if possible. Iis there a simple permanent counter I can use? It has to be solid reliable as it is a shared marketign campaign with another company. So dividing the current call id by 5 would not cut it.

Thanks
Millsey
 
You can use different approachs, but the most reliable in my opinion would be creating a simple DLL to be called from an external code execution component.

When the external code execution component is configured to call a method into a .NET DLL, this is what happens:
1) The flow executes an ASPX page in the web server (IIS or Abyss).
2) Into that ASPX page, a new instance of the object type specified is created, using the default constructor, and then the method is executed.
3) Into that method you can call a Singleton that atomically increments a number, and returns that number.
4) All the VAD calls share the same memory space, so the singleton will keep the same counter for all the calls.

It's important to increment the counter into a singleton and not into the object created by the VAD. This is because the VAD will create a different object for each call, but the Singleton will be the same instance for every call.

Hope the information helps.

Regards,
 
I can do this (just) but I don't think the counter woudl survive a reboot or restart of IIS.

I think I will do this by PHP. Is there a way to call an executable / script rather than a DLL?
 
Well, you can also persist the counter to a file, that way it will survive restarts.

Or if you're going to do it with PHP, then you can send the HTTP request using a web interaction component, and you don't need to code anything.
 
I will do a scalar SQL query to call a stored procedure on MS SQL database which receives the call data, gets the last row ID and modulo it against our call sharing ratio. Then if result = 0 then go to other comapny, otherwise go to next VAD

Thanks anyway, I was overthinking it.

Millsey
 
That's also a good solution.
 
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,882
Members
165,468
Latest member
kanderson