Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Sat Apr 27, 2024 9:22 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: dialout with ring group with no authentication
PostPosted: Mon Jun 06, 2011 3:02 am 
Offline

Joined: Mon Jun 06, 2011 2:58 am
Posts: 4
Heres what I am trying to do:

1) Call comes in and person selects extention.
2) Ring group is called
3) Cell phone number is dialed out on custom a2b trunk.

How do I make it so that this dialed out number is attached to a customer without any authentication.

Is there a way to pass the authentication instructions in the custom trunk properties?

Thanks in advance.
Christopher
WootSystems.com


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Mon Jun 06, 2011 7:30 am 
Offline

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

There is an accountcodepreserve authentication module for FreePBX available from us, which allows you to authenticate on accountcode, but that only works when a DID is attached to a FreePBX extension.

To forward calls to a ring group, you would have to manually set the A2Billing account to use, and the easiest way to do this is set the forwarding number in the ring group as accountcode-to-use-plus-telephone-number-to call, then before passing the call to A2Billing, strip of the accountcode, and set it with the cdr(accountcode) function, and send the remaining digits into A2Billing with use _dnid = yes.

Joe


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Mon Jun 06, 2011 5:50 pm 
Offline

Joined: Mon Jun 06, 2011 2:58 am
Posts: 4
I decided to try this way instead but its not working.. any advice?


extensions_custom.conf:

[ringgroupout-custom]
;exten => _X.,1,Answer
exten => _X.,1,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php,3)
exten => _X.,n,Hangup


[ringgroupsettaylor-custom]
exten => 5555,1,Answer
exten => 5555,n,Set(CDR(accountcode)=1316545316)
exten => 5555,n,Noop(ACCOUNTCODE=${ACCOUNTCODE})
exten => 5555,n,Goto(ringgroupout-custom,15192394312,1)



ASTERISK OUTPUT:

-- Executing [5555@from-internal:1] ResetCDR("SIP/601-00000001", "") in new stack
-- Executing [5555@from-internal:2] NoCDR("SIP/601-00000001", "") in new st ack
-- Executing [5555@from-internal:3] Progress("SIP/601-00000001", "") in new stack
-- Executing [5555@from-internal:4] Wait("SIP/601-00000001", "1") in new st ack
-- Executing [5555@from-internal:5] Progress("SIP/601-00000001", "") in new stack
-- Executing [5555@from-internal:6] Playback("SIP/601-00000001", "silence/1 &cannot-complete-as-dialed&check-number-dial-again,noanswer") in new stack
-- <SIP/601-00000001> Playing 'silence/1.ulaw' (language 'en')
-- <SIP/601-00000001> Playing 'cannot-complete-as-dialed.ulaw' (language 'e n')
-- <SIP/601-00000001> Playing 'check-number-dial-again.ulaw' (language 'en' )
-- Executing [5555@from-internal:7] Wait("SIP/601-00000001", "1") in new st ack
-- Executing [5555@from-internal:8] Congestion("SIP/601-00000001", "20") in new stack
== Spawn extension (from-internal, 5555, 8) exited non-zero on 'SIP/601-00000 001'
-- Executing [h@from-internal:1] Hangup("SIP/601-00000001", "") in new stac k
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/601-00000001 '


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Mon Jun 06, 2011 5:54 pm 
Offline

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

5555 does not exist in your from-internal context.

Include [ringgroupsettaylor-custom] in the from internal context, or more simply paste the following at the very top of extensions_customs.conf

Code:
exten => 5555,1,Answer
exten => 5555,n,Set(CDR(accountcode)=1316545316)
exten => 5555,n,Noop(ACCOUNTCODE=${ACCOUNTCODE})
exten => 5555,n,Goto(ringgroupout-custom,15192394312,1)


Joe


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Mon Jun 06, 2011 5:58 pm 
Offline

Joined: Mon Jun 06, 2011 2:58 am
Posts: 4
gotcha! lol been playing with asterisk for years but never done any custom stuff.

Thanks!


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Tue Jun 07, 2011 5:59 pm 
Offline

Joined: Mon Jun 06, 2011 2:58 am
Posts: 4
Heres my config. Maybe it will help someone else out.

extensions_custom.conf:


[macro-dialout-trunk-predial-hook]
exten => s,1,Noop(${CHANNEL})
exten => s,2,Noop(${CHANNEL:6:2})
exten => s,3,GotoIf($["${CHANNEL:6:2}" = "54"]?2485530119accountcode,${OUTNUM},1)
exten => s,4,GotoIf($["${CHANNEL:6:2}" = "55"]?1316545316accountcode,${OUTNUM},1)
exten => s,5,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,6,MacroExit

[1316545316accountcode]
exten => _X.,1,Answer
exten => _X.,n,Set(CDR(accountcode)=1316545316)
exten => _X.,n,Set(CALLERID(num)=${REALCALLERIDNUM})
exten => _X.,n,Goto(a2bagicall3,${EXTEN},1)

[2485530119accountcode]
exten => _X.,1,Answer
exten => _X.,n,Noop(ACCOUNT CODE 2485530119 SELECTED)
exten => _X.,n,Set(CDR(accountcode)=2485530119)
exten => _X.,n,Set(CALLERID(num)=${REALCALLERIDNUM})
exten => _X.,n,Goto(a2bagicall3,${EXTEN},1)

[custom-freepbx-a2billing]
exten => _X.,1,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()

[a2bagicall3]
exten => _X.,1,DeadAGI(a2billing.php,3)
exten => _X.,n,Hangup



Then I created a trunk with A2B/3 with outbound routes 55 and 54 prefixes.
Then in the Ring Group I added 55 + the number + #

In A2Billing I created a rate for the cell phone number in the ring group and applied no caller ID so that RG calls keep the CID of the incomming route.


Hope this helps someone else out. I spend hours on this thing lol.


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Thu Aug 04, 2011 11:57 am 
Offline

Joined: Thu Feb 17, 2011 10:26 pm
Posts: 6
We needed to do this purely via the FreePBX interface (ie no console access after initial config).

Whilst it could be construed as being insecure the A2Billing account number codes are 10 digit randomly generated numbers.

Previous A2Billing Extension config:
Quote:
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,n,MacroExit


New A2Billing Extension config:
Quote:
[macro-dialout-trunk-predial-hook]
exten => s,1,Noop(Evaluating Channel for possible accountcode override: ${CHANNEL})
exten => s,2,Set(CDR(accountcode)=${IF($["${CHANNEL:16:1}" = "*"]?${OUTNUM:0:10}:${CDR(accountcode)})})
exten => s,3,Set(OUTNUM=${IF($["${CHANNEL:16:1}" = "*"]?${OUTNUM:11}:${OUTNUM})})
exten => s,4,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,n,MacroExit


Then add an outbound route for XXXXXXXXXX*X. to send it to A2B and then prefix the intended forwarding numbers with the required account code.

eg: A Follow Me to 277847224 would become 3939058358*277847224#
<accountcode>*<number in international format>#

PS: The number would need to be in whatever format A2Billing will identify a route for it as... Our A2Billing rates are all standardised in full E164.


Top
 Profile  
 
 Post subject: Re: dialout with ring group with no authentication
PostPosted: Fri Sep 16, 2011 3:24 am 
Offline

Joined: Sun Dec 27, 2009 8:39 pm
Posts: 80
I'm trying to get this to work, as we have a few directly connected users with ATA's that want followme, etc. The only issue I see with this, is that the user managing this is nearly impossible. Asking them to always put in their account code with an * is a bit much. I imagine there needs to be a simpler way of doing a dblookup and pulling the account code to match the account holder for the DID...

I was trying this out to see if it would work with Follow-me, but I'm getting an Authentication Failed message.
Code:
    -- Executing [s@macro-dialout-trunk-predial-hook:1] NoOp("Local/1111111111*13055551234@from-internal-4d46;2", "Evaluating Channel for possible accountcode override: Local/1111111111*13055551234@from-internal-4d46;2") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:2] Set("Local/1111111111*13055551234@from-internal-4d46;2", "CDR(accountcode)=1111111111") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:3] Set("Local/1111111111*13055551234@from-internal-4d46;2", "OUTNUM=15551234567") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:4] GotoIf("Local/1111111111*13055551234@from-internal-4d46;2", "1?custom-freepbx-a2billing,13055551234,1:2") in new stack
    -- Goto (custom-freepbx-a2billing,13055551234,1)
  == Channel 'Local/1111111111*13055551234@from-internal-4d46;2' jumping out of macro 'dialout-trunk-predial-hook'
  == Channel 'Local/1111111111*13055551234@from-internal-4d46;2' jumping out of macro 'dialout-trunk'
    -- Executing [13055551234@custom-freepbx-a2billing:1] DeadAGI("Local/1111111111*13055551234@from-internal-4d46;2", "a2billing.php,1") in new stack
[2011-09-15 23:50:55] WARNING[11377]: res_agi.c:3924 deadagi_exec: DeadAGI has been deprecated, please use AGI in all cases!
    -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php,1: file:a2billing.php - line:106 - uniqueid: - IDCONFIG : 1
a2billing.php,1: file:a2billing.php - line:107 - uniqueid: - MODE : standard
a2billing.php,1: file:Class.A2Billing.php - line:718 - uniqueid:1316145055.239 -  get_agi_request_parameter = 5551234567 ; Local/1111111111*13055551234@from-internal-4d46;2 ; 1316145055.239 ; 1111111111 ; 13055551234
a2billing.php,1: file:a2billing.php - line:166 - uniqueid:1316145055.239 - [NO ANSWER CALL]
a2billing.php,1: file:a2billing.php - line:623 - uniqueid:1316145055.239 - [AUTHENTICATION FAILED (cia_res:-2)]
    -- <Local/1111111111*13055551234@from-internal-4d46;2>AGI Script a2billing.php completed, returning 4
  == Spawn extension (custom-freepbx-a2billing, 13055551234, 1) exited non-zero on 'Local/1111111111*13055551234@from-internal-4d46;2'
  == Everyone is busy/congested at this time (1:0/0/1)


The logic would change a bit, since then we would need to see if we already have an account code before looking one up.

Anyone already done this or something similar? I'm thinking if the original dnid is available we can look up in cc_did and get the account code...

TIA,

Carlos


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 
Auto Dialer Software


All times are UTC


Who is online

Users browsing this forum: No registered users and 74 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