Hi all!
First time in the forum… Here’s some background info:
I want server B to send traffic to Server A, and its not working. Please see below for logs that I am getting. If I want one server to be sending traffic, and the same server to be recieving traffic, what would I have to do? If I just wanted to connect server A to server B, it works fine with IP authentication. But if I want server B to send traffic to server A AND still have server A send traffic to server B, I get the error message below. Here is what I have for server A connecting to server B:
type=friend
username=1257102845
accountcode=1257102845
regexten=1257102845
callerid=7427645105
amaflags=billing
nat=yes
dtmfmode=RFC2833
qualify=yes
canreinvite=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
host=47.15.83.xxx
context=wholesale <= defined in extensions.conf file for a2billing
regseconds=0
cancallforward=yes
This is what I put into my freepbx to connect server A to server B:
type=peer
host=47.15.83.xxx
qualify=yes
If I just had this in my server, then server A is able to send calls to Server B. Now if I create another SIP entry, allowing Server A to connect Bto Server A, this is the error I’m getting:
== Parsing '/etc/asterisk/asterisk.conf': Found
== Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.23.2 currently running on charlestest (pid = 30028)
Verbosity is at least 9
-- Executing [2044809110@from-trunk:1] Set("SIP/47.15.38.xxx-08cc5c08", "__FROM_DID=2044809110") in new stack
-- Executing [2044809110@from-trunk:2] GotoIf("SIP/47.15.38.xxx-08cc5c08", "1 ?cidok") in new stack
-- Goto (from-trunk,2044809110,4)
-- Executing [2044809110@from-trunk:4] NoOp("SIP/47.15.38.xxx-08cc5c08", "CallerID is "4167314166" <4167314166>") in new stack
-- Executing [2044809110@from-trunk:5] Set("SIP/47.15.38.xxx-08cc5c08", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [2044809110@from-trunk:6] SetCallerPres("SIP/47.15.38.xxx-08cc5c08", "allowed_not_screened") in new stack
-- Executing [2044809110@from-trunk:7] Goto("SIP/47.15.38.xxx-08cc5c08", "a2billing|2044809110|1") in new stack
-- Goto (a2billing,2044809110,1)
-- Executing [2044809110@a2billing:1] Answer("SIP/47.15.38.xxx-08cc5c08", "") in new stack
-- Executing [2044809110@a2billing:2] Wait("SIP/47.15.38.xxx-08cc5c08", "1") in new stack
-- Executing [2044809110@a2billing:3] DeadAGI("SIP/47.15.38.xxx-08cc5c08", "a2billing.php|1") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php|1: A2Billing AGI internal configuration:
a2billing.php|1: Array
a2billing.php|1: (
a2billing.php|1: [debug] => 1
a2billing.php|1: [asterisk_version] => 1_4
a2billing.php|1: [answer_call] => 1
a2billing.php|1: [play_audio] => 1
a2billing.php|1: [say_goodbye] =>
a2billing.php|1: [play_menulanguage] =>
a2billing.php|1: [force_language] =>
a2billing.php|1: [intro_prompt] =>
a2billing.php|1: [min_credit_2call] => 0
a2billing.php|1: [min_duration_2bill] => 0
a2billing.php|1: [notenoughcredit_cardnumber] =>
a2billing.php|1: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|1: [use_dnid] => 1
a2billing.php|1: [no_auth_dnid] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 2400
a2billing.php|1: [1] => 2300
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [number_try] => 1
a2billing.php|1: [force_callplan_id] =>
a2billing.php|1: [say_balance_after_auth] =>
a2billing.php|1: [say_balance_after_call] =>
a2billing.php|1: [say_rateinitial] =>
a2billing.php|1: [say_timetocall] =>
a2billing.php|1: [auto_setcallerid] => 1
a2billing.php|1: [force_callerid] =>
a2billing.php|1: [cid_sanitize] =>
a2billing.php|1: [cid_enable] => 1
a2billing.php|1: [cid_askpincode_ifnot_callerid] => 1
a2billing.php|1: [cid_auto_assign_card_to_cid] => 1
a2billing.php|1: [cid_auto_create_card] =>
a2billing.php|1: [cid_auto_create_card_len] => 10
a2billing.php|1: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php|1: [cid_auto_create_card_credit] => 0
a2billing.php|1: [cid_auto_create_card_credit_limit] => 1000
a2billing.php|1: [cid_auto_create_card_tariffgroup] => 6
a2billing.php|1: [callerid_authentication_over_cardnumber] =>
a2billing.php|1: [sip_iax_friends] =>
a2billing.php|1: [sip_iax_pstn_direct_call_prefix] => 555
a2billing.php|1: [sip_iax_pstn_direct_call] =>
a2billing.php|1: [ivr_voucher] =>
a2billing.php|1: [ivr_voucher_prefix] => 8
a2billing.php|1: [jump_voucher_if_min_credit] =>
a2billing.php|1: [extracharge_did] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_fee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [extracharge_buyfee] => Array
a2billing.php|1: (
a2billing.php|1: [0] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [international_prefixes] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 011
a2billing.php|1: [1] => 00
a2billing.php|1: [2] => 09
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [dialcommand_param] => |60|HRgrL(%timeout%:61000:30000)
a2billing.php|1: [dialcommand_param_sipiax_friend] => |60|HRgirL(3600000:61000:30000)
a2billing.php|1: [switchdialcommand] =>
a2billing.php|1: [failover_recursive_limit] => 2
a2billing.php|1: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php|1: [send_reminder] =>
a2billing.php|1: [record_call] =>
a2billing.php|1: [monitor_formatfile] => gsm
a2billing.php|1: [agi_force_currency] =>
a2billing.php|1: [currency_association] => Array
a2billing.php|1: (
a2billing.php|1: [0] => usd:dollars
a2billing.php|1: [1] => mxn:pesos
a2billing.php|1: [2] => eur:euros
a2billing.php|1: [3] => all:credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php|1: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php|1: [callback_bill_1stleg_ifcall_notconnected] => 1
a2billing.php|1: [logger_enable] => 1
a2billing.php|1: [log_file] => /tmp/a2billing.log
a2billing.php|1: [currency_association_internal] => Array
a2billing.php|1: (
a2billing.php|1: [usd] => dollars
a2billing.php|1: [mxn] => pesos
a2billing.php|1: [eur] => euros
a2billing.php|1: [all] => credit
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [ivr_voucher_prefixe] => 8
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:a2billing.php - line:78 - IDCONFIG : 1
a2billing.php|1: file:a2billing.php - line:79 - MODE : standard
a2billing.php|1: file:a2billing.php - line:91 - AGI Request:
a2billing.php|1: file:a2billing.php - line:92 - Array
a2billing.php|1: (
a2billing.php|1: [agi_request] => a2billing.php
a2billing.php|1: [agi_channel] => SIP/47.15.38.xxx-08cc5c08
a2billing.php|1: [agi_language] => en
a2billing.php|1: [agi_type] => SIP
a2billing.php|1: [agi_uniqueid] => 1243484737.60
a2billing.php|1: [agi_callerid] => 4167314166
a2billing.php|1: [agi_calleridname] => 4167314166
a2billing.php|1: [agi_callingpres] => 0
a2billing.php|1: [agi_callingani2] => 0
a2billing.php|1: [agi_callington] => 0
a2billing.php|1: [agi_callingtns] => 0
a2billing.php|1: [agi_dnid] => 2044809110
a2billing.php|1: [agi_rdnis] => unknown
a2billing.php|1: [agi_context] => a2billing
a2billing.php|1: [agi_extension] => 2044809110
a2billing.php|1: [agi_priority] => 3
a2billing.php|1: [agi_enhanced] => 0.0
a2billing.php|1: [agi_accountcode] =>
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:Class.A2Billing.php - line:621 - get_agi_request_parameter = 4167314166 ; SIP/47.15.38.xxx-08cc5c08 ; 1243484737.60 ; ; 2044809110
a2billing.php|1: file:a2billing.php - line:141 - [ANSWER CALL]
a2billing.php|1: file:Class.A2Billing.php - line:1439 - [CID_ENABLE - CID_CONTROL - CID:4167314166]
a2billing.php|1: file:Class.A2Billing.php - line:1456 - QUERY = SELECT cc_callerid.cid, cc_callerid.id_cc_card, cc_callerid.activated, cc_card.credit, cc_card.tariff, cc_card.activated, cc_card.inuse, cc_card.simultaccess, cc_card.typepaid, cc_card.creditlimit, cc_card.language, cc_card.username, removeinterprefix, cc_card.redial, enableexpire, UNIX_TIMESTAMP(expirationdate), expiredays, nbused, UNIX_TIMESTAMP(firstusedate), UNIX_TIMESTAMP(cc_card.creationdate), cc_card.currency, cc_card.lastname, cc_card.firstname, cc_card.email, cc_card.uipass, cc_card.id_campaign, cc_card.id, useralias FROM cc_callerid LEFT JOIN cc_card ON cc_callerid.id_cc_card=cc_card.id LEFT JOIN cc_tariffgroup ON cc_card.tariff=cc_tariffgroup.id WHERE cc_callerid.cid='4167314166'
a2billing.php|1: RESULT : Array
a2billing.php|1: (
a2billing.php|1: [0] => Array
a2billing.php|1: (
a2billing.php|1: [0] => 4167314166
a2billing.php|1: [cid] => 4167314166
a2billing.php|1: [1] => 24
a2billing.php|1: [id_cc_card] => 24
a2billing.php|1: [2] => t
a2billing.php|1: [activated] => t
a2billing.php|1: [3] => 10.00000
a2billing.php|1: [credit] => 10.00000
a2billing.php|1: [4] => 5
a2billing.php|1: [tariff] => 5
a2billing.php|1: [5] => t
a2billing.php|1: [6] => 0
a2billing.php|1: [inuse] => 0
a2billing.php|1: [7] => 0
a2billing.php|1: [simultaccess] => 0
a2billing.php|1: [8] => 0
a2billing.php|1: [typepaid] => 0
a2billing.php|1: [9] =>
a2billing.php|1: [creditlimit] =>
a2billing.php|1: [10] => en
a2billing.php|1: [language] => en
a2billing.php|1: [11] => 9290878766
a2billing.php|1: [username] => 9290878766
a2billing.php|1: [12] => 1
a2billing.php|1: [removeinterprefix] => 1
a2billing.php|1: [13] =>
a2billing.php|1: [redial] =>
a2billing.php|1: [14] => 0
a2billing.php|1: [enableexpire] => 0
a2billing.php|1: [15] => 1559013194
a2billing.php|1: [UNIX_TIMESTAMP(expirationdate)] => 1559013194
a2billing.php|1: [16] => 0
a2billing.php|1: [expiredays] => 0
a2billing.php|1: [17] => 0
a2billing.php|1: [nbused] => 0
a2billing.php|1: [18] => 0
a2billing.php|1: [UNIX_TIMESTAMP(firstusedate)] => 0
a2billing.php|1: [19] => 1243484012
a2billing.php|1: [UNIX_TIMESTAMP(cc_card.creationdate)] => 1243484012
a2billing.php|1: [20] => USD
a2billing.php|1: [currency] => USD
a2billing.php|1: [21] => eldan
a2billing.php|1: [lastname] => eldan
a2billing.php|1: [22] =>
a2billing.php|1: [firstname] =>
a2billing.php|1: [23] =>
a2billing.php|1: [email] =>
a2billing.php|1: [24] => 4436988662
a2billing.php|1: [uipass] => 4436988662
a2billing.php|1: [25] => -1
a2billing.php|1: [id_campaign] => -1
a2billing.php|1: [26] => 24
a2billing.php|1: [id] => 24
a2billing.php|1: [27] => 840185426052987
a2billing.php|1: [useralias] => 840185426052987
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:Class.A2Billing.php - line:1714 - [SET CHANNEL(language) en]
a2billing.php|1: file:Class.A2Billing.php - line:654 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='9290878766']
a2billing.php|1: file:Class.A2Billing.php - line:1400 - [AUTO SetCallerID]
a2billing.php|1: file:Class.A2Billing.php - line:1406 - [REQUESTED SetCallerID : 4167314166]
a2billing.php|1: file:Class.A2Billing.php - line:1417 - [EXEC SetCallerID : 4167314166]
a2billing.php|1: file:a2billing.php - line:172 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php|1: file:a2billing.php - line:173 - [CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php|1: file:Class.A2Billing.php - line:676 - 1 && && 10&& 0
a2billing.php|1: file:Class.A2Billing.php - line:701 - DESTINATION ::> 2044809110
a2billing.php|1: file:Class.A2Billing.php - line:703 - RULES APPLY ON DESTINATION ::> 2044809110
a2billing.php|1: file:Class.A2Billing.php - line:739 - ERROR ::> RateEngine didnt succeed to match the dialed number over the ratecard (Please check : id the ratecard is well create ; if the removeInter_Prefix is set according to your prefix in the ratecard ; if you hooked the ratecard to the Call Plan)
-- Playing 'prepaid-dest-unreachable' (escape_digits=#) (sample_offset 0)
a2billing.php|1: file:Class.A2Billing.php - line:654 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='9290878766']
-- AGI Script a2billing.php completed, returning 0
In conclusion, I want to have server A talk to Server B, and then Server B talk back to server A. Any help is much appreciated!