asterisk2billing.org
http://forum.asterisk2billing.org/

selecting the ratecard depending upon access no
http://forum.asterisk2billing.org/viewtopic.php?f=18&t=4763
Page 1 of 1

Author:  mushfiq [ Thu Jan 15, 2009 8:26 pm ]
Post subject:  selecting the ratecard depending upon access no

Hi all,

I want to select different rate card according to access no dialed.
Thats why i made two different rate card and attach under same call plan.
where i put DNID prefix as first 4 digits of my access no. one is 1866
other 1469 under respected rate card.
In real time when i dial the access no it dont do that after dialing destination number shows error similar like i have not created any rate for that country i am dialing.
If i put "all" in DNID prefix it goes well but always choose one rate card
no differentiation.

I could not solve this problem. so i came to get suggestion from you guys.

Rahman

Author:  stavros [ Thu Jan 15, 2009 8:29 pm ]
Post subject: 

Synchronicity strikes again.
Just five minutes ago I sent an email to Areski containing:
Quote:
There's one big one which has me really puzzled,  so I haven't touched it:  
it's the rate-engine's dnid and cid sub queries.  It seems to say:  WHERE ...
AND  0 = (expression that returns a primary key _id)

WTF?

When I've finished what I'm currently working on I'll try to remember to take a look at that. You could open a ticket too, so we don't forget about this problem.

Author:  mushfiq [ Thu Jan 15, 2009 10:12 pm ]
Post subject: 

Thanks stavros.
I posted a ticket on this in www.asterisk2billing.org/cgi-bin

I appreciate your concern on this. Is there any help
in the development part or developing a patch for this particular reason could i do for you please ask me.

Mushfiq

Author:  stavros [ Thu Jan 15, 2009 10:21 pm ]
Post subject: 

Well if you could take a look yourself, and see if you can phrase the query so it works.

The problem is on lines 124-142 of Class.RateEngine.php, or if you're using trunk lines 131-148.

Author:  asiby [ Fri Jan 16, 2009 3:31 am ]
Post subject: 

Here is a tip ... the DNID value in asterisk is not always populated as expected. I believe that that's why a2billing is working around it. You can read the following in Class.A2billing.php at lines 691~692
Code:
//$this->dnid   = $agi->request['agi_dnid'];
$this->dnid     = $agi->request['agi_extension'];


As you can see, A2Billing is using the extension instead. The problem is that when the access number sends a call to the a2billing extension, at that time, it is unfortunately not yet the time to take about rate card cause the caller will need to dial the destination number. This means that the dnidprefix will only work well if you dial the number directly from a SIP client. But if you reach the IVR and enter a number from there, then that will be way pass the time when A2Billing detects the DNID/Extension.

The feature you need should be called DIDprefix instead of DNIDPrefix

Cheers

Author:  mushfiq [ Fri Jan 30, 2009 5:25 pm ]
Post subject: 

Hello,
Sorry for late reply.
I start to work with this project again. Anyway First of all thanks to asiby
for giving some reply. DNID stands for Dialed number identification.
so in case of sip client why would it be needed to dial an access no?
but it is really something to thinkable.
To stavros i am working on phrasing those query but with no result.
Did you get chance to see it again ?as you were busy with something that time.
I thought something different .
I will create two agi-conf. one for 1866 and one for 1469 so that if anybody call 1866 a2billing.php will run following agi-conf 2.
in that case i have to declare something different in agi-conf like
owndnid=1866 and link in a2billing.php file request['owndnid']
and will identify the access no prefix now and pass it to rate engine so that it can choose that exact rate table.
But it did not work same thing around.
I was assuming just declaring two different rate table in same call plane
distinct by access no will not be helpful may be there is something to do with a2billing.conf to make two different incoming context two call agi-conf. But anyway i could be wrong and i am actually so please help to solve it .

Thanks
Mushfiq

Author:  stavros [ Fri Jan 30, 2009 5:41 pm ]
Post subject: 

mushfiq wrote:
so in case of sip client why would it be needed to dial an access no?
For SIP clients all DIDs are effectively access numbers. This is why you set 'use_dnid = YES' in order to use the number they dialled without prompting.
Quote:
Did you get chance to see it again ?as you were busy with something that time.
I'm still busy with that currently. I was very tired when I read the query involved, and now I see that the clause I was previously dubious of is necessary and correct.
Quote:
But anyway i could be wrong and i am actually so please help to solve it .
You could start by turning up A2B's debug to 3 and attach (as a .txt file, or the forum will reject it) the output of a call to each DNID here. Be sure to use search & replace to obscure your card number, password, secret, uipass, personal details, etc. We'll also need to know exactly which version you're running, and whether you're using MySQL or Postgres.

Author:  mushfiq [ Fri Jan 30, 2009 9:46 pm ]
Post subject: 

Ok this is a2billing 1.3.4

There is one another way. There is extracharge_did , extracharge_fee
But how this agi_conf will understand which acess no actually dilaed
and select this extracharge did? Thats why i thought in that way a mentioned.
Because in Class.Rateengine.php file there is one para

// if an extracharge did is called increase rates with the extracharge fee

but my question is how it will realize which access no has been called?

Author:  stavros [ Fri Jan 30, 2009 10:07 pm ]
Post subject: 

Using the Asterisk channel variable ${EXTEN}.

Author:  mushfiq [ Fri Jan 30, 2009 10:46 pm ]
Post subject: 

Hello stavros,

Just saw your reply.
Good to say that i solved it now.
Ya conception is it's not capturing the did i am calling from but the did
i am calling to.
But i am happy to figure it out.
Thanks for all of your help. Also asiby.

Have a nice day
Mushfiq

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/