Hi all,

I'm playing with OpenSIPS and prepaid accounts, and for each single sips users it's working fine.

Now i'm thinking about having another sip proxy (with our domain) that forwards all calls to my proxy with prepaid service. Reading some post on mailing list i saw that Cdrtool can work only with single sips users.

There are some way to have a prepaid service based on Source ip of signaling or domain?

Looking the CDRtool source, i think that i can place a fake account on prepaid table, and match/replace the request coming from a domain with a preg_replace php function:
Is this a good idea or not?

Here's an example about my idea:

Insert into mysql "prepaid" table something like this: [email protected]

before the sql query into rating engine that select the right account i can do something like this (writen in pseudocode):

if ( preg_match("/external-domain.tld/") ){
   $TEMP_DOMAIN_RPLC = explode("@" , $account);
   $account = "FAKE_PREPAID@". $TEMP_DOMAIN_RPLC[1];
}
..
so in this way every call coming from any [email protected] is billed in prepayed mode as [email protected] user.

It's good or bad?



Thanks in advance

Regards
Davide


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to