Hello,
I wonder if anyone has a solution for having a call being terminated by SER in case a certain credit limit has been reached or in case the connection was lost to either end of a call ? I am testing with mediaproxy and can have it timeout, it will tear down the RTP relaying nevertheless it wont teminate the actual call by means of a BYE request that was setup to the PSTN gateway. So this connection stays open.
Is there a way to interface with SER and to have it generate a BYE to the PSTN gateway ?
Can I use RADIUS to tear down the call in case of a prepaid credit limit ?
Best regards Paul van Schagen
Hi Paul,
There were several discussions on the list about these topics. Just to summarize:
1) to tear down hanged calls to PSTN, the best way to go is by using Session Timer on the GW (if it supports); if not supported you have to use a B2BUA probably.
2) to limit the call duration you need a B2BUA. Another alternative is to play with dynamic values for Session Timer and force the GW to hang the call for you.
In both cases you relay only on signalling support.
Best regards, Marian
Paul van Schagen wrote:
Hello,
I wonder if anyone has a solution for having a call being terminated by SER in case a certain credit limit has been reached or
in case the connection was lost to either end of a call ? I am testing with mediaproxy and can have it timeout, it will tear down the
RTP relaying nevertheless it wont teminate the actual call by means of a BYE request that was setup to the PSTN gateway.
So this connection stays open.
Is there a way to interface with SER and to have it generate a BYE to the PSTN gateway ?
Can I use RADIUS to tear down the call in case of a prepaid credit limit ?
Best regards
Paul van Schagen
I came up with a patch to enhance the mediaproxy timeout issue I posted earlier BTW. Mediaproxy will only timeout if there is no reception of UDP packets from neither side. This modification will make it timeout if there is none from either side. After this patch the mediaproxy will timeout when connection to either side is lost. As was noted it is important there is no silence detection activated on the UA's or else silence could cause a timeout. These are my 1st lines in python so excuse the syntax. I simply split up the IdleTime attribute and added two attributes named IdleTimeCaller and IdleTimeCalled. On reception of a UDP packet I am checking where it came from ( sender =0 or 1 ) and I reset the corresponding timer. ( Called or Caller ) Instead of resetting the main IdleTime to 0 each time a UDP packet is received, I am giving this timer the value max of both individual timers. The result is that as long as we receive packets from both ends it will not time out. If there is nothing from one end though the main IdleTimer will be reset and will timeout.
Changes are marked with PVS added. No warranties ofcourse.
In rtphandler.py I changed the following
def run(self): global byteBucket, Traffic now = time.time() if now >= self.next: period = self.period ## Check sessions and timeout idle ones for session in Sessions.values(): for stream in session.mediaStreams: stream.idleTime += period # PVS added stream.idleTimeCalled +=period stream.idleTimeCaller +=period #### if session.didTimeout: session.end() elif forceClose and session.durati
..............
class MediaStream(object): def __init__(self, session, mediatype='Audio'): self.session = weakref.proxy(session) self.type = mediatype.capitalize() (dataSlot, ctrlSlot) = self.__findRTPSlot() self.rtpStream = RTPStream(self, dataSlot, 'RTP') self.rtcpStream = RTPStream(self, ctrlSlot, 'RTCP') self.idleTime = 0 self.complete = 0
# PVS added
self.idleTimeCaller= 0 self.idleTimeCalled= 0
###################################
if destination: byteBucket[2] += bytes self.bytes[2] += bytes self.packets[2] += 1 self.sendto(data, destination)
# PVS added ###### if sender==0 : self.stream.idleTimeCalled=0 if sender==1 : self.stream.idleTimeCaller=0 self.stream.idleTime = max(self.stream.idleTimeCalled,self.stream.idleTimeCaller) ############## def handle_close(self): self.close()
############################################
Hi Paul
As marian mentioned there are a few creative methods to get this to work "kind of".
Theone I think is the best is session_timer, however this puts a load on the server, since re-invites need to be sent (this is in the archive somewhere).
Also if you have different billing rates per day/per hour, and per location and even customer type (like some morons such as moi have decided to do :-)) then session timers become very complicated, since each timer needs to be different.
EG customer has credit of 100p, but calls some remote country which charges 70p per minute, in theory he should only get approx 90 secs of call, hence if session timer is fixed for him and everyone, at say 120 seconds (or even longer), he will overrun. This may not be a big problem, since if you have alook at your blended costs/rev model you may be able to work that into the overall scheme of things.
hence why I am having a few painful weeks :-), also sipsak can be used to send a BYE message to the gateway (although I am still in the process of trying to test this...but I think a few on this list have done it successfully).
Easiest is to use a B2Bua, eg asterisk, or asterisk-b2bua but then you are really handling all the media stream, which then adds to cost in terms of bandwidth server load etc etc, so you will have to work this out based upon what business model you really wish to go for.
Iqbal
On 4/23/2005, "Marian Dumitru" marian.dumitru@voice-sistem.ro wrote:
Hi Paul,
There were several discussions on the list about these topics. Just to summarize:
- to tear down hanged calls to PSTN, the best way to go is by using
Session Timer on the GW (if it supports); if not supported you have to use a B2BUA probably.
- to limit the call duration you need a B2BUA. Another alternative is
to play with dynamic values for Session Timer and force the GW to hang the call for you.
In both cases you relay only on signalling support.
Best regards, Marian
Paul van Schagen wrote:
Hello,
I wonder if anyone has a solution for having a call being terminated by SER in case a certain credit limit has been reached or
in case the connection was lost to either end of a call ? I am testing with mediaproxy and can have it timeout, it will tear down the
RTP relaying nevertheless it wont teminate the actual call by means of a BYE request that was setup to the PSTN gateway.
So this connection stays open.
Is there a way to interface with SER and to have it generate a BYE to the PSTN gateway ?
Can I use RADIUS to tear down the call in case of a prepaid credit limit ?
Best regards
Paul van Schagen
-- Voice System http://www.voice-system.ro
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers