Open Source Training Seminar FreePBX Paid Support

Ticket #1968 (new Patches)

Opened 1 year ago

Last modified 11 months ago

Integrating A2Billing Long Distance with FreePBX WITH CALLERID!

Reported by: cyberglobe Assigned to: RobThomas
Priority: minor Milestone:
Component: Core - Trunks/Routing Version: 2.2.1
Keywords: Cc:
Confirmation: Confirmed SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

Ok I think I have fixed it.

Here is what I have done to fix up A2Billing and FreePBX to work together via the macro-dialout-trunk so that you can create custom trunks for a2billing pass-thru.

1: Goto FreePBX, Setup, Trunks, Create Custom Trunk.

2: In the Custom Trunk String enter without the quotes "A2B/$OUTNUM$"

3: Save it and you will see a new route called 2B/$OUTNUM$ it is fine just a glitch with FreePBX.

3: Goto Outbound Routes, Create or Modify your Long Distance route and point it to AMP:A2B/$OUTNUM$

4: Now Edit Extensions.conf and look for macro-dialout-trunk and find the line called

exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS})

Replace that line with the code below (which will preserve the original line so you know what you changed)

; Modified to support outbound calling for A2B
; original line: exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS})
; added function
exten => s,n(skipoutnum),GotoIf($["${pre_num}" = "AMP:A2B/"]?a2bdial:skipoutnumnormal) ; Checks for A2B custom trunk and dials it.
exten => s,n(a2bdial),DeadAGI(a2billing.php|1) ; Dials out via the a2billing.php script.
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(skipoutnumnormal),Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS})
; end of modified additions

5: Save extensions.conf

6: We now need to edit a2billing.conf. Goto the agi-conf1 or which agi-conf# you will be using and find use_dnid=

add the following code below it.

; if YES then it will use the AGI_DNID instead of AGI_Extension for supporting dialout.
switch_extension_for_dnid=YES

7: save a2billing.conf

8: Goto your Asterisk CLI and issue a reload request.

9: Now we are done with FreePBX.

10: goto /var/lib/asterisk/agi-bin and edit a2billing.php

11: look for a line that says

$A2B->dnid = $agi->request['agi_extension'];

Replace that line with the following line (No worries, I placed that line into the code for preservation.

					// Added check for agi_extension or agi_dnid for dialout number
					// original line replaced was:
					// $A2B->dnid = $agi->request['agi_extension'];
					//
					if ($A2B->agiconfig['switch_extension_for_dnid']==1)
						$A2B->dnid = $agi->request['agi_dnid'];
						else
						$A2B->dnid = $agi->request['agi_extension'];
					// End of modifications

11: Save a2billing.php

12: now pick up your phone and try dialing. It will now go though A2billing for accounting purposes.

Change History

(follow-up: ↓ 2 ) 09/13/07 19:10:33 changed by e.robles

I have successfully implemented the patch, BUT there is an open issue: the custom trunk created does not applies the Dial Rules anymore. It simply sends out all the dialed digits from the extension, including the Trunk Route prefix. This blocks the possibility to add/delete digits for proper translation before sending them out to a2billing.

Any hints on that?

(in reply to: ↑ 1 ) 11/01/07 10:35:58 changed by cyberglobe

Replying to e.robles:

I have successfully implemented the patch, BUT there is an open issue: the custom trunk created does not applies the Dial Rules anymore. It simply sends out all the dialed digits from the extension, including the Trunk Route prefix. This blocks the possibility to add/delete digits for proper translation before sending them out to a2billing. Any hints on that?

Make sure you set your outbound route at the bottom of your list to ensure your previous rules are taken into account first.

11/01/07 13:34:08 changed by cyberglobe

Now I understand what you are saying. At this point, A2Billing would have to handle the additions and removals of your codes. However if you can't have A2Biling to handle it, then I could try to work out something in the meantime. Would need to run a preprocessor to manage the call parameters first.

11/13/07 13:07:02 changed by p_lindheimer

  • confirmation set to Unreviewed.
  • component changed from - choose - to Core - Trunks/Routing.
  • milestone deleted.

11/13/07 13:07:29 changed by p_lindheimer

  • confirmation changed from Unreviewed to Confirmed.
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads