Joe, Thank you for replying
Quote:
I'm not sure that the cardalias should = the the accountcode - The accountcode should be the same as the A2Billing card number.
The issue is that to dial with the account number creates a security issue, as this number is used for authentication in calling card services.
You're right, I made a mistake, when I create a new customer/sip-iax friend, it is the callerid field which is equal to the cardalias.
So the card number is not used.
The accountcode is only used in the query.
In the case there are several sip_iax_friends, we must use a WHERE that matches with the card the caller and the callee belong to (in order to make the call free of charge only for friends who belongs to the same card). The WHERE should also be done via the id_card...
The correct queries would be :
Code:
line 1072:
$QUERY = "SELECT callerid FROM cc_iax_buddies WHERE accountcode='".$this->accountcode."' AND callerid='".$this->destination."'";
or
$QUERY = "SELECT callerid FROM cc_iax_buddies WHERE id_cc_card='".$this->id_card."' AND callerid='".$this->destination."'";
line 1084:
$QUERY = "SELECT callerid FROM cc_sip_buddies WHERE accountcode='".$this->accountcode."' AND callerid='".$this->destination."'";
or
$QUERY = "SELECT callerid FROM cc_sip_buddies WHERE id_cc_card='".$this->id_card."' AND callerid='".$this->destination."'";
Which one is the best according to you ? (both don't seem to have an index in the db)
Quote:
The more elegant way of doing it maybe to create a DID or extension, and direct that number to the account number. This would be better done within a2billing.php, as this keeps the call inside A2Billing, rather than sending it out via a local trunk, then bringing it back into A2Billing as a DID.
Doing the extension to extension dialling in this way means that you can select extension numbers, make charges for internal calls, and do everything without custom code.
BTW, my Call stays in A2B (in this exemple the callee's callerid is 60025 called from 60022):
Code:
-- ast_get_srv: SRV lookup for '_sip._UDP.callcentric.com' mapped to host alpha3.callcentric.com, port 5080
== Using SIP RTP CoS mark 5
-- Executing [55560025@a2billing:1] DeadAGI("SIP/60022-b7d8f3c8", "a2billing.php,1") in new stack
[Jun 12 03:19:21] WARNING[21554]: res_agi.c:3032 deadagi_exec: DeadAGI has been deprecated, please use AGI in all cases!
-- Launched AGI Script /usr/share/asterisk/agi-bin/a2billing.php
-- AGI Script Executing Application: (DIAL) Options: (SIP/60025,60,iL(3600000:61000:30000))
-- Limit Data for this call:
> timelimit = 3600000
> play_warning = 61000
> play_to_caller = yes
> play_to_callee = no
> warning_freq = 30000
> start_sound =
> warning_sound = timeleft
> end_sound =
== Using SIP RTP CoS mark 5
-- Called 60025>
-- SIP/60025-b7d4e728 is ringing
Regards
Cyril