[OpenSIPS-Users] Adding functionality to call control (python)
Magnus Burman
magnus.burman at adamo.es
Fri Jun 18 16:56:37 CEST 2010
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.application.clean_call(self.callid)
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!
Cheers,
Magnus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100618/109d1ceb/attachment.htm
More information about the Users
mailing list