Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 26, 2024 9:31 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Wed Jun 09, 2010 7:46 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
We are going to resell voip services, customers will get a sip phone or client, which will act like a regular phone.

They will be assigned a DID.
They pick up the phone, dial a number, and it goes out.
Somebody calls them, their phone rings, they pick up.

I managed to get outbound calls working perfectly: when they dial, there's no longer any messages about remaining credits and/or minutes, and they aren't re-prompted for the number they dial.

Inbound calls ALMOST work right. Somebody calls the DID, the Trixbox forwards the call to a2billing, and then the person calling in is prompted for a PIN number; type it in correctly, and the sip phone rings. Alternatively, if the sip phone's account has previously included the caller id for the inbound call, then it rings straight through to the sip phone directly, no PIN required. And if the calling phone has CID disabled, then it requires the PIN anyway.

What we need, is for this to appear like a normal phone. When somebody calls my DID, my phone will just ring.

How do I set a2billing so that it just connects to the sip phone directly? There shouldn't be any other billing issues; all minutes ought to be just billed to the called sip phone, yes?


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Wed Jun 09, 2010 10:37 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
For outbound, set use_dnid = yes,

for a customer registered correctly to one of your VoIP peers configured in A2Billing, inbound calls should just work with a DID destination like sip/123456 where123456 is the a2billing account number. If using realtime, you will want rtcachefriends = yes, and provided of course you are bringing the DID into A2Billing as a DID, not as an access number.

Joe


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 2:57 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
jroper wrote:
For outbound, set use_dnid = yes,

for a customer registered correctly to one of your VoIP peers configured in A2Billing, inbound calls should just work with a DID destination like sip/123456 where123456 is the a2billing account number. If using realtime, you will want rtcachefriends = yes, and provided of course you are bringing the DID into A2Billing as a DID, not as an access number.

Joe


I don't understand. I'm looking at the Trixbox config screen for the Inbound Routes, and I'm trying to change the destination to the sip/########## from the "Custom Destinations" which is currently set to "a2billing", which is defined as "a2billing,${EXTEN},1" as was recommended here in the forums. Where and how do I enter this as a DID destination?

(For what it's worth, this current setup works well enough, so long as either 1) everybody who tries to call the user already knows the user's 10-digit PIN or 2) the user already knows everybody who is going to call them and listed them manually in the Caller ID lists.)

So my PBX is correctly passing the call along to the sip phone, more or less, but only if the user has previously gone to a lot of trouble. We just want the phone to ring!

I tried other a2billing settings: from its description it would seem that setting "cid_askpincode_ifnot_callerid = no" is what I want, so that if the CallerID didn't match the user's list, it shouldn't ask for a PIN. But it turns out that when I set that, the call just hangs up instead?

I don't mind ripping into php source code to change the behaviour, but I'm not really sure where to start. Basically I'd probably start by finding the part where if "cid_enable = yes" that it checks through the user's list of defined CallerID and looks for a match, and then just edit the script so that it matches anyway. Would this work? Any other side effects of editing that code?


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 4:04 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Is there a reason for bringing DID into A2Billing before passing it to an extension in FreePBX?

If there is, make sure you tell A2Billing that this is a DID using the correct dialplan and DID switch.


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 4:29 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
jroper wrote:
Is there a reason for bringing DID into A2Billing before passing it to an extension in FreePBX?

If there is, make sure you tell A2Billing that this is a DID using the correct dialplan and DID switch.


The inbound call is forwarded to our Asterisk server from Les.net. Somebody calls the DID, and Asterisk (Trixbox) needs to forward the call to the sip phone, which is being handled via a2billing. I can hardly draw pictures here, but it looks like this:

person1 -> phone1 -> Les.Net -> Asterisk -> a2billing -> phone2 -> person2

Somebody (person1) picks up their phone, and calls the DID, which is terminated at Les.Net. Les.Net forwards the call to my Asterisk server. My Asterisk server hands the call off to a2billing. a2billing notifies phone2 (a sip phone), it rings, and person2 answers.

EVERY ONE OF THESE PIECES WORKS FINE. person1 gets to talk to person2, and they're both happy, yes? But if the Caller ID of phone1 isn't on phone2's list, or if phone1 has a blank Caller ID, nobody gets to talk to anybody, and they're both unhappy, yes?

How do I make both of these people happy?


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 4:39 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Yes

Quote:
...and provided of course you are bringing the DID into A2Billing as a DID, not as an access number.


Quote:
If there is, make sure you tell A2Billing that this is a DID using the correct dialplan and DID switch.


I've given you the answer twice, lets try once more time.

Bring your call into A2billing as a DID, this is done by using the DID switch in the dial plan, e.g. from the examples thoughtfully provided for you by the A2Billing team, bring the call into a context like this from inbound routes:-

Code:
[a2billing-did]
exten => _.,1,DeadAgi(a2billing.php|1|did)
exten => _.,2,Hangup


note the presence of the DID switch.

Then configure a DID, and a DID destination.

Calls then come to the DID destination with no authentication required.

Joe


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 5:13 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
jroper wrote:
Yes

Quote:
...and provided of course you are bringing the DID into A2Billing as a DID, not as an access number.


Quote:
If there is, make sure you tell A2Billing that this is a DID using the correct dialplan and DID switch.


I've given you the answer twice, lets try once more time.

Bring your call into A2billing as a DID, this is done by using the DID switch in the dial plan, e.g. from the examples thoughtfully provided for you by the A2Billing team, bring the call into a context like this from inbound routes:-

Code:
[a2billing-did]
exten => _.,1,DeadAgi(a2billing.php|1|did)
exten => _.,2,Hangup


note the presence of the DID switch.

Then configure a DID, and a DID destination.

Calls then come to the DID destination with no authentication required.

Joe


My extensions_a2billing.conf has this section:

[a2billing-did]
exten => _X.,1,DeadAgi(a2billing.php|1|did)
exten => _X.,2,Hangup

My extensions_custom.conf contains:

#include extensions_a2billing.conf

I have just now gone into my Trixbox setup at Trixbox->PBX Settings->Tools->Custom Destinations and deleted the Custom "a2billing" entry which read "a2billing,${EXTEN},1" (which was exactly according to the examples I was reading) and re-created it to read "a2billing-did,${EXTEN},1" instead. I then went back to Trixbox->PBX Settings->Setup->Inbound Routes and re-edited the entry for the DID to be "a2billing" again, as the previous definition had had to be deleted and re-created.

Apparently I've made things worse for my efforts -- now, I can still make calls out, but inbound calls are immediately terminated:

-- Executing [##########@a2billing-did:1] DeadAGI("SIP/##########-########", "a2billing.php|1|did") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
-- AGI Script a2billing.php completed, returning 0

To confirm, my settings are:

; to allow outbound calls without extra prompts:
use_dnid = Yes
number_try = 1
say_balance_after_auth = No
say_timetocall = No

; to allow inbound calls
cid_enable = Yes
cid_askpincode_ifnot_callerid = Yes
callerid_authentication_over_cardnumber = Yes

I'm apparently missing some quite rather important step.


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 5:47 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Quote:
...read "a2billing,${EXTEN},1" (which was exactly according to the examples I was reading)...


This would be correct if you were using the DID as a access number for a calling card service, but in this case you are using it as a DID for onwards delivery to an endpoint.

The DID delivered by your carrier needs to match the DID you have in the DID list, and the DID destination has to be valid.


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 6:08 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
jroper wrote:
The DID delivered by your carrier needs to match the DID you have in the DID list, and the DID destination has to be valid.


For example's sake, the user id# is 1234567890, and the DID is 9876543210.

The DID is listed in a2billing at Inbound DID->Add::Search as 9876543210, with "Free". Expiry is somewhere in the year 2035. DID Group is "RES".

Under Inbound DID->Destination, currently we only have the one entry listed for user 1234567890. Under Destination it lists "SIP/1234567890". Under DID it lists "9876543210". Active/VOIP/Prior list "Active/Active/1".

User 1234567890 is logged in to the server with the sip device, and can make calls out. But inbound calls are being dropped immediately.


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 6:12 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
Turning the verbosity up and reading the logs will give you a clue as what is happening


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 6:56 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
jroper wrote:
Turning the verbosity up and reading the logs will give you a clue as what is happening


I found how to change the verbosity, I set it to 4, and found a bit more information. This forum topic appears to have my identical (current) problem, but nobody gave any clues how to resolve it:

viewtopic.php?f=21&t=5877&start=0


Attachments:
a2bout.txt [10.39 KiB]
Downloaded 627 times
Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Thu Jun 10, 2010 8:10 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
If I edit the sip user's (person2) Caller ID list to include the calling party's (person1) phone number, then the call goes straight through to the sip phone. If I edit person2's cid list to remove it, then the call gets dropped immediately.

If I edit person2's cid list to include their OWN caller id info (the same as the DID), then they can call out with no further prompts. If I edit person2's cid list so that it does NOT include their own phone number, then it asks for a pin number.

Neither of these makes sense to me.


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Fri Jun 11, 2010 2:02 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
OK then, let me rephrase my answer in the form of a question.

1) WHY does person2's own Caller ID have to be explicitly listed in order to make outgoing phone calls without prompting? HOW do I set this up so that person2 can make a phone call without being hassled by pin numbers anyway, regardless of the Caller ID list?

2) WHY does person1 have to be listed in person2's Caller ID list in order to ring straight through to the sip phone? HOW do I set this up so that person1's Caller ID does not already have to be explicitly listed?

And of course I discovered a new bug in this setup, which is that a Caller ID can ONLY be listed in ONE person's Caller ID list at a time. This means that, should it prove impossible to fix 1) and 2) above, then a brand new problem happens: We can't have two customers who both share a friend. ie. The friend can only be on one or the other's allowed calling list. Gah!


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Fri Jun 11, 2010 2:14 pm 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
The answer to 1 in respect of outbound calls , is that you have to authenticate the caller in some way. You can do this via caller ID or by setting the accountcode. I would recommend the latter in your case given your last point.

The answer to 2 is that if you bring an incoming call into into A2Billing as a DID for onwards delivery to an endpoint, then no authentication is required or necessary.

In respect of your last point, if you are identifying and authenticating a customer on the basis of caller ID, the caller ID's have to be unique, and each individual caller ID can only belong to one customer, otherwise you would not know who to bill for the call. It would be a bug if it did allow the same caller ID to be entered against multiple customers.

Joe


Top
 Profile  
 
 Post subject: Re: How to set inbound calls to need neither PIN nor Caller ID?
PostPosted: Fri Jun 11, 2010 3:37 pm 
Offline

Joined: Mon Jun 07, 2010 8:32 pm
Posts: 19
Best news I've heard all week! Everything I want to do today, a2billing can do. Awesome!

jroper wrote:
The answer to 1 in respect of outbound calls , is that you have to authenticate the caller in some way. You can do this via caller ID or by setting the accountcode. I would recommend the latter in your case given your last point.


What exactly do you mean by "set the accountcode"? The 10-digit "accountcode" slash "username" gets auto-generated for every new customer. So I guess I've got an accountcode, but nowhere to "set" it. As for "authenticate", see below.

jroper wrote:
The answer to 2 is that if you bring an incoming call into into A2Billing as a DID for onwards delivery to an endpoint, then no authentication is required or necessary.


OK, very good, except it's obviously not already working. I've set the Asterisk/Trixbox end to forward the phone call through into a2billing. I still see this in the logs:

-- Goto (a2billing-did,DDDDDDDDDD,1)
-- Executing [DDDDDDDDDD@a2billing-did:1] DeadAGI("SIP/XXXXXXXXXX-XXXXXXXX", "a2billing.php|1|did") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
-- AGI Script a2billing.php completed, returning 0

where DDDDDDDDDD is the incoming DID and the XXXX is the inbound sip trunk. cid_enable is currently set to No and cid_askpincode_ifnot_callerid is currently set to No and I don't see ANY other toggles to toggle in order to get it to ignore Caller ID on inbound calls. So I have then EXPLICITLY set the system to NOT use CID to authenticate incoming calls, and yet it STILL looks up the inbound CID before passing the call through. And calls with no CID get hung up on immediately.

Setting verbosity_level to 4 reveals only that it's failing specifically with "a2billing.php|1|did: file:Class.A2Billing.php - line:1253 - uniqueid:1276268444.29 - [A2Billing] DID call friend: AUTHENTICATION FAILS !!!"

So silly me, I manually edited the source file /usr/src/a2billing/AGI/lib/Class.A2Billing.php line 1252, changed it from "if ($this -> callingcard_ivr_authenticate($agi)!=0)" to "if (1==0)" and now inbound calls are passed through unmolested. This is obviously a bad solution, but I can't see any other way right now.

jroper wrote:
In respect of your last point, if you are identifying and authenticating a customer on the basis of caller ID, the caller ID's have to be unique, and each individual caller ID can only belong to one customer, otherwise you would not know who to bill for the call. It would be a bug if it did allow the same caller ID to be entered against multiple customers.


As for authentication and billing, a sip phone logs in to the system with the accountcode and a password. So, IMHO, it should ALREADY be authenticated to make calls out.

Inbound voip calls to a sip phone are FREE. We aren't being billed for inbound calls, and we aren't charging for inbound calls, and so there's nothing to bill.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group