[OpenSIPS-Users] Adding functionality to call control (python)
ag at ag-projects.com
Fri Jun 18 18:11:39 CEST 2010
The call control engine + rating engine already supports multiple parallel prepaid sessions per user, all calls stop when the balance reaches zero.
What do you try to achieve?
On Jun 18, 2010, at 4:56 PM, Magnus Burman wrote:
> Hi guys,
> To get a more flexible credit control when running several concurrent calls on the same user I'm trying to add some functionality to the call control module.
> Basically what I'm trying to do is set a low time limit, such as 60 seconds, and when the timer runs out send a new getCallLimit, until the call ends either by a return of 0 or by hangup.
> I've been trying to do this by adding a new getCallLimit in the Call.__expire method in sip.py.
> def __expire(self):
> rating = RatingEngineConnections.getConnection(self)
> rating.getCallLimit(self).addCallbacks(callback=self._reinit_simple_calllimit, errback=self._start_error)
> self.expired = True
> self.end(reason='call control', sendbye=True)
> In _reinit_sample_calllimit I mimic _start_finish_calllimit in a lot of ways, trying different timer combinations. I've tried with cancel followed by a new setup, I've tried delay, I've tried reset, I've tried manually doing a new ReactorTimer and all of the above!
> I get the MaxSessionTime call to work, but I fail with the timer somehow. __expire is never called again after the first time, and the call is never interrupted.
> Anyone with tips? At this point I'm about to dive into the twisted framework and reactors, but any hints are much appreciated!
> Users mailing list
> Users at lists.opensips.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Users