SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
outraspaceOffline



Joined: Mar 08, 2008
Posts: 41

Status: Offline
Posted: Apr 10, 2008 - 10:22 AM Reply with quote Back to top
Dear all,

I am working on a customized billing engine. The reason why I am writing up one instead of using the existing package is because I have my own UI that I want to use for displaying data and registration. Also, I would like to keep a record of the among of times user spend in the different functionalities when an incoming call occurs.

I am planning to record an audit trail of any incoming/outcoming call through the use of AGI which simply puts status info and a session unique id into the DB before and after an outgoing /incoming call is made. For the incoming call, I would like to also record any forwarding call in the audit trail so users can see how many seconds they spend on listening to voice mail and how many second they spend in forwarding to an external phone.

In order to fulfill this function, is using AGI call to record the status info frequently inside the dialplan a feasible solution? Is this the right approach in developing a billing solution for Asterisk?

Thanks alot for you inputs.

Regards,
Pete
View user's profile Send private message
deanOffline
Site Admin


Joined: Dec 13, 2003
Posts: 6906
Location: London
Status: Offline
Posted: Apr 10, 2008 - 12:45 PM Reply with quote Back to top
Hi Pete,

Quote:
puts status info and a session unique id into the DB before and after an outgoing /incoming call is made.


If you want something that will scale, you probably want to consider using a queue rather than direct (blocking) DB access. ActiveMQ is an open-source option (I've heard both good and bad things about it, so a little research may be required).

Quote:
In order to fulfill this function, is using AGI call to record the status info frequently inside the dialplan a feasible solution?


I can't see why it woudln't work, but it's pretty ugly. Scalability is also an issue here, but I'm not sure what your requirements are exactly.

Quote:
Is this the right approach in developing a billing solution for Asterisk?


Asterisk is a PBX. PBX's do not generally get involved with billing, so whatever you do is unlikely to be an optimal solution. Asterisk simply wasn't designed with that in mind.

What is sitting behind Asterisk in this situation? Are you using Asterisk as a media proxy/gateway ?

You might want to consider using FreeSwitch instead. That's a proper class 5 softswitch which has an event socket you could use to get status changes, rather than having to poll an AGI periodically for current status.
View user's profile Send private message
outraspaceOffline



Joined: Mar 08, 2008
Posts: 41

Status: Offline
Posted: Apr 10, 2008 - 05:03 PM Reply with quote Back to top
Hi Dean,

I plan to use Openser to handle SIP registry. Could you tell me briefly how to write a custom billing engine? Should I do it within Asterisk using AGI or within Openser's CDR?

The part I don't understand is that if Asterisk is the part doing the routing of calling, using IVR or call forward for example, how is it possible to record billing info within Ser? Also, since Asterisk is going to determine whether to route the call to voicemail or to an external number, how would it be possible for me to do the billing within Ser instead of Asterisk?

Any advice will be greatly appreciated.
View user's profile Send private message
deanOffline
Site Admin


Joined: Dec 13, 2003
Posts: 6906
Location: London
Status: Offline
Posted: Apr 10, 2008 - 10:58 PM Reply with quote Back to top
openSER won't help for billing - it's only concerned with sigalling, not media. You need to know what's going on with the media.

Quote:
Could you tell me briefly how to write a custom billing engine?


The words "briefly" and "custom billing engine" shouldn't really appear in the same sentence Wink

Quote:
Should I do it within Asterisk using AGI or within Openser's CDR?


You haven't stated what the requirements are or what kind of network. Impossible to say without knowing that I'm afraid - see my above post for more generic comments. In particular you need to remember that Asterisk is just a PBX. It is not a switch.
View user's profile Send private message
outraspaceOffline



Joined: Mar 08, 2008
Posts: 41

Status: Offline
Posted: Apr 11, 2008 - 03:42 AM Reply with quote Back to top
Hi Dean,

Currenly, my implementation just has the Asterisk server but I am planning to extend it to include Openser for the registry purposes.

So, one box with Asterisk + webserver + DB and one box with Openser.

When a call goes into Asterisk, Asterisk will provides a voice menu and based on the user selection and key-in DTMF, the Asterisk's AGI will handle the call differently. It may go to voicemail, forward to an external number, forward to a SIP client, etc etc. So, the core decision making is done in the AGI and the other reason is because a lot of the user preferences are stored in the database such as business hour info. Business hour and non-business hour has different handling.

For this reason, I am wondering if I should just embed some status recording code in the AGI or is there a better way to log the call details?

Thanks you in advance for your suggestion and input.

Regards,
pete
View user's profile Send private message
x-consoleOffline
Site Admin


Joined: Aug 01, 2006
Posts: 1316
Location: Leeds UK
Status: Offline
Posted: Apr 11, 2008 - 09:37 AM Reply with quote Back to top
Given your topology, you can get most accuracy in your billing from creating the CDR's from within your call handling AGI scripts. This is because OpenSER will not be able to tell (with accurate timing) if a session has been torn down unless it receives a BYE that it can match to a previous INVITE/200OK transaction. Asterisk (assuming _all_ chargeable calls go via your asterisk instance, and you proxy the media) will be able to detect if/when RTP stops flowing and you can handle that accordingly.
View user's profile Send private message Yahoo Messenger


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2006 VoIP User.

No part of this site may be reproduced without our prior consent.