Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Jan 29, 2020 4:19 am
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Sat Dec 19, 2009 2:21 am 
Offline

Joined: Sat Jul 25, 2009 8:03 pm
Posts: 45
Hello there,

I'm wondering how I could pass the outbound CID field from an extension defined in ASTERISK to the CallerID field of the A2B engine through a custom context.

The reason I am not using the SIP/IAX friend feature is because the extensions created that way have no voicemail entries and can't call other internal extensions like those generated by asterisk do perfectly.

The contents of my context is like this:

[a2billing-box]
include => from-internal-custom
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|2)
exten => _X.,n,Hangup

I captured an image of my elastix WebUI with the extension I want to route to the A2B engine (7006). The context works but the caller ID is set to '7006' instead of '3053567631' as I desire.

Any ideas?

Thank you.

Paul


Attachments:
ext-7006.jpg
ext-7006.jpg [ 42.89 KiB | Viewed 5413 times ]
Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Sat Dec 19, 2009 8:30 am 
Offline

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

Look at Stavros' post here - viewtopic.php?f=4&t=2127&start=30 to get extensions from FreePBX to go out via A2Billing.

I'd set the caller ID as just the number.

Joe


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Sun Dec 20, 2009 7:33 am 
Offline

Joined: Sat Jul 25, 2009 8:03 pm
Posts: 45
Thank you very much Joe,

With your instructions, I could finally pass the CallerID to the A2B's agi-conf I want to use. Thanks a lot!

However, I have another problem. Through my regular trunks I have set certain dialrules before passing the dialed number to the trunk. Apparently, the code you sent is _not_ doing it. For instance, I did this to avoid customers dialing 1 to call numbers in USA: 1+NXXXXXXXXX

That way if you dial 3054447800 what is going to be passed to the trunk is 13054447800

This works fine with the normal trunks but for the custom trunk I created for A2B the '1' is not being passed along with the number. Same with numbers from Ecuador, some of my customers dial ecuadorian numbers like if they were there (in a few words, no 011+593+areacode+number but just number)

Is there a workaround for that?

Thank you again.

Paul


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Sun Dec 20, 2009 10:29 am 
Offline

Joined: Fri Jun 23, 2006 3:56 pm
Posts: 4065
This should work if you put a dial rule in the A2B/X trunk.


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Sun Dec 20, 2009 4:47 pm 
Offline

Joined: Sat Jul 25, 2009 8:03 pm
Posts: 45
Hi Joe,

It should but it doesn't do it. I've debugged the AGI configurations and I see that A2B is not using as DNID the 1 + NXXXXXXXXX number but the number -without- the 1.

I tried dialing 3057781080 and it had to be passed as 13057781080


Here's the A2Billing Debug for AGI-CONF 4
0
-- AGI Script fixlocalprefix completed, returning 0
-- Executing [[email protected]:13] Set("SIP/7006-b6310878", "OUTNUM=130
57781080") in new stack
-- Executing [[email protected]:14] Set("SIP/7006-b6310878", "custom=AM"
) in new stack
-- Executing [[email protected]:15] ExecIf("SIP/7006-b6310878", "1|Set|D
IAL_TRUNK_OPTIONS=M(setmusic^christmas)t") in new stack
-- Executing [[email protected]:16] Macro("SIP/7006-b6310878", "dialout-
trunk-predial-hook|") in new stack
-- Executing [[email protected]:1] GotoIf("SIP/7006-b631087
8", "1?custom-freepbx-a2billing|13057781080|1:2") in new stack
-- Goto (custom-freepbx-a2billing,13057781080,1)
== Channel 'SIP/7006-b6310878' jumping out of macro 'dialout-trunk-predial-hoo
k'
== Channel 'SIP/7006-b6310878' jumping out of macro 'dialout-trunk'
-- Executing [[email protected]:1] DeadAGI("SIP/7006-b631
0878", "a2billing.php|4") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|4: file:Class.A2Billing.php - line:594 - uniqueid: - A2Billing A
GI internal configuration: ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:595 - uniqueid: - Array
a2billing.php|4: (
a2billing.php|4: [callerid_update] => 0
a2billing.php|4: [dialcommand_param_call_2did] => |60|HiL(%timeout%:61000:
30000)
a2billing.php|4: [description] => agi-config
a2billing.php|4: [asterisk_version] => 1_4
a2billing.php|4: [answer_call] => 1
a2billing.php|4: [play_audio] => 1
a2billing.php|4: [say_goodbye] => 1
a2billing.php|4: [play_menulanguage] => 0
a2billing.php|4: [force_language] =>
a2billing.php|4: [intro_prompt] =>
a2billing.php|4: [min_credit_2call] => 0.25
a2billing.php|4: [min_duration_2bill] => 6
a2billing.php|4: [notenoughcredit_cardnumber] => 0
a2billing.php|4: [notenoughcredit_assign_newcardnumber_cid] => 0
a2billing.php|4: [use_dnid] => 1
a2billing.php|4: [no_auth_dnid] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 2400
a2billing.php|4: [1] => 2300
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [number_try] => 10
a2billing.php|4: [force_callplan_id] =>
a2billing.php|4: [say_balance_after_auth] => 0
a2billing.php|4: [say_balance_after_call] => 0
a2billing.php|4: [say_rateinitial] => 0
a2billing.php|4: [say_timetocall] => 0
a2billing.php|4: [auto_setcallerid] => 1
a2billing.php|4: [force_callerid] =>
a2billing.php|4: [cid_sanitize] => NO
a2billing.php|4: [cid_enable] => 1
a2billing.php|4: [cid_askpincode_ifnot_callerid] => 0
a2billing.php|4: [failover_lc_prefix] => 0
a2billing.php|4: [cid_auto_assign_card_to_cid] => 0
a2billing.php|4: [callerid_authentication_over_cardnumber] => 0
a2billing.php|4: [sip_iax_friends] => 0
a2billing.php|4: [sip_iax_pstn_direct_call_prefix] => 22
a2billing.php|4: [sip_iax_pstn_direct_call] => 0
a2billing.php|4: [ivr_voucher] => 0
a2billing.php|4: [ivr_voucher_prefix] => 8
a2billing.php|4: [jump_voucher_if_min_credit] => 0
a2billing.php|4: [dialcommand_param] => |60|HRrL(%timeout%:61000:30000)
a2billing.php|4: [dialcommand_param_sipiax_friend] => |60|HiL(3600000:6100
0:30000)
a2billing.php|4: [switchdialcommand] => 0
a2billing.php|4: [failover_recursive_limit] => 2
a2billing.php|4: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|4: [send_reminder] => 0
a2billing.php|4: [record_call] => 0
a2billing.php|4: [monitor_formatfile] => gsm
a2billing.php|4: [agi_force_currency] =>
a2billing.php|4: [currency_association] => Array
a2billing.php|4: (
a2billing.php|4: [0] => usd:dollars
a2billing.php|4: [1] => mxn:pesos
a2billing.php|4: [2] => eur:euros
a2billing.php|4: [3] => all:credit
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [local_dialing_addcountryprefix] => 0
a2billing.php|4: [max_call_call_2_did] => 3600
a2billing.php|4: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|4: [conf_order_menulang] => en:fr:es
a2billing.php|4: [callback_bill_1stleg_ifcall_notconnected] => 1
a2billing.php|4: [international_prefixes] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 011
a2billing.php|4: [1] => 00
a2billing.php|4: [2] => 09
a2billing.php|4: [3] => 1
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [extracharge_did] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 1800
a2billing.php|4: [1] => 1866
a2billing.php|4: [2] => 1877
a2billing.php|4: [3] => 1888
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [extracharge_fee] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 0.06
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [extracharge_buyfee] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 0
a2billing.php|4: [1] => 0
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [maxtime_tounlimited_calls] => 5400
a2billing.php|4: [maxtime_tofree_calls] => 5400
a2billing.php|4: [callplan_deck_minute_threshold] =>
a2billing.php|4: [disable_announcement_seconds] => 0
a2billing.php|4: [verbosity_level] => 4
a2billing.php|4: [logging_level] => 3
a2billing.php|4: [dial_balance_reservation] => 0.25
a2billing.php|4: [cid_auto_create_card] => 0
a2billing.php|4: [cid_auto_create_card_len] => 10
a2billing.php|4: [cid_auto_create_card_typepaid] => PREPAID
a2billing.php|4: [cid_auto_create_card_credit] => 0
a2billing.php|4: [cid_auto_create_card_credit_limit] => 0
a2billing.php|4: [cid_auto_create_card_tariffgroup] => 1
a2billing.php|4: [logger_enable] => 1
a2billing.php|4: [log_file] => /var/log/a2billing/a2billing.log
a2billing.php|4: [currency_association_internal] => Array
a2billing.php|4: (
a2billing.php|4: [usd] => dollars
a2billing.php|4: [mxn] => pesos
a2billing.php|4: [eur] => euros
a2billing.php|4: [all] => credit
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: [file_conf_enter_menulang] => prepaid-menulang
a2billing.php|4: [ivr_voucher_prefixe] => 8
a2billing.php|4: [cheat_on_announcement_time] => 0
a2billing.php|4: )
a2billing.php|4: ::> 4
a2billing.php|4: file:a2billing.php - line:102 - uniqueid: - IDCONFIG : 4 ::>
3
a2billing.php|4: file:a2billing.php - line:103 - uniqueid: - MODE : standard :
:> 3
a2billing.php|4: file:a2billing.php - line:120 - uniqueid: - AGI Request:
a2billing.php|4: Array
a2billing.php|4: (
a2billing.php|4: [agi_request] => a2billing.php
a2billing.php|4: [agi_channel] => SIP/7006-b6310878
a2billing.php|4: [agi_language] => es
a2billing.php|4: [agi_type] => SIP
a2billing.php|4: [agi_uniqueid] => 1261326643.1723
a2billing.php|4: [agi_callerid] => 3053567631
a2billing.php|4: [agi_calleridname] => unknown
a2billing.php|4: [agi_callingpres] => 0
a2billing.php|4: [agi_callingani2] => 0
a2billing.php|4: [agi_callington] => 0
a2billing.php|4: [agi_callingtns] => 0
a2billing.php|4: [agi_dnid] => 3057781080
a2billing.php|4: [agi_rdnis] => unknown
a2billing.php|4: [agi_context] => custom-freepbx-a2billing
a2billing.php|4: [agi_extension] => 13057781080
a2billing.php|4: [agi_priority] => 1
a2billing.php|4: [agi_enhanced] => 0.0
a2billing.php|4: [agi_accountcode] => 2499219172
a2billing.php|4: )
a2billing.php|4: ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:708 - uniqueid:1261326643.172
3 - get_agi_request_parameter = 3053567631 ; SIP/7006-b6310878 ; 1261326643.172
3 ; 2499219172 ; 13057781080 ::> 3
a2billing.php|4: file:a2billing.php - line:157 - uniqueid:1261326643.1723 - [A
NSWER CALL] ::> 3
a2billing.php|4: file:Class.A2Billing.php - line:2340 - uniqueid:1261326643.17
23 - [CID_ENABLE - CID_CONTROL - CID:3053567631] ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:2355 - uniqueid:1261326643.17
23 - Array
a2billing.php|4: (
a2billing.php|4: [0] => Array
a2billing.php|4: (
a2billing.php|4: [0] => 3053567631
a2billing.php|4: [cid] => 3053567631
a2billing.php|4: [1] => 3
a2billing.php|4: [id_cc_card] => 3
a2billing.php|4: [2] => t
a2billing.php|4: [activated] => t
a2billing.php|4: [3] => 27.64216
a2billing.php|4: [credit] => 27.64216
a2billing.php|4: [4] => 1
a2billing.php|4: [tariff] => 1
a2billing.php|4: [5] => t
a2billing.php|4: [6] => 0
a2billing.php|4: [inuse] => 0
a2billing.php|4: [7] => 0
a2billing.php|4: [simultaccess] => 0
a2billing.php|4: [8] => 0
a2billing.php|4: [typepaid] => 0
a2billing.php|4: [9] => 500
a2billing.php|4: [creditlimit] => 500
a2billing.php|4: [10] => fr
a2billing.php|4: [language] => fr
a2billing.php|4: [11] => 2499219172
a2billing.php|4: [username] => 2499219172
a2billing.php|4: [12] => 0
a2billing.php|4: [removeinterprefix] => 0
a2billing.php|4: [13] => 3057781080
a2billing.php|4: [redial] => 3057781080
a2billing.php|4: [14] => 0
a2billing.php|4: [enableexpire] => 0
a2billing.php|4: [15] => 1558077737
a2billing.php|4: [UNIX_TIMESTAMP(expirationdate)] => 1558077737
a2billing.php|4: [16] => 0
a2billing.php|4: [expiredays] => 0
a2billing.php|4: [17] => 167
a2billing.php|4: [nbused] => 167
a2billing.php|4: [18] => 1246318456
a2billing.php|4: [UNIX_TIMESTAMP(firstusedate)] => 1246318456
a2billing.php|4: [19] => 1242545229
a2billing.php|4: [UNIX_TIMESTAMP(cc_card.creationdate)] => 1242545
229
a2billing.php|4: [20] => USD
a2billing.php|4: [currency] => USD
a2billing.php|4: [21] => FABRE
a2billing.php|4: [lastname] => FABRE
a2billing.php|4: [22] => PAUL
a2billing.php|4: [firstname] => PAUL
a2billing.php|4: [23] => [email protected]
a2billing.php|4: [email] => [email protected]
a2billing.php|4: [24] => 7878
a2billing.php|4: [uipass] => 7878
a2billing.php|4: [25] => -1
a2billing.php|4: [id_campaign] => -1
a2billing.php|4: [26] => 3
a2billing.php|4: [id] => 3
a2billing.php|4: [27] => 3057781080
a2billing.php|4: [useralias] => 3057781080
a2billing.php|4: [28] => 1
a2billing.php|4: [status] => 1
a2billing.php|4: [29] => 0
a2billing.php|4: [voicemail_permitted] => 0
a2billing.php|4: [30] => 0
a2billing.php|4: [voicemail_activated] => 0
a2billing.php|4: [31] => 0
a2billing.php|4: [restriction] => 0
a2billing.php|4: [32] => 1
a2billing.php|4: [countryprefix] => 1
a2billing.php|4: )
a2billing.php|4:
a2billing.php|4: )
a2billing.php|4: ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:2550 - uniqueid:1261326643.17
23 - - Account code - 2499219172 ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:740 - uniqueid:1261326643.172
3 - [CARD STATUS UPDATE] ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:749 - uniqueid:1261326643.172
3 - [QUERY USING CARD UPDATE::> UPDATE cc_card SET inuse=inuse+1, credit=credit-
0.25 WHERE username='2499219172'] ::> 4
a2billing.php|4: file:a2billing.php - line:173 - uniqueid:1261326643.1723 - [T
RY : callingcard_ivr_authenticate] ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:2237 - uniqueid:1261326643.17
23 - [AUTO SetCallerID] ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:2243 - uniqueid:1261326643.17
23 - [REQUESTED SetCallerID : 3053567631] ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:2255 - uniqueid:1261326643.17
23 - [EXEC SetCallerID : 3053567631] ::> 4
a2billing.php|4: file:a2billing.php - line:188 - uniqueid:1261326643.1723 - [C
HANNEL STATUS : 6 = Line is up]
a2billing.php|4: [CREDIT : 27.64216][CREDIT MIN_CREDIT_2CALL : 0.25] ::> 3
a2billing.php|4: file:a2billing.php - line:217 - uniqueid:1261326643.1723 - TA
RIFF ID -> 1 ::> 3
a2billing.php|4: file:Class.A2Billing.php - line:798 - uniqueid:1261326643.172
3 - 1 && && 10&& 0 ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:864 - uniqueid:1261326643.172
3 - SELECT cc_did.id,iduser FROM cc_did, cc_card WHERE cc_card.status=1 and cc
_card.id=iduser and cc_did.activated=1 and did='3057781080' AND cc_did.startin
gdate<= CURRENT_TIMESTAMP AND (cc_did.expirationdate > CURRENT_TIMESTAMP OR cc_d
id.expirationdate IS NULL OR cc_did.expirationdate = '0000-00-00 00:00:00') ::>
4
a2billing.php|4: file:Class.A2Billing.php - line:870 - uniqueid:1261326643.172
3 - DESTINATION ::> 3057781080 ::> 3
a2billing.php|4: file:Class.A2Billing.php - line:877 - uniqueid:1261326643.172
3 - RULES APPLY ON DESTINATION ::> 3057781080 ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:3380 - uniqueid:1261326643.17
23 - [SAVING DESTINATION FOR REDIAL: SQL: UPDATE cc_card SET redial = '305778108
0' WHERE username='2499219172']:[result: 1] ::> 4
a2billing.php|4: file:Class.RateEngine.php - line:98 - uniqueid:1261326643.172
3 - [CC_asterisk_rate-engine: (1, 3057781080)] ::> 4
a2billing.php|4: file:Class.RateEngine.php - line:119 - uniqueid:1261326643.17
23 - [CC_asterisk_rate-engine: CALLERID]
a2billing.php|4: 3053567631
a2billing.php|4: ::> 4
a2billing.php|4: file:Class.A2Billing.php - line:992 - uniqueid:1261326643.172
3 - ERROR ::> RateEngine didnt succeed to match the dialed number over the ratec
ard (Please check : id the ratecard is well create ; if the removeInter_Prefix i
s set according to your prefix in the ratecard ; if you hooked the ratecard to t
he Call Plan) ::> 1
-- Playing 'prepaid-dest-unreachable' (escape_digits=#) (sample_offset 0)
masterpbx*CLI>

Oodly, for some reason, the [agi_dnid] captures 3057781080 but [agi_extension] captures 13057781080 which has to be the right DNID to call....... is there a way to tell A2B to use 1305 and no 305 ?

Thank you!

Paul


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Mon Dec 21, 2009 8:22 am 
Offline

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

In the latest version of A2Billing, the DNID field was changed, so that the DNID was correctly shown in the reports, which it was not in previous versions.

Therefore, in one of the two freePBX dial plan fragments, you would need to set the DNID variable to be the Extension.

Joe


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Mon Dec 21, 2009 10:02 am 
Offline

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

Can you try this UNTESTED piece of code, and see if it does the job?

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


Please report back

Joe


Top
 Profile  
 
 Post subject: Re: OUTBOUND CID PASS TO THE A2B ENGINE FROM ASTERISK EXTENSION
PostPosted: Mon Dec 21, 2009 3:11 pm 
Offline

Joined: Sat Jul 25, 2009 8:03 pm
Posts: 45
Hi Joe!

You are such a genious, man! Your code worked GREAT! Now the [agi-dnid] field is capturing the value after the application of the Trunk's DialRules!! AWESOME!!!

Thank you very much, I think it would be very valuable for anyone in the community who wants an integration of their FreePBX / Asterisk extensions to the A2billing platform to know this!

ERGO: you can make official this solution.

Thanks a lot and have a good day.

- Paul


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group