Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Sherwood McGowan
Tarek,

Ouch, I'm quite sorry. I couldn't sleep when I tried to around 4:30AM
after working on a project all night. Unfortunately, I'm not quite
sure what your question was...

:( Maybe when I wake up a bit more


On Thu, Oct 21, 2010 at 5:38 AM, Tarek Sawah  wrote:
>
> actually my mail was not meant to be disrespectful. it was an inquiry. i have 
> a billing system and had a few of those thoughts regarding real time billing. 
> my issue was explaining to a customer that his call disconnected an hour 
> earlier because someone else used his account.. I'm doing retail not 
> wholesale, you may understand my question more clearly now?
>
> Regards
>
>
> Tarek Sawah
>
> Information Technology Adviser
>
> Integrated Digital Systems
>
> CCNP, MCSE, RHCE, TELECOM
>
> USA: +1 386 492 9993
>
>
>
>
>
>
>
> 
>> From: sherwood.mcgo...@gmail.com
>> Date: Thu, 21 Oct 2010 05:18:17 -0500
>> To: asterisk-users@lists.digium.com
>> Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???
>>
>> Tarek,
>>
>> I'm not sure why it would be our problem is someone came into your
>> office and started making long distance calls over a trunk I was
>> providing your company I'm pretty sure that if I had tried that
>> with some of my carriers in the past they would have laughed until
>> they cried...
>>
>> Oh, and also, since this was a wholesale carrier, the customers were
>> in control of their own freeze amount. It was there to allow THEM to
>> control their account better. I'd be willing to bet that my clients
>> would have been happy to just keep billing them for every minute they
>> used.
>>
>> Lastly, I would like to just say, I'm not the guy who requested the
>> feature, I'm the guy who figured out how to make it happen, and making
>> it happen back in early 2006, when the MySQL addon was just BARELY
>> stable...
>>
>> It's ok, I don't need respect, I have the knowledge that I'm the mick,
>> and I'm awesome :P
>>
>> Cheers :D
>>
>> On Thu, Oct 21, 2010 at 4:37 AM, Tarek Sawah  wrote:
>> > If you look at it the way you want it.. you usually tell your customer the
>> > available funds and minutes in their account right?
>> > How will you explain "politely" that you have dropped their calls for lack
>> > of balance because someone else used their account?
>> > If you don't tell them their balance and call duration before call .. then
>> > that won't be a problem.
>> > Now you can do some kind of script to do the math and disconnect calls when
>> > balance is over.
>> >
>> > From: asterisk-users-boun...@lists.digium.com
>> > [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of DHAVAL
>> > INDRODIYA
>> > Sent: Thursday, October 21, 2010 9:31 AM
>> > To: Asterisk Users Mailing List - Non-Commercial Discussion
>> > Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???
>> >
>> > Hi Sherwood ,
>> >
>> > well , i think you did not understand my question , i want real time 
>> > billing
>> > like as i mentioned that if i want to dial 5 number with different call 
>> > rate
>> > how can i access same
>> > balance into those 5 people, if all are connected how can i periodically
>> > update billing , as you suggested it will assign total balance to those 5
>> > people but actually we can not do like this as total balance of user $100 ,
>> > as per your suggestion it will give $100 for those 5 people which is
>> > practically wrong i think.
>> >
>> > give your thougts.
>> >
>> > regards
>> > dhaval
>> > On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan
>> >  wrote:
>> > On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA
>> >  wrote:
>> > Hello All,
>> >
>> > after so long time i posted a new question regarding billing, hope  anyone
>> > have some solution.
>> >
>> > I have situation in that i want to do billing of more than 1 call in real
>> > time below are scenario and explanation.
>> >
>> >
>> > Scenario:
>> >  A customer called my DID number and after that from here i dial few number
>> > let say 5 number. once number are placed into DIAL
>> > i will put this customer into conference [MEETME] , once a Members are
>> > picked up call they will also patched into conferen

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Jeff LaCoursiere

[snipped very confusing top and bottom posting mix]

On Thu, 21 Oct 2010, Sherwood McGowan wrote:

> Dhaval,
> 
> You're right, I forgot one thing. The "frozen" table's id column should not
> be an autoincrement, it should be set by the insert statement, using the
> original method I decsribed for creating a unique integer from the callerid
> number and the current EPOCH. That way, you can be sure that multiple
> concurrent calls that have frozen funds will only retrieve the record they
> created. (Oh and, once you thaw the frozen funds, delete the appropriate
> record in the frozen table)
> 
> I'm not sure why you think this will only work for a single call at a time.
> Each time a call occurs that is related to an account will cause more money
> to be "frozen" from that account, thereby causing future calls to have less
> available balance and therefore less time for a call limit. This works for
> ANY number of concurrent calls on an account, and every one of those calls
> freezes funds based on the rate at which THAT call's amount to freeze was
> calculated against.
> 
> EACH call determines IT'S rate, which is then used to determine the amount
> to freeze from the account ON THAT CALL. Additionally, since the rate is
> specific to each call, the limiting of the length of THAT call, your issue
> of limiting is also a non-issue.
>

I also have worked on the logic for this scenario, and I gave up.  Our calling 
card system now locks a balance and forces the account to one simultaneous call 
at a time.  We report the maximum length of a call to the customer just 
before the ringing starts, and as someone else stated - to cut it off 
prematurely is very confusing to the customer (and one of the number one 
complaints against calling cards - if you sell in Florida it could 
actually get you in serious trouble).

The problem with each call freezing a portion of the balance is that no one 
call has access to the whole balance, and that was determined (in our case) to 
be unacceptable, and is definitely unacceptable to the calling card 
customer.

But I don't think we are talking about calling cards.  I am guessing that 
Dhaval is trying to create a termination company, and has customers that 
maintain a balance with him that want to be able to place multiple 
simultaneous calls.  A common problem.  We often end up with negative 
balances with our upstreams for this very reason - we may be near the 
bottom of our balance and several calls in progress terminate and bring us 
below zero.  I am sure this is what he is trying to avoid, as the industry 
is full of people that will simply walk away from a negative balance.

Dhaval - your wish, I think, is to manage exactly in real time to decrease the 
balance as the calls progress.  In that way all calls in progress would be 
cutoff simultaneously as the balance hit zero.  That kind of scenario would be 
very complicated with asterisk.  Some external program would have to keep track 
of the balance and the calls currently in progress, and cut them off at the 
appropriate time.  I would be very interested if anyone has attempted 
this.  I envision something that EVERY SECOND deducts from a balance for 
every call in progress, at the current rate for each call.  Not impossible 
for sure...

Cheers,

j

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Tarek Sawah

actually my mail was not meant to be disrespectful. it was an inquiry. i have a 
billing system and had a few of those thoughts regarding real time billing. my 
issue was explaining to a customer that his call disconnected an hour earlier 
because someone else used his account.. I'm doing retail not wholesale, you may 
understand my question more clearly now?

Regards


Tarek Sawah

Information Technology Adviser

Integrated Digital Systems

CCNP, MCSE, RHCE, TELECOM

USA: +1 386 492 9993








> From: sherwood.mcgo...@gmail.com
> Date: Thu, 21 Oct 2010 05:18:17 -0500
> To: asterisk-users@lists.digium.com
> Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???
>
> Tarek,
>
> I'm not sure why it would be our problem is someone came into your
> office and started making long distance calls over a trunk I was
> providing your company I'm pretty sure that if I had tried that
> with some of my carriers in the past they would have laughed until
> they cried...
>
> Oh, and also, since this was a wholesale carrier, the customers were
> in control of their own freeze amount. It was there to allow THEM to
> control their account better. I'd be willing to bet that my clients
> would have been happy to just keep billing them for every minute they
> used.
>
> Lastly, I would like to just say, I'm not the guy who requested the
> feature, I'm the guy who figured out how to make it happen, and making
> it happen back in early 2006, when the MySQL addon was just BARELY
> stable...
>
> It's ok, I don't need respect, I have the knowledge that I'm the mick,
> and I'm awesome :P
>
> Cheers :D
>
> On Thu, Oct 21, 2010 at 4:37 AM, Tarek Sawah  wrote:
> > If you look at it the way you want it.. you usually tell your customer the
> > available funds and minutes in their account right?
> > How will you explain "politely" that you have dropped their calls for lack
> > of balance because someone else used their account?
> > If you don't tell them their balance and call duration before call .. then
> > that won't be a problem.
> > Now you can do some kind of script to do the math and disconnect calls when
> > balance is over.
> >
> > From: asterisk-users-boun...@lists.digium.com
> > [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of DHAVAL
> > INDRODIYA
> > Sent: Thursday, October 21, 2010 9:31 AM
> > To: Asterisk Users Mailing List - Non-Commercial Discussion
> > Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???
> >
> > Hi Sherwood ,
> >
> > well , i think you did not understand my question , i want real time billing
> > like as i mentioned that if i want to dial 5 number with different call rate
> > how can i access same
> > balance into those 5 people, if all are connected how can i periodically
> > update billing , as you suggested it will assign total balance to those 5
> > people but actually we can not do like this as total balance of user $100 ,
> > as per your suggestion it will give $100 for those 5 people which is
> > practically wrong i think.
> >
> > give your thougts.
> >
> > regards
> > dhaval
> > On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan
> >  wrote:
> > On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA
> >  wrote:
> > Hello All,
> >
> > after so long time i posted a new question regarding billing, hope  anyone
> > have some solution.
> >
> > I have situation in that i want to do billing of more than 1 call in real
> > time below are scenario and explanation.
> >
> >
> > Scenario:
> >  A customer called my DID number and after that from here i dial few number
> > let say 5 number. once number are placed into DIAL
> > i will put this customer into conference [MEETME] , once a Members are
> > picked up call they will also patched into conference and
> > talking is started, every thing working fine with DIAL-PLAN and DB look up.
> >
> > Now, i want to do billing on customer dialed my DID, and from that actually
> > it DIALED 5 numbers, how can i DO real time billing
> > into this situation, like numbers can be different It can be ISD,STD,Local
> > and also free .
> >
> > if customer having initial balance of $100 then how can i check balance
> > every time.in a situation once balance is nil then i want to disconnect
> > calls . is any one facing this type of situation.
> >
> > give me some  idea ,
> >
> > regards
> > Dhaval
> >
> > --
> > __

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Sherwood McGowan
Tarek,

I'm not sure why it would be our problem is someone came into your
office and started making long distance calls over a trunk I was
providing your company I'm pretty sure that if I had tried that
with some of my carriers in the past they would have laughed until
they cried...

Oh, and also, since this was a wholesale carrier, the customers were
in control of their own freeze amount. It was there to allow THEM to
control their account better. I'd be willing to bet that my clients
would have been happy to just keep billing them for every minute they
used.

Lastly, I would like to just say, I'm not the guy who requested the
feature, I'm the guy who figured out how to make it happen, and making
it happen back in early 2006, when the MySQL addon was just BARELY
stable...

It's ok, I don't need respect, I have the knowledge that I'm the mick,
and I'm awesome :P

Cheers :D

On Thu, Oct 21, 2010 at 4:37 AM, Tarek Sawah  wrote:
> If you look at it the way you want it.. you usually tell your customer the
> available funds and minutes in their account right?
> How will you explain "politely" that you have dropped their calls for lack
> of balance because someone else used their account?
> If you don't tell them their balance and call duration before call .. then
> that won't be a problem.
> Now you can do some kind of script to do the math and disconnect calls when
> balance is over.
>
> From: asterisk-users-boun...@lists.digium.com
> [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of DHAVAL
> INDRODIYA
> Sent: Thursday, October 21, 2010 9:31 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???
>
> Hi Sherwood ,
>
> well , i think you did not understand my question , i want real time billing
> like as i mentioned that if i want to dial 5 number with different call rate
> how can i access same
> balance into those 5 people, if all are connected how can i periodically
> update billing , as you suggested it will assign total balance to those 5
> people but actually we can not do like this as total balance of user $100 ,
> as per your suggestion it will give $100 for those 5 people which is
> practically wrong i think.
>
> give your thougts.
>
> regards
> dhaval
> On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan
>  wrote:
> On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA
>  wrote:
> Hello All,
>
> after so long time i posted a new question regarding billing, hope  anyone
> have some solution.
>
> I have situation in that i want to do billing of more than 1 call in real
> time below are scenario and explanation.
>
>
> Scenario:
>  A customer called my DID number and after that from here i dial few number
> let say 5 number. once number are placed into DIAL
> i will put this customer into conference [MEETME] , once a Members are
> picked up call they will also patched into conference and
> talking is started, every thing working fine with DIAL-PLAN and DB look up.
>
> Now, i want to do billing on customer dialed my DID, and from that actually
> it DIALED 5 numbers, how can i DO real time billing
> into this situation, like numbers can be different It can be ISD,STD,Local
> and also free .
>
> if customer having initial balance of $100 then how can i check balance
> every time.in a situation once balance is nil then i want to disconnect
> calls . is any one facing this type of situation.
>
> give me some  idea ,
>
> regards
> Dhaval
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> Dhaval,
> This sounds very much like a system I'm working on for a client right now.
> I'm not permitted to disclose much about it due to the NDA i signed, but
> I'll risk giving you a point in the right direction.
>
> First, you should create a table in your database that has a column called
> callid, and other columns that you will have to decide upon. This table will
> be called something like 'call_references'. Oh, and you'll want to define
> callid as the primary key for records in that table, but DO NOT make it an
> autoincrement, you're going to populate it with a value that is described in
> the next step.
>
> Second, at the beginning of the original call you mentioned, define a
> variable that will be u

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Tarek Sawah
If you look at it the way you want it.. you usually tell your customer the
available funds and minutes in their account right?
How will you explain "politely" that you have dropped their calls for lack
of balance because someone else used their account?
If you don't tell them their balance and call duration before call .. then
that won't be a problem. 
Now you can do some kind of script to do the math and disconnect calls when
balance is over.

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of DHAVAL
INDRODIYA
Sent: Thursday, October 21, 2010 9:31 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Asterisk Realtime Billing Question???

Hi Sherwood ,

well , i think you did not understand my question , i want real time billing
like as i mentioned that if i want to dial 5 number with different call rate
how can i access same 
balance into those 5 people, if all are connected how can i periodically
update billing , as you suggested it will assign total balance to those 5
people but actually we can not do like this as total balance of user $100 ,
as per your suggestion it will give $100 for those 5 people which is
practically wrong i think. 

give your thougts.

regards
dhaval
On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan
 wrote:
On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA
 wrote:
Hello All,

after so long time i posted a new question regarding billing, hope  anyone
have some solution.

I have situation in that i want to do billing of more than 1 call in real
time below are scenario and explanation. 


Scenario:
 A customer called my DID number and after that from here i dial few number
let say 5 number. once number are placed into DIAL
i will put this customer into conference [MEETME] , once a Members are
picked up call they will also patched into conference and 
talking is started, every thing working fine with DIAL-PLAN and DB look up. 

Now, i want to do billing on customer dialed my DID, and from that actually
it DIALED 5 numbers, how can i DO real time billing 
into this situation, like numbers can be different It can be ISD,STD,Local
and also free .

if customer having initial balance of $100 then how can i check balance
every time.in a situation once balance is nil then i want to disconnect 
calls . is any one facing this type of situation.

give me some  idea ,

regards
Dhaval

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Dhaval,
This sounds very much like a system I'm working on for a client right now.
I'm not permitted to disclose much about it due to the NDA i signed, but
I'll risk giving you a point in the right direction. 

First, you should create a table in your database that has a column called
callid, and other columns that you will have to decide upon. This table will
be called something like 'call_references'. Oh, and you'll want to define
callid as the primary key for records in that table, but DO NOT make it an
autoincrement, you're going to populate it with a value that is described in
the next step.

Second, at the beginning of the original call you mentioned, define a
variable that will be unique to that call. I personally have done this by
stripping all non-digits from the caller's callerid (using
Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}. 

Next (this is where I have to start being a bit vague), you're going to
perform an INSERT query, creating a new call_references record (using that
variable I just showed you how to construct as callid's value). 

Now, when you defined that variable, you should have preceded the variable
name with two underscores ( __ ), which will tell Asterisk that channels
spawned by the current channel will inherit that variable and it's value. 

Voila, you now have a method for storing realtime data such as billing
information between MULTIPLE calls. 

I wish I could tell you more, but I can't violate my client's Non-Disclosure
Agreement.

Hope this helps you out!

Sherwood McGowan


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users



-- 
_

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Sherwood McGowan
On Thu, Oct 21, 2010 at 3:23 AM, DHAVAL INDRODIYA
wrote:

> thanks mate,
>
> for useful and good information provided by you, i am not asking you that
> please write down your all LOGIC and explain everything to me, as per your
> explanation i can see it will deduct amount for only 1 call but what
> actually i am searching for is if user made 5 concurrent calls and i have to
> limit
> all calls and each destination number having different rate may be some of
> them ISD and some of them local. that will create more problem to me, i
> think there is some solutions for this . could you suggest any reference for
> the same, it will be more helpful to me.
>
> thanks in advance,
> regards
> Dhaval
>
>  *snip*
>>>
>>>

>  Dhaval,
 This sounds very much like a system I'm working on for a client right
 now. I'm not permitted to disclose much about it due to the NDA i signed,
 but I'll risk giving you a point in the right direction.

 First, you should create a table in your database that has a column
 called callid, and other columns that you will have to decide upon. This
 table will be called something like '*call_references*'. Oh, and you'll
 want to define callid as the primary key for records in that table, but DO
 NOT make it an autoincrement, you're going to populate it with a value that
 is described in the next step.

 Second, at the beginning of the original call you mentioned, define a
 variable that will be unique to that call. I personally have done this by
 stripping all non-digits from the caller's callerid (using
 Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
 to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}.

 Next (this is where I have to start being a bit vague), you're going to
 perform an INSERT query, creating a new call_references record (using that
 variable I just showed you how to construct as callid's value).

 Now, when you defined that variable, you should have preceded the
 variable name with two underscores ( __ ), which will tell Asterisk that
 channels spawned by the current channel will inherit that variable and it's
 value.

 Voila, you now have a method for storing realtime data such as billing
 information between MULTIPLE calls.

 I wish I could tell you more, but I can't violate my client's
 Non-Disclosure Agreement.

 Hope this helps you out!

 Sherwood McGowan


>> Well, you got the right guy, I've written several different RT billing
>> setups for clients ranging from small residential ITSPs all the way up to a
>> wholesale carrier in Austria. . .
>>
>> What you'd have to do is have a column called "freeze" in your table that
>> you keep customer accounts and billing info in (mainly, the balance). Then,
>> you'd need a 'frozen' table, with three columns: id, accountid (or some
>> other name/reference that references the customer in question), and amount.
>>
>> Now, the "freeze" column in the account table defines how many minutes
>> worth of funds (at the rate the call is being charged to the customer)
>> you're going to make unavailable to the customer until the call is
>> completed. You multiply the value from "freeze" against the rate the call is
>> going to be charged at, resulting in "amount_to_freeze". Subtract that
>> number from the customer's current balance, and then create a record in the
>> "frozen" table with that customer's accountid and put the value of
>> amount_to_freeze into the "amount" column.
>>
>> Finally,when the customer's call(s) completes, calculate the total charge
>> for the call, check to see if it's more than `frozen`.`amount`, and if it
>> is, subtract `frozen`.`amount` from the total charge, and then subtract the
>> remaining amount from the customer's balance. If the total is *not* more
>> than than `frozen`.`amount`, you'll subtract total from `frozen`.`amount`,
>> and then ADDING the remaining amount to the customer's balance. (Being the
>> doofus I am, I called that procedure "thawing", LOL)
>>
>> In addition to the freezing of funds, you'll need to perform some magic
>> and limit the length of the customer's calls based on the balance of the
>> account just before freezing funds. This will need to be in conjunction with
>> having a maximum number of concurrent calls the customer can have, and
>> taking that into account when limiting each call.
>>
>> It sounds complicated but I wrote this type of system several times, the
>> first couple were native to Asterisk using AELv2 (no AGI calls, more secure,
>> less resources hogged, etc), and then I wrote the last one using MySQL
>> stored procedures to perform just about ALL of the calculations and logic.
>> Basically at the beginning of a call, Asterisk would execute a stored
>> procedure called something like freeze_and_limit and passing two arguments,
>> the accountid and the rate per minute their call is

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread DHAVAL INDRODIYA
thanks mate,

for useful and good information provided by you, i am not asking you that
please write down your all LOGIC and explain everything to me, as per your
explanation i can see it will deduct amount for only 1 call but what
actually i am searching for is if user made 5 concurrent calls and i have to
limit
all calls and each destination number having different rate may be some of
them ISD and some of them local. that will create more problem to me, i
think there is some solutions for this . could you suggest any reference for
the same, it will be more helpful to me.

thanks in advance,
regards
Dhaval

On Thu, Oct 21, 2010 at 12:49 PM, Sherwood McGowan <
sherwood.mcgo...@gmail.com> wrote:

>
>
> On Thu, Oct 21, 2010 at 1:30 AM, DHAVAL INDRODIYA <
> dhaval.it01...@gmail.com> wrote:
>
>> Hi Sherwood ,
>>
>> well , i think you did not understand my question , i want real time
>> billing
>> like as i mentioned that if i want to dial 5 number with different call
>> rate how can i access same
>> balance into those 5 people, if all are connected how can i periodically
>> update billing , as you suggested it will assign total balance to those 5
>> people but actually we can not do like this as total balance of user $100 ,
>> as per your suggestion it will give $100 for those 5 people which is
>> practically wrong i think.
>>
>> give your thougts.
>>
>> regards
>> dhaval
>>
>>
>> On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan <
>> sherwood.mcgo...@gmail.com> wrote:
>>
>>> On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA <
>>> dhaval.it01...@gmail.com> wrote:
>>>
 Hello All,

 after so long time i posted a new question regarding billing, hope
 anyone have some solution.

 I have situation in that i want to do billing of more than 1 call in
 real time below are scenario and explanation.


 Scenario:
  A customer called my DID number and after that from here i dial few
 number let say 5 number. once number are placed into DIAL
 i will put this customer into conference [MEETME] , once a Members are
 picked up call they will also patched into conference and
 talking is started, every thing working fine with DIAL-PLAN and DB look
 up.

 Now, i want to do billing on customer dialed my DID, and from that
 actually it DIALED 5 numbers, how can i DO real time billing
 into this situation, like numbers can be different It can be
 ISD,STD,Local and also free .

 if customer having initial balance of $100 then how can i check balance
 every time.in a situation once balance is nil then i want to disconnect

 calls . is any one facing this type of situation.

 give me some  idea ,

 regards
 Dhaval


 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

>>>
>>>
>>> Dhaval,
>>> This sounds very much like a system I'm working on for a client right
>>> now. I'm not permitted to disclose much about it due to the NDA i signed,
>>> but I'll risk giving you a point in the right direction.
>>>
>>> First, you should create a table in your database that has a column
>>> called callid, and other columns that you will have to decide upon. This
>>> table will be called something like '*call_references*'. Oh, and you'll
>>> want to define callid as the primary key for records in that table, but DO
>>> NOT make it an autoincrement, you're going to populate it with a value that
>>> is described in the next step.
>>>
>>> Second, at the beginning of the original call you mentioned, define a
>>> variable that will be unique to that call. I personally have done this by
>>> stripping all non-digits from the caller's callerid (using
>>> Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
>>> to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}.
>>>
>>> Next (this is where I have to start being a bit vague), you're going to
>>> perform an INSERT query, creating a new call_references record (using that
>>> variable I just showed you how to construct as callid's value).
>>>
>>> Now, when you defined that variable, you should have preceded the
>>> variable name with two underscores ( __ ), which will tell Asterisk that
>>> channels spawned by the current channel will inherit that variable and it's
>>> value.
>>>
>>> Voila, you now have a method for storing realtime data such as billing
>>> information between MULTIPLE calls.
>>>
>>> I wish I could tell you more, but I can't violate my client's
>>> Non-Disclosure Agreement.
>>>
>>> Hope this helps you out!
>>>
>>> Sherwood McGowan
>>>
>>>
>>> --
>>> _

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-21 Thread Sherwood McGowan
On Thu, Oct 21, 2010 at 1:30 AM, DHAVAL INDRODIYA
wrote:

> Hi Sherwood ,
>
> well , i think you did not understand my question , i want real time
> billing
> like as i mentioned that if i want to dial 5 number with different call
> rate how can i access same
> balance into those 5 people, if all are connected how can i periodically
> update billing , as you suggested it will assign total balance to those 5
> people but actually we can not do like this as total balance of user $100 ,
> as per your suggestion it will give $100 for those 5 people which is
> practically wrong i think.
>
> give your thougts.
>
> regards
> dhaval
>
>
> On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan <
> sherwood.mcgo...@gmail.com> wrote:
>
>> On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA <
>> dhaval.it01...@gmail.com> wrote:
>>
>>> Hello All,
>>>
>>> after so long time i posted a new question regarding billing, hope
>>> anyone have some solution.
>>>
>>> I have situation in that i want to do billing of more than 1 call in real
>>> time below are scenario and explanation.
>>>
>>>
>>> Scenario:
>>>  A customer called my DID number and after that from here i dial few
>>> number let say 5 number. once number are placed into DIAL
>>> i will put this customer into conference [MEETME] , once a Members are
>>> picked up call they will also patched into conference and
>>> talking is started, every thing working fine with DIAL-PLAN and DB look
>>> up.
>>>
>>> Now, i want to do billing on customer dialed my DID, and from that
>>> actually it DIALED 5 numbers, how can i DO real time billing
>>> into this situation, like numbers can be different It can be
>>> ISD,STD,Local and also free .
>>>
>>> if customer having initial balance of $100 then how can i check balance
>>> every time.in a situation once balance is nil then i want to disconnect
>>> calls . is any one facing this type of situation.
>>>
>>> give me some  idea ,
>>>
>>> regards
>>> Dhaval
>>>
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>>   http://www.asterisk.org/hello
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>
>>
>> Dhaval,
>> This sounds very much like a system I'm working on for a client right now.
>> I'm not permitted to disclose much about it due to the NDA i signed, but
>> I'll risk giving you a point in the right direction.
>>
>> First, you should create a table in your database that has a column called
>> callid, and other columns that you will have to decide upon. This table will
>> be called something like '*call_references*'. Oh, and you'll want to
>> define callid as the primary key for records in that table, but DO NOT make
>> it an autoincrement, you're going to populate it with a value that is
>> described in the next step.
>>
>> Second, at the beginning of the original call you mentioned, define a
>> variable that will be unique to that call. I personally have done this by
>> stripping all non-digits from the caller's callerid (using
>> Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
>> to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}.
>>
>> Next (this is where I have to start being a bit vague), you're going to
>> perform an INSERT query, creating a new call_references record (using that
>> variable I just showed you how to construct as callid's value).
>>
>> Now, when you defined that variable, you should have preceded the variable
>> name with two underscores ( __ ), which will tell Asterisk that channels
>> spawned by the current channel will inherit that variable and it's value.
>>
>> Voila, you now have a method for storing realtime data such as billing
>> information between MULTIPLE calls.
>>
>> I wish I could tell you more, but I can't violate my client's
>> Non-Disclosure Agreement.
>>
>> Hope this helps you out!
>>
>> Sherwood McGowan
>>
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>   http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>

Well, you got the right guy, I've written several different

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-20 Thread DHAVAL INDRODIYA
Hi Sherwood ,

well , i think you did not understand my question , i want real time billing
like as i mentioned that if i want to dial 5 number with different call rate
how can i access same
balance into those 5 people, if all are connected how can i periodically
update billing , as you suggested it will assign total balance to those 5
people but actually we can not do like this as total balance of user $100 ,
as per your suggestion it will give $100 for those 5 people which is
practically wrong i think.

give your thougts.

regards
dhaval

On Thu, Oct 21, 2010 at 11:44 AM, Sherwood McGowan <
sherwood.mcgo...@gmail.com> wrote:

> On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA <
> dhaval.it01...@gmail.com> wrote:
>
>> Hello All,
>>
>> after so long time i posted a new question regarding billing, hope  anyone
>> have some solution.
>>
>> I have situation in that i want to do billing of more than 1 call in real
>> time below are scenario and explanation.
>>
>>
>> Scenario:
>>  A customer called my DID number and after that from here i dial few
>> number let say 5 number. once number are placed into DIAL
>> i will put this customer into conference [MEETME] , once a Members are
>> picked up call they will also patched into conference and
>> talking is started, every thing working fine with DIAL-PLAN and DB look
>> up.
>>
>> Now, i want to do billing on customer dialed my DID, and from that
>> actually it DIALED 5 numbers, how can i DO real time billing
>> into this situation, like numbers can be different It can be ISD,STD,Local
>> and also free .
>>
>> if customer having initial balance of $100 then how can i check balance
>> every time.in a situation once balance is nil then i want to disconnect
>> calls . is any one facing this type of situation.
>>
>> give me some  idea ,
>>
>> regards
>> Dhaval
>>
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>   http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
> Dhaval,
> This sounds very much like a system I'm working on for a client right now.
> I'm not permitted to disclose much about it due to the NDA i signed, but
> I'll risk giving you a point in the right direction.
>
> First, you should create a table in your database that has a column called
> callid, and other columns that you will have to decide upon. This table will
> be called something like '*call_references*'. Oh, and you'll want to
> define callid as the primary key for records in that table, but DO NOT make
> it an autoincrement, you're going to populate it with a value that is
> described in the next step.
>
> Second, at the beginning of the original call you mentioned, define a
> variable that will be unique to that call. I personally have done this by
> stripping all non-digits from the caller's callerid (using
> Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
> to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}.
>
> Next (this is where I have to start being a bit vague), you're going to
> perform an INSERT query, creating a new call_references record (using that
> variable I just showed you how to construct as callid's value).
>
> Now, when you defined that variable, you should have preceded the variable
> name with two underscores ( __ ), which will tell Asterisk that channels
> spawned by the current channel will inherit that variable and it's value.
>
> Voila, you now have a method for storing realtime data such as billing
> information between MULTIPLE calls.
>
> I wish I could tell you more, but I can't violate my client's
> Non-Disclosure Agreement.
>
> Hope this helps you out!
>
> Sherwood McGowan
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-20 Thread Sherwood McGowan
On Thu, Oct 21, 2010 at 12:24 AM, DHAVAL INDRODIYA  wrote:

> Hello All,
>
> after so long time i posted a new question regarding billing, hope  anyone
> have some solution.
>
> I have situation in that i want to do billing of more than 1 call in real
> time below are scenario and explanation.
>
>
> Scenario:
>  A customer called my DID number and after that from here i dial few number
> let say 5 number. once number are placed into DIAL
> i will put this customer into conference [MEETME] , once a Members are
> picked up call they will also patched into conference and
> talking is started, every thing working fine with DIAL-PLAN and DB look up.
>
>
> Now, i want to do billing on customer dialed my DID, and from that actually
> it DIALED 5 numbers, how can i DO real time billing
> into this situation, like numbers can be different It can be ISD,STD,Local
> and also free .
>
> if customer having initial balance of $100 then how can i check balance
> every time.in a situation once balance is nil then i want to disconnect
> calls . is any one facing this type of situation.
>
> give me some  idea ,
>
> regards
> Dhaval
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>


Dhaval,
This sounds very much like a system I'm working on for a client right now.
I'm not permitted to disclose much about it due to the NDA i signed, but
I'll risk giving you a point in the right direction.

First, you should create a table in your database that has a column called
callid, and other columns that you will have to decide upon. This table will
be called something like '*call_references*'. Oh, and you'll want to define
callid as the primary key for records in that table, but DO NOT make it an
autoincrement, you're going to populate it with a value that is described in
the next step.

Second, at the beginning of the original call you mentioned, define a
variable that will be unique to that call. I personally have done this by
stripping all non-digits from the caller's callerid (using
Set(newcid=${FILTER(0123456789,${CALLERID(number)})} ), and then adding the
to ${EPOCH}. I did it this way: ${MATH(${newcid}+${EPOCH})}.

Next (this is where I have to start being a bit vague), you're going to
perform an INSERT query, creating a new call_references record (using that
variable I just showed you how to construct as callid's value).

Now, when you defined that variable, you should have preceded the variable
name with two underscores ( __ ), which will tell Asterisk that channels
spawned by the current channel will inherit that variable and it's value.

Voila, you now have a method for storing realtime data such as billing
information between MULTIPLE calls.

I wish I could tell you more, but I can't violate my client's Non-Disclosure
Agreement.

Hope this helps you out!

Sherwood McGowan
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Asterisk Realtime Billing Question???

2010-10-20 Thread Zeeshan Zakaria
Billing is a complex matter, however the CDR contains all the necessary
information. You need to carefully see how calls are recorded in the CDR
when meetme finishes, and how all the legs were connected. Usually
accountcode, dstchannel and channel columns have the required info which
tells how the calls were connected. Once you know how the calls were
connected, get each calls duration and destination and multiply them with
the destination calling cost. You can program this logic in PHP and use as a
AGI script in the hangup context of your dialplan. Its not quick and easy
task to do, but there is no quick and easy way for this purpose. Similarly
to be able to not proceed with the call if account balance is zero, you need
to check account balance before calling the meetme application.

Zeeshan A Zakaria

--
www.ilovetovoip.com

On 2010-10-21 1:32 AM, "DHAVAL INDRODIYA"  wrote:

Hello All,

after so long time i posted a new question regarding billing, hope  anyone
have some solution.

I have situation in that i want to do billing of more than 1 call in real
time below are scenario and explanation.


Scenario:
 A customer called my DID number and after that from here i dial few number
let say 5 number. once number are placed into DIAL
i will put this customer into conference [MEETME] , once a Members are
picked up call they will also patched into conference and
talking is started, every thing working fine with DIAL-PLAN and DB look up.

Now, i want to do billing on customer dialed my DID, and from that actually
it DIALED 5 numbers, how can i DO real time billing
into this situation, like numbers can be different It can be ISD,STD,Local
and also free .

if customer having initial balance of $100 then how can i check balance
every time.in a situation once balance is nil then i want to disconnect
calls . is any one facing this type of situation.

give me some  idea ,

regards
Dhaval


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Asterisk Realtime Billing Question???

2010-10-20 Thread DHAVAL INDRODIYA
Hello All,

after so long time i posted a new question regarding billing, hope  anyone
have some solution.

I have situation in that i want to do billing of more than 1 call in real
time below are scenario and explanation.


Scenario:
 A customer called my DID number and after that from here i dial few number
let say 5 number. once number are placed into DIAL
i will put this customer into conference [MEETME] , once a Members are
picked up call they will also patched into conference and
talking is started, every thing working fine with DIAL-PLAN and DB look up.

Now, i want to do billing on customer dialed my DID, and from that actually
it DIALED 5 numbers, how can i DO real time billing
into this situation, like numbers can be different It can be ISD,STD,Local
and also free .

if customer having initial balance of $100 then how can i check balance
every time.in a situation once balance is nil then i want to disconnect
calls . is any one facing this type of situation.

give me some  idea ,

regards
Dhaval
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users