On Nov 4, 2007, at 5:15 PM, Jeremy McNamara wrote:
CSB wrote:
Can you elaborate a little on "proper call accounting" as I am battling with this currently. An example: SER sends INVITE to Asterisk. Depending on the circumstances we might want to record a voicemail message, hit an IVR or queue, or pass the call on to the PSTN.
Since OpenSER only manages the SIP sessions, OpenSER does not specifically know if any particular call is active or not. If you were only relying OpenSER's accounting a crafty voip user could simply never send you a BYE message, thus effectively never hanging up any calls.
This is why mediaproxy has a call accounting process. I believe RTP Proxy has also been updated or is scheduled to be updated with an accounting process.
In my opinion, the only truly viable way to do call accounting is along with the media stream (RTP), then you will know if the call is still in session and have the ability to specifically terminate the call for any given reason (by stopping the RTP from flowing.)
What about the scenario where the call is placed on hold and the BYE isn't properly generated? We actually ran into this issue last week where it appeared that an on hold call was active for more than 5 hours (yes not impossible, but in this case the call "ended" after only a few seconds. Since the call was on hold the RTP wasn't taken down when no audio was not passed since none was expected. Really it seems the only way to do this properly is not with RTP but with SIP session timers but unfortunately not many devices have them implemented.
I guess the question is there really any other options?
Since Asterisk can't deal with OpenSER's authentication limitations we can only have one effective SIP peer (based on the IP of OpenSER) and therefore one context for accounting purposes. This makes even routing the call a challenge (how do you make sure that only certain users can get out to the PSTN whereas others stay internal to Asterisk). How do you get usable accounting records? If there are 5 calls from different users being passed to Asterisk they will all be accounted in the same way and it is not possible to bill them separately. If anyone has any advice on what I'm missing or how to get useful accounting records in Asterisk I would appreciate it.
We are working on a generic CDR module which will aggregate CDR records for both Asterisk and openSER. It only accounts for calls based on source and destination number, so if you need something fancier than that (say path) then it won't work for you (as of yet, path basis is coming) We'll be releasing it open source when it is completed and we'll post to the list then.
Thanks
Miles