Configurar a2billing en menos de 10 minutos

Imagen de RazaMetaL

Ya sabemos [url=http://www.ecualug.org/?q=2006/07/19/comos/instalar_un_sistema_de_facturacion_para_asterisk]como instalar a2billing[/url], viene algo que al inicio no se nos hara muy amigable y es configurarlo para que empieze a controlar las tarifas de las llamadas que se realizen desde asterisk.

Una de las cosas que se tornan mas difíciles (instalarlo es super fácil) es entender como manejar el sistema de facturación. Sabemos que puede mostrarnos el consumo monetario de una llamada realizada por alguna de nuestras extensiones (clientes), pero configurarlo desde su amigable interfaz web es algo confuso las primeras veces.

No hay mejor manera de explicar un procedimiento que con la práctica, voy a explicar como lograr que a2billing funcione para tarificación del consumo telefónico. Para esto voy a asumir lo siguiente:

- Tengo instalado y configurado Asterisk;
- Tengo configurado un proveedor de minutos que usa SIP al que llamare proveedorsip;
- Mi proveedor NO requiere que se agregen 00 ó 011 antes del código de país;
- Tengo instalado a2billing y su interfaz de usuario;
- Para hacer llamadas internacionales mis extensiones agregan el 00 antes del código de país.

En nuestro archivo de configuracion sip.conf debemos tener las líneas para la configuración del proveedor:


[proveedorsip]
username=usuario
type=peer
secret=una-clave
nat=yes
insecure=very
host=sip.proveedorsip.com
fromuser=usuario
fromdomain=sip.proveedorsip.com
dtmfmode=info
disallow=all
canreinvite=no
authuser=usuario
allow=g723
allow=g729
allow=alaw

El procedimiento:
[b]1.- Crear un proveedor:[/b]

TRUNK --> Create Provider

He creado el Proveedor ProveedorSIP en donde ingreso detalles informativos del proveedor.

[b]2.- Agregar un Trunk:[/b]

TRUNK --> Add Trunk

Un trunk es el canal por donde saldrán las llamadas, podemos tener varios trunks por ejemplo uno para llamadas internacionales, otro para llamadas locales, etc. Estos trunks pueden usar el mismo proveedor pero se diferencian entre ellos por los dígitos que se agregan o eliminan al marcado que envia el cliente, así en este ejemplo debemos agregar 00 para llamadas inernacionales; agregar 5935(yo estoy en Manabí) para las llamadas locales.

Se ingresan los detalles de la troncal, por ejemplo que prefijo se debe agregar a cada llamada que por esta troncal salga, para ilustrar el ejemplo estos son los datos que ingreso para el Trunk que llamaré internacional-proveedorsip, debo tener en cuenta que a este proveedor enviarle el codigo de pais y el numero de telefono, por ejemplo si voy a llamar a Venezuela el debera recibir 582121234567 y no 00582121234567, el prefijo de marcado varía entre los diferentes proveedores, otros requieren que envies un 011 ó 00 antes del codigo de pais para poder terminar la llamada.

Mis usuarios marcarán:

00 + codigo de pais + codigo de area + numero de telefono

El proveedor podra terminar la llamada si el marcado le llega como:

codigo de pais + codigo de area + numero de telefono

Así debería de quedar el trunk en a2billing para que se cumplan los requerimientos anteriores:


VOIP-PROVIDER ProveedorSIP
LABEL internacional-proveedorsip
ADD PREFIX (en este caso no es necesario agregar prefijos)
REMOVE PREFIX 00
PROVIDER TECH SIP
PROVIDER IP proveedorsip
ADDITIONAL PARAMETER
FAILOVER TRUNK (no es necesario por ahora)

La última opción es bastante útil si tenemos mas de un proveedor. Podemos tener varios trunks que hagan terminación a un mismo destino pero con diferentes proveedores, asi si el proveedor A esta sin servicio la llamada puede ser terminada por el proveedor B.

[b]3.- Creamos un grupo de tarifas (TariffGroup)[/b]

RATECARD --> Create TariffGroup


TARIFFGROUPNAME Oro
LC TYPE LCR
REMOVE INTER PREFIX NO

Podemos tener varios grupos de tarifas que contendran diferentes precios, por ejemplo podemos tener 3 grupos de tarifas Oro, Plata y Bronce. En Oro van tarifas bien bajas, y en Bronce las altas. Los grupos de tarifas contienen las Ratecard y estas últimas los precios de los destinos. Los grupos de tarifas pueden tener tambien LCR o LCD.

LCR es Low Cost Routing que quiere decir que escogera de las tarifas que existan a un destino la que nos cuesta menos. LCD es Low Cost Dialing que quiere decir que escogerá la tarifa de venta mas económica para el usuario.

[b]4.- Crear RATECARD[/b]

RATECARD --> Create new Ratecard


TARIFFNAME Internacional
START DATE
TRUNK internacional-proveedorsip
DESCRIPTION Tarifas internacionales
DNID PREFIX all

Ratecard va a contener Rates (precios) para cada destino, en el ejemplo se ha creado la tarifa llamada Internacional que usara el trunk internacional-proveedorsip para terminar las llamadas.

[b]5.- Crear tarifas[/b]

RATECARD --> Add Rate


RATECARD internacional
DIALPREFIX 001
DESTINATION Estados Unidos
BUYING RATE 0.05
BUYRATE MIN DURATION 6
BUYRATE BILLING BLOCK 30
SELLING RATE 0.10
SELLRATE MIN DURATION 6
SELLRATE BILLING BLOCK 30
CONNECT CHARGE 0
DISCONNECT CHARGE 0
TRUNK internaciona-proveedorsip

Seguimos el procedimiento para cada destino que queramos agregar. Hacerlo para todos los paises del mundo sería bastante tedios, para ello existe la opcion de importar un archivo separado por comas (CSV) que hallamos editado en nuestra hoja de calculo favorita. Esta tarea se la logra en:
RATECARD --> Import RateCard

El separador de columnas debe ser el ; (punto y coma) ya que si usamos , nos dará error al importar.

[b]6.- Crear clientes[/b]

CUSTOMERS --> Create Customers


CARD NUMBER (generado por a2billing)
CARD ALIAS 123
WEBui PASSWORD 123
BALANCE 10
LANGUAGE SPANISH
TARIFFGROUP Oro
SIMULTANEOUS ACCESS INDIVIDUAL ACCESS
CURRENCY U.S. Dollar (USD)
LASTNAME Apellido
FIRSTNAME Nombre
EMAIL email@mail.da.ru
ADDRESS Direccion
CITY Ciudad
STATE/PROVINCE Provincia
COUNTRY País
PHONENUMBER Telefono
FAXNUMBER Fax
SIP ACCOUNT Yes
IAX ACCOUNT Yes

A2billing nos genera automáticamente el numero de tarjeta, si quieremos darle a nuestro usuario un número que sea más fácil de recordar para el podemos usar el campo CARD ALIAS. En este ejemplo el usuario tiene un crédito de US$10,00 y la cuenta no puede ser usada simultáneamente.

A cada tarjeta podemos agregarles usuarios adicionales SIP e IAX. Esto se lo logra listando las tarjetas y dando click al botón respectivo (SIP, IAX) en el resultado de listar las tarjetas:


CUSTOMERS --> List Customers

Dar click en SIP para crear un usuario SIP
Dar click en IAX para crear un usuario IAX

[b]7.- Agregar RATECARD al TARIFFGROUP[/b]

RATECARD --> LIST TARIFFGROUP

Escoger el tariffgroup Oro y agregar el ratecard internacional

Ahora debemos probar si nuestra configuración surte efecto. Configuramos un dispositivo SIP o IAX2 para que se registre con los datos de usuario sip ó iax friend y marcamos un número de USA. Si todo esta bien en el CDR veremos registrada la llamada, su Duración y precio.

[b][i]T-R-U-C-O-S - Y - T-I-P-S:[/i][/b]
Esta seccion la voy a actualizar constantemente de acuerdo al avance que vaya teniendo asi que no dejen de revisarla, puede que algo que necesiten hacer y no sepan como lograrlo ya este publicado en esta parte ;)

[b]**** Modificar el campo Card Number del Cliente[/b]
Al editar un cliente no puedes modificar el número de tarjeta porque este campo esta protegido contra escritura, esto implica que una llamada entre usuarios del mismo servidor pueda ser hecha entre números de tarjeta y no entre alias de tarjetas, los números que se aprenden mis usuarios son los alias porque son más sencillos de aprender. Por otra parte en lo personal se me hace mas fácil asignar manualmente el número de tarjeta que será el número de usuario. Para lograrlo debemos editar la linea 199 y eliminar la palabra readonly en el archivo /var/www/a2billing//Public/form_data/FG_var_card.inc la línea en mención nos quedaría mas o menos así:
Antes:

"size=20 $maxi readonly maxlength=40",

Despues:

"size=20 $maxi maxlength=40",

[b] **** Escuchar saldo desde cualquier extension registrada[/b]
Muchos clientes quieren conocersu saldo en dinero sin necesidad de tener una computadora cerca, para esto realizamos el siguiente hack:

cd /var/lib/asterisk/agi-bin
cp a2billing.php balance.php
cp -r libs_a2billing balance

Editamos balance.php y cambiamos todas las referencias de libs_a2billing a balance, de igual manera hacemos con /var/lib/asterisk/agi-bin/balance/Class.A2Billing.php y reemplazamos a2billing.conf por balance.conf


cd /etc/asterisk/
cp a2billing.conf balance.conf

Editamos las siguientes opciones en balance.conf

say_balance_after_auth=YES
use_dnid=NO
answer_call=YES

Finalmente se agrega la siguiente linea en extensions.conf en el contexto que usamos para a2billing:

; Agregar extension *0 para que el usuario consulte su saldo
exten => *0,1,DeadAGI(balance.php)

Al marcar *0 desde cualquier equipo registrado en el sistema escucharemos el saldo de la cuenta.

[b] **** Habilitar VoiceMail entre usuarios SIP/IAX2 de a2billing[/b]
Esta es una opcion que no viene por defecto pero que se puede lograr modificando algunos parametros de configuracion.

Si la extension esta [b]no esta registrada[/b] se hacen estas modificaciones:

vi /var/lib/asterisk/agi-bin/libs_a2billing/Class.A2Billing.php

Buscar:

} elseif ($k+1 == $sip_buddies+$iax_buddies){
$prompt="prepaid-dest-unreachable";
$agi-> stream_file($prompt, '#');
}

Reemplazarlo por:

} elseif ($k+1 == $sip_buddies+$iax_buddies){
// Modificado para habilitar voicemail entre sip/iax friends
$prompt="prepaid-dest-unreachable";
//$agi-> stream_file($prompt, '#');
$buddy="u".$this->destination;
$agi-> exec(VoiceMail,$buddy);
}

Cuando la extension [b]no es contestada[/b] buscamos todas las concurrencias (hay dos) para:

} elseif ($this->dialstatus == "NOANSWER") {
$answeredtime=0;

$agi-> stream_file('prepaid-noanswer', '#');

Y lo dejamos asi:

} elseif ($this->dialstatus == "NOANSWER") {
$answeredtime=0;
// Modificado para permitir VoiceMail entre SIP/IAX friends
//$agi-> stream_file('prepaid-noanswer', '#');
$buddyu="u".$this->destination;
$agi-> exec(VoiceMail,$buddyu);

Y cuando la extension esta [b]ocupada[/b] modificamos de la siguiente manera:

if ($dialstatus == "BUSY") {
$answeredtime=0;
$agi-> stream_file('prepaid-isbusy', '#');

Dejandolo asi:

if ($dialstatus == "BUSY") {
$answeredtime=0;
// Modificado para permitir voicemail cuando la extension este ocupada
// $agi-> stream_file('prepaid-isbusy', '#');
$buddyb="b".$this->destination;
$agi-> exec(VoiceMail,$buddyb);

Luego debemos crear una entrada en [b]/etc/asterisk/voicemail.conf[/b] para nuestros usuarios que deben tener voicemail en el contexto respectivo:


[default]
666 => 666,RazaMetaL,razametal@linuxmail.com,|sayduration=yes|forcename=no|forcename=yes|forcegreetings=no|review=yes|operator=yes

[b]ACTUALIZACION[/b]: Utilizando realtime.

Es cierto que modificar a mano el archivo /etc/asterisk/voicemail.conf cada vez que creas un usuario se torna tedioso :(, pero existe una solución y esta es utilizando realtime que no es mas que ingresar los usuarios en una tabla en la base de datos de a2billing, así cuando creamos un usuario este tiene por defecto habilitado el voicemail. El procedimiento anterior de reemplazar las líneas en el archivo Class.A2Billing.php también es necesario para este método.

Que es lo que debemos hacer?

1.- Añadir la tabla voicemail_users en la base de datos mya2billing:


CREATE TABLE `voicemail_users` (
`uniqueid` int(11) NOT NULL auto_increment,
`customer_id` int(11) NOT NULL default '0',
`context` varchar(50) NOT NULL default '',
`mailbox` varchar(15) NOT NULL default '0',
`password` varchar(4) NOT NULL default '1234',
`fullname` varchar(50) NOT NULL default '',
`email` varchar(50) NOT NULL default '',
`pager` varchar(50) NOT NULL default '',
`stamp` timestamp(14) NOT NULL,
PRIMARY KEY (`uniqueid`),
KEY `mailbox_context` (`mailbox`,`context`)
) TYPE=MyISAM;

Para hacerlo mas sencillo, copiamos las líneas del párrafo anterior en un archivo que llamaremos voicemail_users.sql y luego ejecutamos:

mysql -u a2billinguser -pa2billing mya2billing < voicemail_users.sql

2.- Debemos sincronizar las tablas de la base de datos mya2billing para que esta contenga los datos para el funcionamiento del voicemail de los usuarios, y esto hay que hacerlo con una tarea programada, yo lo estoy haciendo cada 5 minutos.

Esta es la sentencia que debe ser ejecutada cada 5 minutos por el usuario a2billinguser en la base de datos mya2billing:

truncate table voicemail_users;
insert into voicemail_users(customer_id,context,mailbox ,fullname,email)
select A.id_cc_card,'default',A.name, concat(B.lastname,' ',B.firstname),B.email from cc_sip_buddies A,cc_card B where A.id_cc_card =B.id ;

Para hacerlo mas sencillo creamos un archivo de texto en /etc/asterisk llamado a2billingvoicemail.sql que contenga las líneas del párrafo anterior, luego creamos un archivo en /etc/asterisk llamado a2billingvoicemail.sh que debe contener esto:

mysql -u a2billinguser -pa2billing mya2billing < /etc/asterisk/a2billingvoicemail.sql

Le damos permisos de ejecución:

chmod a+x a2billingvoicemail.sh

Y programamos la tarea para que se ejecute cada 5 minutos:


vi /etc/crontab

Agregamos las siguientes líneas:

# Sincronizar mysql cada 5 minutos
5 * * * * /etc/asterisk/a2billingvoicemail.sh

3.- Configurar realtime en /etc/asterisk/extconfig.conf debemos agregar:

voicemail =>mysql,mya2billing,voicemail_users

Y en /etc/asterisk/res_mysql.conf :

[general]
dbhost = 127.0.0.1
dbname = mya2billing
dbuser = a2billinguser
dbpass = a2billing
dbport = 3306
;dbsock = /tmp/mysql.sock

4.- Configuramos nuestro contexto para a2billing para que luzca de esta manera:

exten => _X.,1,GotoIf($["${EXTEN}" = "9999"]? 4)
exten => _X.,2,DeadAGI(a2billing.php|1)
exten => _X.,3,Hangup
exten => _X.,4,VoicemailMain()
exten => _X.,5,Hangup

Esto quiere decir que si un usuario digita 9999 va a ir a su centro de mensajes. La contraseña por defecto para cada usuario es 1234, él deberá cambiarla desde el mismo centro de mensajes de voz.

[b] **** A2billing esta facturando la llamada desde que el telefono timbra y no desde que contestan.[/b]
Por defecto a2billing.conf muestra el consumo desde que marcas el numero hasta que cuelgas, muchos al igual que yo deben querer que sea facturado solo el tiempo hablado, es decir desde que la llamada es contestada. Esto se logra ademas modificando el parámetro [i]dialcommand_param[/i] para agregar la letra [b]C[/b]

dialcommand_param="|90|CrHL(%timeout%:61000:0000)"

Tambien debemos decirle a a2billing que no se encargue de contestar la llamada y quitar el comando Answer en el contexto a2billing:

En [i]/etc/asterisk/a2billing.conf[/i] buscamos el parametro [i]answer_call[/i] en la seccion [i]agi-conf[/i] y lo seteamos en NO:

answer_call=no

En [i]/etc/asterisk/extensions.conf[/i] modificamos el contexto a2billing para que luzca asi:

[a2billing]
exten => _X.,1,DeadAGI(a2billing.php|1)
exten => _X.,5,Hangup

[b] **** La interfaz de mis usuarios sale en ingles, cuando doy cliente en la bandera de Espana el lenguaje no cambia. Estoy usando Debian.[/b]
Lo solucionamos de la siguiente manera:

aptitude install php-gettext
dpkg-reconfigure locales

Seleccionamos:

[X] es_ES ISO-8859-1 │
[X] es_ES.UTF-8 UTF-8

Y luego:

/etc/init.d/apache2 restart

Lo que sucede es que Debian instala solo el local que se define en la instalacion, si instalamos el sistema base en espanol no habria este problema.

[b] **** Aumentar decimales en el registro de llamadas[/b]
Por defecto la interfaz de usuario de A2billing muestra solo 2 decimales, asi que si aun cliente le dices que el minuto es a 0.055 el va a mirar en su interfaz 0.06 y a la larga esto va a causar molestias en el usuario.

Para solucionarlo se debe proceder de la siguiente manera:
Editar /var/www/html/consumos/lib/Misc.php en la linea 77:

function display_2dec($var){
echo number_format($var,2);
}

Debe quedar asi:

function display_2dec($var){
echo number_format($var,4);
}

[b] **** Si tengo poco saldo y hago una llamada a2billing permite que yo termine la llamada y me da saldo en contra[/b]
Esto no seria un problema si hay pocos usuarios, pero supongamos que alguien realiza una llamada a un destino que es muy caro y se queda hablando por una hora? Para evitar que esto sucede y que la llamada sea cortada cuando al usuario se le termine el saldo debemos modificar el parametro [i]dialcommand_param[/i] en [i]/etc/asterisk/a2billing.conf[/i]:


dialcommand_param="|120|HrCRL(%timeout%:61000:00000)"

[b] **** Permitir a los usuarios loguearse en la interfaz de administracion usando su e-mail o el numero de tarjeta[/b]
Este tip es bastante util puesto que permite usar o bien el numero de tarjeta o la direccion de correo electronica que el usuario tenga registrada en el sistema.

Buscar en [i]/var/www/consumos/lib/module.access.php[/i]:

if (strlen($user)==0 || strlen($user)>=20 || strlen($pass)==0 || strlen($pass)>=20) return false;

Reemplazar por:

if (strlen($user)==0 || strlen($user)>=50 || strlen($pass)==0 || strlen($pass)>=50) return false;

Buscar:

$QUERY = "SELECT username, credit, activated, id, id_didgroup, tariff, vat, activatedbyuser FROM cc_card WHERE useralias = '".$user."' AND uipass = '".$pass."'";

Reemplazar por:

$QUERY = "SELECT username, credit, activated, id, id_didgroup, tariff, vat, activatedbyuser FROM cc_card WHERE (email = '".$user."' OR useralias = '".$user."') AND uipass = '".$pass."'";

Comentarios

por fin pude conectarme pero

Imagen de kemrhi

por fin pude registrar un usuario pero cuando intento llamar se corta a los tres segundos

la consola me pone esto

-- Executing [5622369672@a2billing:1] Answer("SIP/111-081fefa0", "") in new stack
-- Executing [5622369672@a2billing:2] Wait("SIP/111-081fefa0", "2") in new stack
-- Executing [5622369672@a2billing:3] DeadAGI("SIP/111-081fefa0", "a2billing.php") in new stack
[Oct 3 01:32:28] WARNING[5141]: res_agi.c:2129 deadagi_exec: Running DeadAGI on a live channel will cause problems, please use AGI
-- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
a2billing.php: A2Billing AGI internal configuration:
a2billing.php: Array
a2billing.php: (
a2billing.php: [debug] => 1
a2billing.php: [asterisk_version] => 1_6
a2billing.php: [answer_call] =>
a2billing.php: [play_audio] => 1
a2billing.php: [say_goodbye] =>
a2billing.php: [play_menulanguage] =>
a2billing.php: [force_language] => ES
a2billing.php: [intro_prompt] =>
a2billing.php: [min_credit_2call] => 0
a2billing.php: [min_duration_2bill] => 6
a2billing.php: [notenoughcredit_cardnumber] =>
a2billing.php: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php: [use_dnid] => 1
a2billing.php: [no_auth_dnid] => Array
a2billing.php: (
a2billing.php: [0] => 2400
a2billing.php: [1] => 2300
a2billing.php: )
a2billing.php:
a2billing.php: [number_try] => 3
a2billing.php: [force_callplan_id] =>
a2billing.php: [say_balance_after_auth] =>
a2billing.php: [say_balance_after_call] =>
a2billing.php: [say_rateinitial] =>
a2billing.php: [say_timetocall] =>
a2billing.php: [auto_setcallerid] => 1
a2billing.php: [force_callerid] =>
a2billing.php: [cid_sanitize] =>
a2billing.php: [cid_enable] =>
a2billing.php: [cid_askpincode_ifnot_callerid] =>
a2billing.php: [cid_auto_assign_card_to_cid] => 1
a2billing.php: [cid_auto_create_card] =>
a2billing.php: [cid_auto_create_card_len] => 10
a2billing.php: [cid_auto_create_card_typepaid] => POSTPAY
a2billing.php: [cid_auto_create_card_credit] => 0
a2billing.php: [cid_auto_create_card_credit_limit] => 1000
a2billing.php: [cid_auto_create_card_tariffgroup] => 6
a2billing.php: [callerid_authentication_over_cardnumber] =>
a2billing.php: [sip_iax_friends] =>
a2billing.php: [sip_iax_pstn_direct_call_prefix] => 9
a2billing.php: [sip_iax_pstn_direct_call] =>
a2billing.php: [ivr_voucher] =>
a2billing.php: [ivr_voucher_prefix] => 8
a2billing.php: [jump_voucher_if_min_credit] =>
a2billing.php: [extracharge_did] => Array
a2billing.php: (
a2billing.php: [0] =>
a2billing.php: )
a2billing.php:
a2billing.php: [extracharge_fee] => Array
a2billing.php: (
a2billing.php: [0] =>
a2billing.php: )
a2billing.php:
a2billing.php: [extracharge_buyfee] => Array
a2billing.php: (
a2billing.php: [0] =>
a2billing.php: )
a2billing.php:
a2billing.php: [international_prefixes] => Array
a2billing.php: (
a2billing.php: [0] => 011
a2billing.php: [1] => 00
a2billing.php: [2] => 09
a2billing.php: )
a2billing.php:
a2billing.php: [dialcommand_param] => |60|HRgrL(%timeout%:61000:30000)
a2billing.php: [dialcommand_param_sipiax_friend] => |60|HRgirL(3600000:61000:30000)
a2billing.php: [switchdialcommand] =>
a2billing.php: [failover_recursive_limit] => 2
a2billing.php: [maxtime_tocall_negatif_free_route] => 5400
a2billing.php: [send_reminder] =>
a2billing.php: [record_call] =>
a2billing.php: [monitor_formatfile] => gsm
a2billing.php: [agi_force_currency] =>
a2billing.php: [currency_association] => Array
a2billing.php: (
a2billing.php: [0] => usd:dollars
a2billing.php: [1] => mxn:pesos
a2billing.php: [2] => eur:euros
a2billing.php: [3] => all:credit
a2billing.php: )
a2billing.php:
a2billing.php: [file_conf_enter_destination] => prepaid-enter-dest
a2billing.php: [file_conf_enter_menulang] => prepaid-menulang2
a2billing.php: [callback_bill_1stleg_ifcall_notconnected] => 1
a2billing.php: [logger_enable] => 1
a2billing.php: [log_file] => /tmp/a2billing.log
a2billing.php: [currency_association_internal] => Array
a2billing.php: (
a2billing.php: [usd] => dollars
a2billing.php: [mxn] => pesos
a2billing.php: [eur] => euros
a2billing.php: [all] => credit
a2billing.php: )
a2billing.php:
a2billing.php: [ivr_voucher_prefixe] => 8
a2billing.php: )
a2billing.php:
a2billing.php: file:a2billing.php - line:78 - IDCONFIG : 1
a2billing.php: file:a2billing.php - line:79 - MODE : standard
a2billing.php: file:a2billing.php - line:91 - AGI Request:
a2billing.php: file:a2billing.php - line:92 - Array
a2billing.php: (
a2billing.php: [agi_request] => a2billing.php
a2billing.php: [agi_channel] => SIP/111-081fefa0
a2billing.php: [agi_language] => en
a2billing.php: [agi_type] => SIP
a2billing.php: [agi_uniqueid] => 1223011946.17
a2billing.php: [agi_callerid] => 22277
a2billing.php: [agi_calleridname] => 111
a2billing.php: [agi_callingpres] => 0
a2billing.php: [agi_callingani2] => 0
a2billing.php: [agi_callington] => 0
a2billing.php: [agi_callingtns] => 0
a2billing.php: [agi_dnid] => 5622369672
a2billing.php: [agi_rdnis] => unknown
a2billing.php: [agi_context] => a2billing
a2billing.php: [agi_extension] => 5622369672
a2billing.php: [agi_priority] => 3
a2billing.php: [agi_enhanced] => 0.0
a2billing.php: [agi_accountcode] => 111
a2billing.php: )
a2billing.php:
a2billing.php: file:Class.A2Billing.php - line:621 - get_agi_request_parameter = 22277 ; SIP/111-081fefa0 ; 1223011946.17 ; 111 ; 5622369672
a2billing.php: file:a2billing.php - line:145 - [NO ANSWER CALL]
a2billing.php: file:Class.A2Billing.php - line:590 - FORCE LANGUAGE : ES
a2billing.php: file:Class.A2Billing.php - line:599 - [SET CHANNEL(language) es]
a2billing.php: file:Class.A2Billing.php - line:1640 - SELECT credit, tariff, activated, inuse, simultaccess, typepaid, creditlimit, language, removeinterprefix, 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_card LEFT JOIN cc_tariffgroup ON tariff=cc_tariffgroup.id WHERE username='111'
a2billing.php: file:Class.A2Billing.php - line:654 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='111']
a2billing.php: file:Class.A2Billing.php - line:1400 - [AUTO SetCallerID]
a2billing.php: file:Class.A2Billing.php - line:1406 - [REQUESTED SetCallerID : 22277]
a2billing.php: file:Class.A2Billing.php - line:1417 - [EXEC SetCallerID : 22277]
a2billing.php: file:a2billing.php - line:172 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php: file:a2billing.php - line:173 - [CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php: file:Class.A2Billing.php - line:676 - 1 && && 10&& 0
a2billing.php: file:Class.A2Billing.php - line:701 - DESTINATION ::> 5622369672
a2billing.php: file:Class.A2Billing.php - line:703 - RULES APPLY ON DESTINATION ::> 5622369672
a2billing.php: 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)
[Oct 3 01:32:28] WARNING[5141]: file.c:602 ast_openstream_full: File prepaid-dest-unreachable does not exist in any format
a2billing.php: file:a2billing.php - line:172 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php: file:a2billing.php - line:173 - [CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php: file:Class.A2Billing.php - line:676 - 0 && && 10&& 1
[Oct 3 01:32:28] WARNING[5141]: file.c:602 ast_openstream_full: File prepaid-enter-dest does not exist in any format
[Oct 3 01:32:28] WARNING[5141]: file.c:912 ast_streamfile: Unable to open prepaid-enter-dest (format 0x4 (ulaw)): No such file or directory
a2billing.php: file:Class.A2Billing.php - line:683 - RES DTMF : -1
a2billing.php: file:Class.A2Billing.php - line:701 - DESTINATION ::> -1
a2billing.php: file:Class.A2Billing.php - line:703 - RULES APPLY ON DESTINATION ::> -1
[Oct 3 01:32:28] WARNING[5141]: file.c:602 ast_openstream_full: File prepaid-invalid-digits does not exist in any format
a2billing.php: file:a2billing.php - line:172 - [CHANNEL STATUS : 6 = Line is up]
a2billing.php: file:a2billing.php - line:173 - [CREDIT : 10.00000][CREDIT MIN_CREDIT_2CALL : 0]
a2billing.php: file:Class.A2Billing.php - line:676 - 0 && && 10&& 2
[Oct 3 01:32:28] WARNING[5141]: file.c:602 ast_openstream_full: File prepaid-enter-dest does not exist in any format
[Oct 3 01:32:28] WARNING[5141]: file.c:912 ast_streamfile: Unable to open prepaid-enter-dest (format 0x4 (ulaw)): No such file or directory
a2billing.php: file:Class.A2Billing.php - line:683 - RES DTMF : -1
a2billing.php: file:Class.A2Billing.php - line:701 - DESTINATION ::> -1
a2billing.php: file:Class.A2Billing.php - line:703 - RULES APPLY ON DESTINATION ::> -1
[Oct 3 01:32:28] WARNING[5141]: file.c:602 ast_openstream_full: File prepaid-invalid-digits does not exist in any format
a2billing.php: file:Class.A2Billing.php - line:654 - [CARD STATUS UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='111']
-- AGI Script a2billing.php completed, returning 0

por favor razametal necesito tu ayuda

Cita: a2billing.php:

Imagen de RazaMetaL

[quote]
a2billing.php: 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)
[/quote]

No haz seguido el manual, el mensaje indica que el usuario no tiene configurada ninguna tarifa para el destino que trata de marcar. Verifica que tengas un Callplan y ratecards definidos para el usuario.

------------

Antes de preguntar visita el [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:

 

[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]

-----

Visita este [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:

[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]

(adsbygoogle = window.adsbygoogle || []).push({});

ayuda con a2billing

Hola amigos

he seguido todo lo que han posteado
pero no he podido tener exito con poder echar andar a2billing
tengo asterisk 1.4.20 y a2billing 1.3.3;

Agradeceria mucho que me puedan ayudar.

resulta que a2billing no me funciona es decir no me tarifica nada, asterisk me funciona bien aunque lo unico que he
hecho es tener un proveerdor sip y hacer llamadas y creo suponer que lo demas funciona bien, pero por el momento no
me interesa mucho lo vere despues una ves que a2billing me tarifique las llamadas sip que hago.

miren les explico:

tengo

a2billing.conf con estos datos:

[database]
hostname = localhost
;port = 5432
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
;dbtype = postgres
dbtype = mysql

y me funciona bien puedo entrar a la BD y ver las tablas y en las paginas no me manda ningun error.

tambien tengo esto en ese mismo archivo:

min_duration_2bill = 0

para que m pueda tarificar rapido sin que me contesten.

ahora en extensions_custom.conf tengo:

;AGREGUE ESTO POR LO QUE MENCIONAN AL FINAL DEL MANUAL
[macro-dialout-trunk-predial-hook]
;[a2billing]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
[custom-freepbx-a2billing]
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
;AQUI TERMINA LO AGREGADO

que es la macro que me ayuda a tarificar pero no hay resultado ademas agregue lo sig. tambien en este mismo
archivo porque he visto que en algunos manuales lo agregan.

[a2billing]
exten => _X.,1,Answer
exten => _X.,2,Wait,2
exten => _X.,3,DeadAGI,a2billing.php
exten => _X.,4,Wait,2
exten => _X.,5,Hangup

Pero lo agregue por q vi que las tarjetas q cree para los clientes en los archivos:
additional_a2billing_sip.conf
additional_a2billing_iax.conf

traen lo siguiente:

[6803228260]
type=friend
username=6803228260
accountcode=6803228260
regexten=6803228260
callerid=205
amaflags=billing
secret=205
nat=yes
dtmfmode=RFC2833
qualify=yes
canreinvite=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g729
host=dynamic
context=a2billing ; lo agregue por esto porq supongo que hace la llamada a [a2billing]
;context=macro-dialout-trunk-predial-hook
regseconds=0
cancallforward=yes

como quiera las dos partes:

[a2billing] y [macro-dialout-trunk-predial-hook]

estan agregadas en extensions_custom.conf

por si una me funcionaba pero ademas tengo otra duda
la etiqueta:
[macro-dialout-trunk-predial-hook]
existe en otra parte en el archivo: extensions.conf

pero esta etiqueta abajo de ella no hay nada, es decir esta comentado todo lo que tiene, aqui esta esa parte que esta en el archivo:

[macro-dialout-trunk-predial-hook]
; this macro intentially left blank so it may be safely overwritten for any custom
; requirements that an installatin may have.
;
; MACRO RETURN CODE: ${PREDIAL_HOOK_RET}
; if set to "BYPASS" then this trunk will be skipped
;

por lo que pense que el asterisk o a2billing lo podian llamar y lo comente quedando:

;[macro-dialout-trunk-predial-hook]
; this macro intentially left blank so it may be safely overwritten for any custom
; requirements that an installatin may have.
;
; MACRO RETURN CODE: ${PREDIAL_HOOK_RET}
; if set to "BYPASS" then this trunk will be skipped
;

Ahora en la web tengo:
Agregue el trunk en freePBX como lo dice el manual

Trunk A2B/1

y solo puse estos datos:

Dial Rules: 8+XXXXX

Custom Dial String:A2B/1

y lo guarde

y en el Outbound Routes tengo:

Route Name:
TARIFICADA
Intra Company RouteOptional: ESTA PALOMEADA
Dial Patterns: 5|XXXXX
Trunk Sequence: A2B/1

y lo guarde

por lo que se daran cuenta marco un numero 5XXXXX
y sale por el trunk con 8XXXXX

Y en este apartado tengo una duda hay un modo de monitorear el trunk de asterisk-a2billing (es importante para saber que lo esta tomando)cuando lo utiliza
por q no lo veo, en el caso que tengo el trunk SIP si lo puedo ver cuando hablo por telefono a otro lugar
pero en este caso marco 6XXXXX q es otra ruta q utilizo como prueba para ver que funciona el tel. que estoy
llamando y luego marco el mismo telefono ahora con 5XXXXX pero el telefono me manda a la contestadora de
asterisk bueno nose si sea la contestadora me lo dice en ingles y no le entiendo muy bien que me dice.

pero bueno en conclusion segun yo manda el numero por el trunk de asterisk-a2billing como 8XXXXX
ahora del lado de a2billing para que lo tome:

En la web tengo:

En la parte de
Browse Ratecard tengo:

DESTINATION corea del sur
PREFIX 8
BR 0.05
SR 0.1
START-DATE 2008-09-13 17:
STOP-DATE 2018-09-13 17:
INITB 6
CC 0
TRUNK miproveedorSIP
FTC No

Olvidense de los presios, eso no me interesa quiero q me tarifique, ahora
miproveedorSIP es el que utilizo para las pruebas 5XXXXX que les mencione arriba (es el que funciona muy bien por lo que no puede ser mi proveedor o la configuracion) entonces por lo tanto supongo al ponerlo aqui debe funcionar con el
pero no lo toma.

Entonces estabamos diciendo arriba que el trunk de asterisk-a2billing lleva 8XXXXX por lo que este ratecard lo debe tomar porq le estoy diciendo que tome el numero que venga con 8 como lo dice el PREFIX

Ahora en el trunk de a2billing(no confundir con el trunk que tengo en asterisk cual es: asterisk-a2billing con Custom Dial String:A2B/1 ) que es el que se configura por la web pero de billing-admin:

En el apartado List Trunk:
tengo:

LABEL DEFAULT
ADD_PREFIX 011
REMOVE_PREFIX
TECH IAX2
IP/HOST kiki@switch-.net
PROVIDER
MINUTES 0:00

LABEL miproveedorSIP
ADD_PREFIX
REMOVE_PREFIX
TECH SIP
IP/HOST miproveedorSIP
PROVIDER miproveedorSIP
MINUTES 00:00

como veran tengo un trunk de default que es el que ya traia de ejemplo, que no creo q es el que me este causando daño y el trunk de miproveedorSIP(es el mismo nombre que utilizo en el trunk asterisk de mi proveedor sip que es el que les digo que funciona bien cuando marco 6XXXXX)
pero ahorita que estoy escribiendo ya me surgio la duda de como es que toma el trunk adecuado la ratecard para que pueda tarificar la llamada.
Bueno como veran mi trunk no tiene ADD PREFIX Y REMOVE PREFIX porq segun ya hace la llamada con el 8XXXXX que le mando por el trunk asterisk-a2billing que cree, es decir este, Custom Dial String:A2B/1.

Bueno eso es todo.
no he podido he hecho muchas pruebas y nada espero que me ayuden nose si sea la version pero no creo
el trixbox es el 2.6.1, asterisk es 1.4.20-1 y el a2billing es el 1.3.3

Espero su respuesta tan detallada como la mia si fuera mucha molestia
gracias.

Saludos!!

ahora cree un provedor

Imagen de kemrhi

sin embargo cuando trato de llamar me sale el ring ring y despues una voz en español q me dice el numero marcado no esta disponible, introduzca el numero que desea llamar seguido de almohadilla

creo que es problema de troncal, pero las troncales, estan bien configuradas.

al fin lgre configurar a2billing

Imagen de kemrhi

al fin despues de mucho tiempoo peleando contra el sistema logre configurar a2billing, ya tarifica y desde que se contesta la llamada, no desde que se marca, pero tengo aun dos problemas, el primero es que la llamada no se corta cuando llamas a alguien y esta persona te corta
osea el cliente tiene que cortar apesar de que del otro lado hayan cortado

y el otro es que mis clientes no aparecen como registrados cuando le doy al asterisk el comando sip show peers, aun asi apueden realizar llamadas y se tarifican bien, pero lo ideal es que se registraran de hecho desde eun x-lite puedo realizar llamadas siempre que deshabilite donde dice "register whit domain and recive incoming calls" pero si no hago eso me da error 408

problema reciente

Imagen de kemrhi

bueno les cuento configure a2billing y tarifico bien por un tiempo, pero ahora hay llamadas que no tarifica, es decir aparece con duracion 00 aunque la llamada haya durado 10 minutos, no se la causa de esto ni por que comenzo a suceder, pero si es que alguien tiene una solucion que me avise

CALLBACK SOBRE TRIXBOX

Imagen de ernestomacdougall

Callback en trixbox

Buenas tardes raza metal, estoy aprendiendo a utilizar la función de callback en A2billing y no puedo configurarla misma, lo que necesito realizar es lo siguiente, tengo un TRIXBOX 2.2.12, con freepbx, y a2billing 1.3.4, además una placa DIGIUN con 4 puertos FXO, leo siempre el foro pero no encuentro la respuesta y no quería molestarte, pero debo hacerlo ya que solo no puedo. Bueno la llamada entraría por UNA LINEA DE TELOFONO en la placa DIGIUN, el sistema reconocería el numero de teléfono que ingresa, el usuario corta, después de dos o tres rings y a los segundos recibe otra llamada del Server, pidiéndole que ingrese el numero de pin que previamente tengo configurado con el troncal los rate card, los customer no así el CALLBACK. Bueno todo me funciona en la forma tradicional o sea, que entran y salen llamadas por el A2Billing y el trixbox, y la factura como debe de ser, pero lo del CALLBACK NO ME SALE.
Desde otro foro me enviaron esta respuesta pero no se si es la correcta ya que trate de ejecutarla pero no pude, ya que mis conocimientos no son tan grandes, aunque cree un sistema de tarjetas prepagas, que llaman a celulares sin crédito en argentina y a todos los destinos del mundo. Esta a disposición de Ustedes si quieren saber lo que necesita y como trabaja, ya que modestia aparte en el si me transforme en un experto. Pero en lo que se refiere al CALLBACK ahí no me sale nada.
Te agradecería que me ayudaras y lo mismo les pido a los usuarios del foro.
Desde ya muchísimas gracias y espero una respuesta que me sirva y entienda.
Saludos Cordiales.

ME HAN ENVIADO ESTA RESPUESTA, pero no puedo llevarla adelante:

He de suponer que estas usando system () para generar la llamada y lo estas enviando a un contexto "callback"

; extensions.conf
[desde-zap]
exten => 7777777,1,System("create_call_file.sh ${CALLERID(num)}")
exten => 7777777,n,Hangup
[callback]
exten => s,1,Answer
exten => s,n(num),Background(introdusca_numero)
exten => s,n,WaitExten(10)
exten => s,n,Goto(num)
exten => _X.,1,Dial(Zap/${EXTEN})

Lamento darte esta noticia:

Imagen de RazaMetaL

Lamento darte esta noticia: no he usado nunca el Callback de a2billing :( así que no sabría como ayudarte. Te recomiendo visites los foros de a2billing y hagas la pregunta ahí, es seguro que vas a tener varias respuestas.

------------

Antes de preguntar visita el [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:

 

[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]

-----

Visita este [url=http://www.sindominio.net/ayuda/preguntas-inteligentes.html]link[/url] :evil:

[img]http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg[/img]

(adsbygoogle = window.adsbygoogle || []).push({});

ayuda urgente a2billing

Mensaje:

hola raza metaL HE SEGUIDO TU GUIA PARA CONFIGURAR a2billing sin embargo no
he podido hacerlo funcionar , yo vivo en cali - colombia, necesito facturar
llamadas locales , utilizo la distribucion centos 5 , se que el problema es
con los prefijos ya que he revisado los post que han hecho en la pagina ,
sin enbargo por mas de que he intentado no he podido.

estoy utlizando freepbx 2.3.1 y a2billing 1.3.4 , asterisk 1.4.21.2

te adjunto mis archivos de asterisk y los de a2billing para que me
colabores gracias de antemano

este es el a2billing .conf

[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
;dbtype = postgres
dbtype = mysql

[global]
interval_len_cardnumber = 10-15
len_aliasnumber = 15
len_voucher = 15
base_currency = usd
invoice_image = asterisk01.jpg
didbilling_daytopay = 5
admin_email = areski@gmail.com

; MANAGER CONNECTION PARAMETERS
manager_host = localhost
manager_username = admin
manager_secret = amp111

; CALL-BACK
[callback]

context_callback = a2billing-callback
extension = 1000
sec_wait_before_callback = 10
sec_avoid_repeate = 30
timeout = 20
answer_call = no
nb_predictive_call = 10
nb_day_wait_before_retry = 1
context_preditctivedialer = a2billing-predictivedialer
predictivedialer_maxtime_tocall = 5400
callerid = 123456
all_callback_tariff = 1
id_server_group = 1
callback_audio_intro = prepaid-callback_intro

; CUSTOMISATION Of THE CUSTOMER INTERFACE
[webcustomerui]

signup_page_url =
paymentmethod = yes
personalinfo = yes
customerinfo = yes
sipiaxinfo = yes
cdr = yes
invoice = yes
voucher = yes
paypal = yes
speeddial = yes
did = yes
ratecard = yes
simulator = yes
callback = yes
predictivedialer = NO
webphone = no
webphoneserver = localhost
callerid = yes
password = yes
limit_callerid = 5
error_email = root@localhost
return_url_distant_login =
return_url_distant_forgetpassword =

;SIP & IAX client configuration information.
[sip-iax-info]

sip_iax_info_trunkname = call-labs
sip_iax_info_allowcodec = g729,ulaw,alaw,gsm
sip_iax_info_host = call-labs.com
iax_additional_parameters = "canreinvite = no"
sip_additional_parameters = "trustrpid = yes | sendrpid = yes |
canreinvite = no"

[epayment_method]

enable = yes
http_server = "http://www.call-labs.com"
https_server = "http://www.call-labs.com"
http_cookie_domain = 26.63.165.200
https_cookie_domain = 26.63.165.200
http_cookie_path = "/A2BCustomer_UI/"
https_cookie_path = "/A2BCustomer_UI/"
dir_ws_http_catalog = "/A2BCustomer_UI/"
dir_ws_https_catalog = "/A2BCustomer_UI/"
enable_ssl = yes
http_domain = 26.63.165.200
dir_ws_http = "/~areski/svn/a2billing/payment/A2BCustomer_UI/"
; payment_notify_url=...
purchase_amount = 1:2:5:10:20
item_name = "Credit Purchase"
currency_code = USD
paypal_payment_url = "https://secure.paypal.com/cgi-bin/webscr"
;paypal_payment_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"
paypal_verify_url = "ssl://www.paypal.com"
;paypal_verify_url = www.sandbox.paypal.com
authorize_payment_url =
"https://secure.authorize.net/gateway/transact.dll"
;authorize_payment_url =
"https://test.authorize.net/gateway/transact.dll"
store_name = Asterisk2Billing
transaction_key = asdf1212fasd121554sd4f5s45sdf
moneybookers_secretword = areski

[signup]

enable_signup = 1
enable_captcha = YES
credit = 0
callplan_id_list = 1, 2
activated = no
simultaccess = 0
typepaid = 0
creditlimit = 0
runservice = 0
enableexpire = 0
expirationdate =
expiredays = 0
sip_account = yes
iax_account = yes
activatedbyuser = no
urlcustomerinterface = http://localhost/A2BCustomer_UI/
reload_asterisk_if_sipiax_created = no

[backup]

backup_path = /tmp
gzip_exe = /bin/gzip
gunzip_exe = /bin/gunzip
mysqldump = /usr/bin/mysqldump
pg_dump = /usr/bin/pg_dump
mysql = /usr/bin/mysql
psql = /usr/bin/psql

; WEB INTERFACE AND API CONFIGURATION
[webui]

buddy_sip_file = /etc/asterisk/additional_a2billing_sip.conf
buddy_iax_file = /etc/asterisk/additional_a2billing_iax.conf
api_security_key = Ae87v56zzl34v
api_ip_auth = 127.0.0.1
email_admin = root@localhost
dir_store_mohmp3 = /var/lib/asterisk/mohmp3
num_musiconhold_class = 10
show_help = YES
my_max_file_size_import = 1024000 ; 1 MG
dir_store_audio = /var/lib/asterisk/sounds/a2billing
my_max_file_size_audio=3072000 ; in bytes
file_ext_allow = gsm, mp3, wav
file_ext_allow_musiconhold = mp3

; RECORDED CONVERSATIONS

link_audio_file = NO
monitor_path = /var/spool/asterisk/monitor
monitor_formatfile = gsm
show_icon_invoice = YES

;CURRENCY AND GENERAL SETTINGS

show_top_frame = NO
currency_choose = usd, eur, cad, hkd
card_export_field_list = id, username, useralias, lastname, credit,
tariff, activated, language, inuse, currency, sip_buddy, iax_buddy,
nbused, mac_addr
voucher_export_field_list = id, voucher, credit, tag, activated,
usedcardnumber, usedate, currency
advanced_mode = NO
delete_fk_card = yes

[peer_friend]
type = friend
allow = ulaw,alaw,gsm,g729
context = a2billing
nat = "yes"
amaflag = billing
qualify = "yes"
host = dynamic
dtmfmode = RFC2833

[log-files]
; To disable application logging, remove/comment the log file name aside
service

; cront - recurring process
cront_alarm = /tmp/cront_a2b_alarm.log
cront_autorefill = /tmp/cront_a2b_autorefill.log
cront_batch_process = /tmp/cront_a2b_batch_process.log
cront_bill_diduse = /tmp/cront_a2b_bill_diduse.log
cront_subscriptionfee = /tmp/cront_a2b_subscription_fee.log
cront_currency_update = /tmp/cront_a2b_currency_update.log
cront_invoice = /tmp/cront_a2b_invoice.log
cront_check_account = /tmp/cront_a2b_check_account.log

paypal = /tmp/a2billing_paypal.log
epayment = /tmp/a2billing_epayment.log
api_ecommerce = /tmp/api_ecommerce_request.log
api_callback = /tmp/api_callback_request.log
agi = /tmp/a2billing_agi.log

[agi-conf1]

; 0=none, 1=low, 2=normal, 3=all
debug = 3
asterisk_version = 1_4
answer_call = YES
play_audio = YES
say_goodbye = NO
play_menulanguage = NO
force_language = ES
intro_prompt =
min_credit_2call = 0
min_duration_2bill = 0
notenoughcredit_cardnumber = YES
notenoughcredit_assign_newcardnumber_cid = YES
use_dnid = YES
;no_auth_dnid = 2400,2300
number_try = 1
force_callplan_id =
say_balance_after_auth = NO
say_balance_after_call = NO
say_rateinitial = NO
say_timetocall = YES
auto_setcallerid = YES
force_callerid =
cid_sanitize = NO
cid_enable = NO
cid_askpincode_ifnot_callerid = YES
cid_auto_assign_card_to_cid = YES
cid_auto_create_card = NO
cid_auto_create_card_len = 10
cid_auto_create_card_typepaid = PREPAID
cid_auto_create_card_credit = 0
cid_auto_create_card_credit_limit = 1000
cid_auto_create_card_tariffgroup = 6
callerid_authentication_over_cardnumber = NO
sip_iax_friends = NO
;sip_iax_pstn_direct_call_prefix = 555
sip_iax_pstn_direct_call_prefix = 9
sip_iax_pstn_direct_call = YES
ivr_voucher = NO
ivr_voucher_prefix =
jump_voucher_if_min_credit = NO
extracharge_did =
;extracharge_fee = 0.02,0.03
extracharge_fee =
;extracharge_buyfee = 0.015,0.025
extracharge_buyfee =
international_prefixes =09

; More information about the Dial :
http://voip-info.org/wiki-Asterisk+cmd+dial
; 30 : The timeout parameter is optional. If not specifed, the Dial
command will wait indefinitely, exiting only when the originating channel
hangs up, or all the dialed channels return a busy or error condition.
Otherwise it specifies a maximum time, in seconds, that the Dial command
is to wait for a channel to answer.
; H: Allow the caller to hang up by dialing *
; r: Generate a ringing tone for the calling party
; g: When the called party hangs up, exit to execute more commands in the
current context. (new in 1.4)
; i: Asterisk will ignore any forwarding (302 Redirect) requests received.
Essential for DID usage to prevent fraud. (new in 1.4) Useful if you are
ringing a group of people and one person has set their phone to forwarded
direct to voicemail on their cell or something which normally prevents any
of the other phones from ringing.
; R: Indicate ringing to the calling party when the called party indicates
ringing, pass no audio until answered.
; m: Provide Music on Hold to the calling party until the called channel
answers.
; L(x[:y][:z]): Limit the call to 'x' ms, warning when 'y' ms are left,
repeated every 'z' ms)
; %timeout% tag is replaced by the calculated timeout according the
credit & destination rate!

;dialcommand_param = "|60|HRgrL(%timeout%:61000:30000)"
dialcommand_param = "|60|HLrC(%timeout%:61000:30000)"

; by default (3600000 = 1HOUR MAX CALL)
dialcommand_param_sipiax_friend = "|60|HRgirL(3600000:61000:30000)"

; Define the order to make the outbound call
; YES -> SIP/dialedphonenumber@gateway_ip - NO
SIP/gateway_ip/dialedphonenumber
; Both should work exactly the same but i experimented one case when
gateway was supporting dialedphonenumber@gateway_ip
; So in case of trouble, try it out

switchdialcommand = NO
failover_recursive_limit = 2
maxtime_tocall_negatif_free_route = 5400
send_reminder = NO

; enable to monitor the call (to record all the conversations)
; value : YES - NO
record_call = NO

; format of the recorded monitor file
monitor_formatfile = gsm

; Force to play the balance to the caller in a predefined currency, to use
the currency set for by the customer leave this field empty
agi_force_currency =

; CURRENCY SECTION
; Define all the audio (without file extensions) that you want to play
according to currency (use , to separate, ie
"usd:prepaid-dollar,mxn:pesos,eur:Euro,all:credit")
currency_association = usd:dollars,mxn:pesos,eur:euros,all:credit

; Please enter the file name you want to play when we prompt the calling
party to enter the destination number
; file_conf_enter_destination = prepaid-enter-number-u-calling-1-or-011
file_conf_enter_destination = prepaid-enter-dest

; Please enter the file name you want to play when we prompt the calling
party to choose the prefered language
; file_conf_enter_menulang = prepaid-menulang
file_conf_enter_menulang = prepaid-menulang2

; Define if you want to bill the 1st leg on callback even if the call is
not connected to the destination
callback_bill_1stleg_ifcall_notconnected = YES

-------------------------------------------------------------------------------------------------------

extensions_custom.conf

[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" =
"A2B/"]?a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
[a2billing]
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()

------------------------------------------------------------------------------------------------------

sip.conf

[general]
#include sip_general_additional.conf
; el de abajo es mi proveedor solo te muestro lo que dices en tu guia

[soluciones]
username=soluciones
type=friend
secret=soluciones
nat=yes
insecure=very
dtmfmode=rfc2833
host=192.168.221.247
fromuser=soluciones
fromdomain=192.168.221.247
context=default
canreinvite=no
disallow=all
allow=g729
allow=ulaw
allow=alaw

bindport = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
; If you need to answer unauthenticated calls, you should change this
; next line to 'from-trunk', rather than 'from-sip-external'.
; You'll know this is happening if when you call in you get a message
; saying "The number you have dialed is not in service. Please check the
; number and try again."
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
tos=0x68

; Reported as required for Asterisk 1.4
notifyringing=yes
notifyhold=yes
limitonpeers=yes

; enable and force the sip jitterbuffer. If these settings are desired
; they should be set in the sip_general_custom.conf file as this file
; will get overwritten during reloads and upgrades.
;
; jbenable=yes
; jbforce=yes

; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_general_custom.conf
#include sip_nat.conf
#include sip_registrations_custom.conf
#include sip_registrations.conf
#include sip_custom.conf
#include sip_additional.conf
#include sip_custom_post.conf
#include additional_a2billing_sip.conf

---------------------------------------------------------------------------------------------

iax.conf

[general]
bindport = 4569 ; Port to bind to (IAX is 4569)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
allow=gsm
mailboxdetail=yes

#include iax_general_custom.conf
#include iax_registrations_custom.conf
#include iax_registrations.conf
#include iax_custom.conf
#include iax_additional.conf
#include iax_custom_post.conf
#include additional_a2billing_iax.conf

--------------------------------------------------------------------------------------------
ahora te muestro lo que realice en el freepbx

cree una troncal(trunk) con los siguientes parametros:

maximum channels : 1
dial rules: 092NXXXXXX
094NXXXXXX
custom dial string: A2B/1

--------------------------------------------
cree una ruta de salida con las siguientes caracteristicas
route name : A2B/1
intraconpamyruote :palomeada , chuleada, aceptada como lo quieras llamar
dial patterns: 092NXXXXXX
094NXXXXXX

trunk secuence: A2B/1

---------------------------------------------------------------
te muestro lo que realice en a2billing

en trunk:
selecione provider y coloque lo siguiente :

provider name :soluciones
description: el mejor proveedor

posteriormente creee la trunk de la siguiente manera o forma :

voip -provider : soluciones
label: soluciones
remove prefix: 09
provider tech: zap ; no se si haya problema con zap , sin embargo he
tratado con sip y tampoco
povider ip: 192.168.221.247 o localhost

-----------------------------------------------------------------------------
en ratecard realice lo siguiente
creo el call plan:
name: el_mejor
remove interprefix: no

------------------------------
creo la ratecard de la siguiente manera :
tariffname: tarifa_plan_mejor
trunk: soluciones
dnid prefix: all
callerid prefix: all

--------------------------------------------------
ahora creo la rate de la siguiente manera :

ratecard: tarifa_plan_mejor
dialprefix: 094
destination: medellin
buying rate: 0.05
buying rate min duration: 6 ; coloque los parametros de tu guia
buyrate billing block: 30
selling rate: 0.1
sell rate min duration: 6
sellrate billing block: 30
conect charge : 0
disconect charge: 0
trunk: soluciones

--------------------------------------------------
luego en el callplan adicione la ratecard tarifa_plan_mejor

creo que hasta alli todo esta bien ,
despues fui a misc y adicione los siguiente prefijos

Medellin 4
cali 2

----------------------------------------------------
no se lo que pasa, esto es lo que he realizado creo que parecido a la
tuyo , tengo dudas si para sacar llamadas a la pstn o red publica
conmutada debo crear un proveedor sip cuando lo mas logico seria utlizar
un canal zap , tengo una tdm400p mi proveedor es telecom aqui en
colombia,desde una linea convecional solo marcamos 7 digitos a nivel de la
ciudad cuando llamamos a otra ciudad de colombia se marca 09 + el codigo de
la ciudad + mas el numero de 7 digitos por eso lo que hecho, te adjunto el
log, como te dije se cual es el error lo que te pido es que me ayudes a
modificar los parametros del asterisk y del a2billing para que funcione

---------------------------------------
log:

Set("SIP/101-08a6f930", "INTRACOMPANYROUTE=YES") in new stack
-- Executing [0943214685@from-internal:2] Macro("SIP/101-08a6f930",
"dialout-trunk|2|0943214685||") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("SIP/101-08a6f930",
"DIAL_TRUNK=2") in new stack
-- Executing [s@macro-dialout-trunk:2] Set("SIP/101-08a6f930",
"DIAL_NUMBER=0943214685") in new stack
-- Executing [s@macro-dialout-trunk:3] Set("SIP/101-08a6f930",
"ROUTE_PASSWD=") in new stack
-- Executing [s@macro-dialout-trunk:4] GotoIf("SIP/101-08a6f930",
"1?noauth") in new stack
-- Goto (macro-dialout-trunk,s,6)
-- Executing [s@macro-dialout-trunk:6] GotoIf("SIP/101-08a6f930",
"0?disabletrunk|1") in new stack
-- Executing [s@macro-dialout-trunk:7] Set("SIP/101-08a6f930",
"_NODEST=") in new stack
-- Executing [s@macro-dialout-trunk:8] Set("SIP/101-08a6f930",
"DIAL_TRUNK_OPTIONS=tr") in new stack
-- Executing [s@macro-dialout-trunk:9] Set("SIP/101-08a6f930",
"GROUP()=OUT_2") in new stack
-- Executing [s@macro-dialout-trunk:10] Macro("SIP/101-08a6f930",
"user-callerid|SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("SIP/101-08a6f930",
"user-callerid: device 101") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/101-08a6f930",
"AMPUSER=101") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/101-08a6f930",
"0?report") in new stack
-- Executing [s@macro-user-callerid:4] GotoIf("SIP/101-08a6f930",
"0?start") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/101-08a6f930",
"REALCALLERIDNUM=101") in new stack
-- Executing [s@macro-user-callerid:6] NoOp("SIP/101-08a6f930",
"REALCALLERIDNUM is 101") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/101-08a6f930",
"AMPUSER=101") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/101-08a6f930",
"AMPUSERCIDNAME=andres") in new stack
-- Executing [s@macro-user-callerid:9] GotoIf("SIP/101-08a6f930",
"0?report") in new stack
-- Executing [s@macro-user-callerid:10] Set("SIP/101-08a6f930",
"AMPUSERCID=101") in new stack
-- Executing [s@macro-user-callerid:11] Set("SIP/101-08a6f930",
"CALLERID(all)="andres" <101>") in new stack
-- Executing [s@macro-user-callerid:12] Set("SIP/101-08a6f930",
"REALCALLERIDNUM=101") in new stack
-- Executing [s@macro-user-callerid:13] NoOp("SIP/101-08a6f930", "TTL:
ARG1: SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("SIP/101-08a6f930",
"1?continue [0;37;40m") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("SIP/101-08a6f930",
"Using CallerID "andres" <101>") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("SIP/101-08a6f930",
"record-enable|101|OUT") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("SIP/101-08a6f930",
"0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("SIP/101-08a6f930",
"recordingcheck|20081202-112648|1228235208.1") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20081202-112648|1228235208.1: Outbound recording not
enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] NoOp("SIP/101-08a6f930", "No
recording needed") in new stack
-- Executing [s@macro-dialout-trunk:12] GotoIf("SIP/101-08a6f930",
"1?skipoutcid") in new stack
-- Goto (macro-dialout-trunk,s,15)
-- Executing [s@macro-dialout-trunk:15] GotoIf("SIP/101-08a6f930",
"0?nomax") in new stack
-- Executing [s@macro-dialout-trunk:16] GotoIf("SIP/101-08a6f930",
"0?chanfull") in new stack
-- Executing [s@macro-dialout-trunk:17] AGI("SIP/101-08a6f930",
"fixlocalprefix") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
> fixlocalprefix: Using pattern 092NXXXXXX
> fixlocalprefix: Using pattern 094NXXXXXX
== fixlocalprefix: Dialpattern 094NXXXXXX matched. 0943214685 ->
0943214685
-- AGI Script fixlocalprefix completed, returning 0
-- Executing [s@macro-dialout-trunk:18] Set("SIP/101-08a6f930",
"OUTNUM=0943214685") in new stack
-- Executing [s@macro-dialout-trunk:19] Set("SIP/101-08a6f930",
"custom=AMP") in new stack
-- Executing [s@macro-dialout-trunk:20] GotoIf("SIP/101-08a6f930",
"1?gocall [0;37;40m") in new stack
-- Goto (macro-dialout-trunk,s,22)
-- Executing [s@macro-dialout-trunk:22] Macro("SIP/101-08a6f930",
"dialout-trunk-predial-hook") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1]
GotoIf("SIP/101-08a6f930", "1?a2billing|0943214685|1:2") in new stack
-- Goto (a2billing,0943214685,1)
== Channel 'SIP/101-08a6f930' jumping out of macro
'dialout-trunk-predial-hook'
== Channel 'SIP/101-08a6f930' jumping out of macro 'dialout-trunk'
-- Executing [0943214685@a2billing:1] DeadAGI("SIP/101-08a6f930",
"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] => 3
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] => ES
a2billing.php|1: [intro_prompt] =>
a2billing.php|1: [min_credit_2call] => 0
a2billing.php|1: [min_duration_2bill] => 0
a2billing.php|1: [notenoughcredit_cardnumber] => 1
a2billing.php|1: [notenoughcredit_assign_newcardnumber_cid] => 1
a2billing.php|1: [use_dnid] => 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] => 1
a2billing.php|1: [auto_setcallerid] => 1
a2billing.php|1: [force_callerid] =>
a2billing.php|1: [cid_sanitize] =>
a2billing.php|1: [cid_enable] =>
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] => PREPAID
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] => 9
a2billing.php|1: [sip_iax_pstn_direct_call] => 1
a2billing.php|1: [ivr_voucher] =>
a2billing.php|1: [ivr_voucher_prefix] =>
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] => 09
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: [dialcommand_param] =>
|60|HLrC(%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/101-08a6f930
a2billing.php|1: [agi_language] => en
a2billing.php|1: [agi_type] => SIP
a2billing.php|1: [agi_uniqueid] => 1228235208.1
a2billing.php|1: [agi_callerid] => 101
a2billing.php|1: [agi_calleridname] => andres
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] => 0943214685
a2billing.php|1: [agi_rdnis] => unknown
a2billing.php|1: [agi_context] => a2billing
a2billing.php|1: [agi_extension] => 0943214685
a2billing.php|1: [agi_priority] => 1
a2billing.php|1: [agi_enhanced] => 0.0
a2billing.php|1: [agi_accountcode] => 5234815139
a2billing.php|1: )
a2billing.php|1:
a2billing.php|1: file:Class.A2Billing.php - line:621 -
get_agi_request_parameter = 101 ; SIP/101-08a6f930 ; 1228235208.1 ;
5234815139 ; 0943214685
a2billing.php|1: file:a2billing.php - line:141 - [ANSWER CALL]
a2billing.php|1: file:Class.A2Billing.php - line:590 - FORCE LANGUAGE :
ES
a2billing.php|1: file:Class.A2Billing.php - line:599 - [SET
CHANNEL(language) es]
a2billing.php|1: file:Class.A2Billing.php - line:1640 - SELECT credit,
tariff, activated, inuse, simultaccess, typepaid, creditlimit, language,
removeinterprefix, 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_card LEFT JOIN cc_tariffgroup ON
tariff=cc_tariffgroup.id WHERE username='5234815139'
a2billing.php|1: file:Class.A2Billing.php - line:654 - [CARD STATUS
UPDATE : UPDATE cc_card SET inuse=inuse+1 WHERE username='5234815139']
a2billing.php|1: file:Class.A2Billing.php - line:1400 - [AUTO
SetCallerID]
a2billing.php|1: file:Class.A2Billing.php - line:1406 - [REQUESTED
SetCallerID : 101]
a2billing.php|1: file:Class.A2Billing.php - line:1417 - [EXEC
SetCallerID : 101]
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 ::>
0943214685
a2billing.php|1: file:Class.A2Billing.php - line:703 - RULES APPLY ON
DESTINATION ::> 0943214685
a2billing.php|1: file:Class.A2Billing.php - line:741 - OK -
RESFINDRATE::> 1
a2billing.php|1: file:Class.A2Billing.php - line:763 -
RES_ALL_CALCULTIMEOUT ::> 1
a2billing.php|1: file:Class.A2Billing.php - line:780 - TIMEOUT::> 6000
: minutes=100 - seconds=0
-- Playing 'prepaid-you-have' (escape_digits=#) (sample_offset 0)
-- Playing 'digits/100' (language 'es')
-- Playing 'prepaid-minutes' (escape_digits=#) (sample_offset 0)
a2billing.php|1: file:Class.RateEngine.php - line:1012 -
app_callingcard: Dialing
'ZAP/192.168.221.247/43214685|60|HLrC(6000000:61000:30000)' with timeout
of '6000'.
a2billing.php|1:
a2billing.php|1: file:Class.RateEngine.php - line:1037 -
app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.
-- AGI Script Executing Application: (Dial) Options:
(ZAP/192.168.221.247/43214685|60|HLrC(6000000:61000:30000))
== Everyone is busy/congested at this time (1:0/0/1)
a2billing.php|1: file:Class.RateEngine.php - line:1148 - [USEDRATECARD -
FAIL =0]
-- Playing 'prepaid-dest-unreachable' (escape_digits=#) (sample_offset
0)
a2billing.php|1: file:Class.RateEngine.php - line:899 -
[CC_asterisk_stop QUERY = INSERT INTO cc_call
(uniqueid,sessionid,username,nasipaddress,starttime,sessiontime,
calledstation, terminatecause, stoptime, calledrate, sessionbill,
calledcountry, calledsub, destination, id_tariffgroup, id_tariffplan,
id_ratecard, id_trunk, src, sipiax, buyrate, buycost,
id_card_package_offer) VALUES ('1228235208.1', 'SIP/101-08a6f930',
'5234815139', '', CURRENT_TIMESTAMP - INTERVAL 0 SECOND , '0',
'0943214685', 'CHANUNAVAIL', now(), '0.1', '-0', '', '', 'medellin', '2',
'3', '2', '4', '101', '0', '0.05', '0', '0')]
a2billing.php|1: file:Class.RateEngine.php - line:902 -
[CC_asterisk_stop 1.1: SQL: DONE : result=1]
a2billing.php|1: file:a2billing.php - line:312 - [a2billing account
stop]
a2billing.php|1: file:Class.A2Billing.php - line:654 - [CARD STATUS
UPDATE : UPDATE cc_card SET inuse=inuse-1 WHERE username='5234815139']
-- AGI Script a2billing.php completed, returning 0

------------------------------------------------
ahh no te preocupes creee el costumer y le agregue el codigo o numero de
la tarjeta a una cuenta sip creada en el freepbx es la extension 101
---------------------------------------------------
te adjunto
lo del customer por si las moscas
card number : xxxxxxxxxx; el numero que me genero que se lo
asigne a laextension
card alias 101
webui password: xxx; el que le asigne
language: spanish
call plan: el_mejor
currency: cop; peso colombiano
card type: prepaid card
sip account : yes
iax account : yes

-----------------------------------------------------------------------

creo que esoes todo lo que necesitarias para solucionar mi problema
gracias de antemano y espero pronta solucion graciaaaaaaassssss

marowak

Páginas