[OpenSIPS-Users] Adding functionality to call control (python)
Adrian Georgescu
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?
Adrian
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.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
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100618/65542fda/attachment.htm
More information about the Users
mailing list