CDR in a different host


#1

hi every body

i have installed asterisk and configured CDR.
Now i want to put the CDR in a different serveur. Can you help me ?
I changed /etc/asterisk/asterisk.conf by changing the path of the files log (astlogdir => root@x.x.x.x:/var/log/asterisk), but nothing.

help me please. thanks you.
Aicha


#2

edit: misread your post - i was thinking you were already logging to a db.

one thing you MIGHT try would be to create a mount point to another server and point the conf file to your newly created share - that should work.

end edit…

i think you’ll want to edit the cdr_mysql.conf file and change the hostname and login information to point to your external server.

[global] hostname=hostname_goes_here dbname=asterisk table=cdr password=dbpassword user=asterisk port=3306 sock=/tmp/mysql.sock userfield=1


#3

Hi Aicha,

I doubt you can do that with flat file(csv). Try logging to a db instead.

Regards


#4

thanks you very much.
but i also changed cdr_mysql.conf
it is the first things i do

[color=green] hostname=81.192.xxx.xxx
dbname=asterisk
password=************
user=***************
port=3306
;sock=/tmp/mysql.sock
;userfield=1[/color]

but it does not work ?
thanks you to help me !
aicha


#5

Hi
i forgot to tell you that the 2 servers are in different networks !
should i wrote :
[color=green]hostname=81.192.xxx.xxx:portNumber ?[/color]
thanks
aicha


#6

i would make sure you can connect to the remote server through the mysql client (outside of asterisk) first - this may just be a permissions/network issue. once you can connect to the remote database from your asterisk box and issue queries, i think you would be good to go…


#7

“port=3306” is correct.

You can refer to the links below for MySQL cdr -

voip-info.org/wiki-Asterisk+cdr+mysql
voip-info.org/wiki-Asterisk+ … mysql.conf

There are lots of possible reasons why logging fail. It would certainly help if you can provide more info what diagnostic action(s) were taken to narrow down the possibilities. Otherwise, it would be difficult.


#8

thanks you !
i will try all the possibilities you tell me tommorow.bye.
thanks.


#9

hi ,
I don’t know what is the problem. I try to connect to my MySql server via another machin in another network and it is ok. but when I try to point the data of CDR in this database, il doesn’t work !

Last time, you tell me that I should put the hostname of the distant server in the file cdr_mysql.conf. Can I put there 81.192.xxx.xxx ? because hostname is a string ?
should I put the hostname in the distant server only ? or in the local server too ?

thanks to help me
Aicha


#10

hi,
the local server is in a private network. so I wrote in the file cdr_mysql.conf which is the distant server : 81.192.xxx.xxx . this adress is the IP adress of my internet access but we have many computers here.
so what can I do to tell to the distant server that it is my computer not another computer ?
thanks you very much to help me.
Aicha


#11

you need to edit the file
/etc/asterisk/res_mysql.conf

as well… :wink:


#12

Hi Aicha,

I have to admit that I am really confused after reading your last 2 posts.

Firstly, don’t understand why you tested connecting to the MySQL CDR server with another machine from another network? If the objective is to log from Asterisk to a remote CDR server, then the diagnosis should be conducted with the relevant systems to get the intended results.

I had not tried with MySQL, but had tested with PGSQL logging to a remote CDR in the same private subnet. Both hostname and ip worked IIRC with the conf file.

CDR logging are essentially inserts if I am not wrong. Therefore you should test sending insert queries with mysql client, from the Asterisk server to the remote CDR db, with the same credentials as you would with Asterisk. The problem could be with grants. If it’s working, then check if the cdr_mysql.so module is loaded with “show modules” from Asterisk cli. Check with “cdr status” next. Finally, you could use tools like tcpdump and ethereal to analyse the traffic during logging.

As mentioned earlier, “There are lots of possible reasons why logging fail”:slight_smile:


#13

Hi ,
I am sorry but english is not my mother’s tongue . It is why I make many mistakes and I find difficulties to exprim myself :smiley:
I will try many possibilities this aftenoon and after I will tell you.

thanks you
Aicha


#14

I can tell from your posts that you have difficulty explaining you situation:)

That’s ok, but my emphasis is on the analytic approach in dealing with the issue. It’s important as most or all of us can only help you over the Internet.

Also, try reading thru’ at least once before posting. Useful in my case, especially when some of my posts/emails/messages did not even make sense when I looked at them:)


#15

Hi
i found that cdr_mysql.so is not load in the local server.
I write
[color=green]load => cdr_mysql.so
load => res_mysql.so[/color]
in the files /etc/asterisk/modules.conf
but is does not resolve the problem. Do you know how can I load theses modules???

Thanks you
Aicha


#16

Make sure you have

[modules]
autoload=yes

in your MODULES.CONF

and the asterisk addons installed
( asterisk.org/ )


#17

Hi
[color=green][modules]
autoload=yes[/color]
[color=green]and astetisk_addons is installed.[/color]
But i haven’t MySql installed in the local server ( between others reasons, it is why I want to have the CDR in another computer ). MySql is installed in the distant server. Is it a problem ? Is it why res_mysql.so can not be loaded ?

Thanks
Aicha


#18

No, shouldnt be a problem.

All the res_mysql is doing while loaded is to connect to the sql server.

So make sure its not using socks and you have actually access to the server.

Can you connect to the mysql server with other tools/prompt from that machine ?

Can you post the result from the CLI when doing a
RELOAD
command ?

There is a line stating the state of the mysql connection.

You can use “Putty” and change the buffer to 2000 lines, so you dont loose any lines. Also you can have putty logging all output to a file or/and copying it to the clipboard.


#19

result of reload command

[color=green]localhostCLI> reload
== Parsing ‘/etc/asterisk/extconfig.conf’: Found
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/cdr.conf’: Found
Apr 13 17:03:12 NOTICE[17960]: cdr.c:1187 do_reload: CDR simple logging enabled.
== Parsing ‘/etc/asterisk/enum.conf’: Found
== Parsing ‘/etc/asterisk/rtp.conf’: Found
== RTP Allocating from port range 10000 -> 20000
== Parsing ‘/etc/asterisk/dnsmgr.conf’: Found
– Reloading module ‘res_musiconhold.so’ (Music On Hold Resource)
== Parsing ‘/etc/asterisk/musiconhold.conf’: Found
– Reloading module ‘res_indications.so’ (Indications Configuration)
– Unregistered indication country ‘at’
– Unregistered indication country ‘au’
– Unregistered indication country ‘br’
– Unregistered indication country ‘be’
– Unregistered indication country ‘ch’
– Unregistered indication country ‘cl’
– Unregistered indication country ‘cn’
– Unregistered indication country ‘cz’
– Unregistered indication country ‘de’
– Unregistered indication country ‘dk’
– Unregistered indication country ‘ee’
– Unregistered indication country ‘es’
– Unregistered indication country ‘fi’
– Unregistered indication country ‘fr’
– Unregistered indication country ‘gr’
– Unregistered indication country ‘hu’
– Unregistered indication country ‘it’
– Unregistered indication country ‘lt’
– Unregistered indication country ‘mx’
– Unregistered indication country ‘nl’
– Unregistered indication country ‘no’
– Unregistered indication country ‘nz’
– Unregistered indication country ‘pl’
– Unregistered indication country ‘pt’
– Unregistered indication country ‘ru’
– Unregistered indication country ‘se’
– Unregistered indication country ‘sg’
– Unregistered indication country 'uk’
Apr 13 17:03:12 NOTICE[17960]: indications.c:505 ast_unregister_indication_country: Removed default indication country ‘us’
– Unregistered indication country ‘us’
– Unregistered indication country ‘us-o’
– Unregistered indication country ‘tw’
– Unregistered indication country ‘za’
== Parsing ‘/etc/asterisk/indications.conf’: Found
– Registered indication country ‘at’
– Registered indication country ‘au’
– Registered indication country ‘br’
– Registered indication country ‘be’
– Registered indication country ‘ch’
– Registered indication country ‘cl’
– Registered indication country ‘cn’
– Registered indication country ‘cz’
– Registered indication country ‘de’
– Registered indication country ‘dk’
– Registered indication country ‘ee’
– Registered indication country ‘es’
– Registered indication country ‘fi’
– Registered indication country ‘fr’
– Registered indication country ‘gr’
– Registered indication country ‘hu’
– Registered indication country ‘it’
– Registered indication country ‘lt’
– Registered indication country ‘mx’
– Registered indication country ‘nl’
– Registered indication country ‘no’
– Registered indication country ‘nz’
– Registered indication country ‘pl’
– Registered indication country ‘pt’
– Registered indication country ‘ru’
– Registered indication country ‘se’
– Registered indication country ‘sg’
– Registered indication country ‘uk’
– Registered indication country ‘us’
– Registered indication country ‘us-o’
– Registered indication country ‘tw’
– Registered indication country ‘za’
– Setting default indication country to ‘us’
– Reloading module ‘res_adsi.so’ (ADSI Resource)
== Parsing ‘/etc/asterisk/adsi.conf’: Found
– Reloading module ‘res_features.so’ (Call Features Resource)
== Parsing ‘/etc/asterisk/features.conf’: Found
– Added extension ‘700’ priority 1 to parkedcalls
– Reloading module ‘res_crypto.so’ (Cryptographic Digital Signatures)
– Reloading module ‘pbx_config.so’ (Text Extension Configuration)
== Parsing ‘/etc/asterisk/extensions.conf’: Found
== Setting global variable ‘CONSOLE’ to ‘Console/dsp’
== Setting global variable ‘IAXINFO’ to ‘guest’
== Setting global variable ‘TRUNK’ to ‘Zap/g2’
== Setting global variable ‘TRUNKMSD’ to ‘1’
– Registered extension context ‘dundi-e164-canonical’
– Registered extension context ‘dundi-e164-customers’
– Registered extension context ‘dundi-e164-via-pstn’
– Registered extension context ‘dundi-e164-local’
– Including context ‘dundi-e164-canonical’ in context ‘dundi-e164-local’
– Including context ‘dundi-e164-customers’ in context ‘dundi-e164-local’
– Including context ‘dundi-e164-via-pstn’ in context ‘dundi-e164-local’
– Registered extension context ‘dundi-e164-switch’
– Including switch ‘DUNDi/e164’ in context ‘dundi-e164-switch’
– Registered extension context ‘dundi-e164-lookup’
– Including context ‘dundi-e164-local’ in context ‘dundi-e164-lookup’
– Including context ‘dundi-e164-switch’ in context ‘dundi-e164-lookup’
– Registered extension context ‘macro-dundi-e164’
– Added extension ‘s’ priority 1 to macro-dundi-e164
– Including context ‘dundi-e164-lookup’ in context ‘macro-dundi-e164’
– Registered extension context ‘iaxtel700’
– Added extension ‘_91700XXXXXXX’ priority 1 to iaxtel700
– Registered extension context ‘iaxprovider’
– Registered extension context ‘trunkint’
– Added extension ‘_9011.’ priority 1 to trunkint
– Added extension ‘_9011.’ priority 2 to trunkint
– Registered extension context ‘trunkld’
– Added extension ‘_91NXXNXXXXXX’ priority 1 to trunkld
– Added extension ‘_91NXXNXXXXXX’ priority 2 to trunkld
– Registered extension context ‘trunklocal’
– Added extension ‘_9NXXXXXX’ priority 1 to trunklocal
– Registered extension context ‘trunktollfree’
– Added extension ‘_91800NXXXXXX’ priority 1 to trunktollfree
– Added extension ‘_91888NXXXXXX’ priority 1 to trunktollfree
– Added extension ‘_91877NXXXXXX’ priority 1 to trunktollfree
– Added extension ‘_91866NXXXXXX’ priority 1 to trunktollfree
– Registered extension context ‘international’
– Including context ‘longdistance’ in context ‘international’
– Including context ‘trunkint’ in context ‘international’
– Registered extension context ‘longdistance’
– Including context ‘local’ in context ‘longdistance’
– Including context ‘trunkld’ in context ‘longdistance’
– Registered extension context ‘local’
– Including context ‘default’ in context ‘local’
– Including context ‘parkedcalls’ in context ‘local’
– Including context ‘trunklocal’ in context ‘local’
– Including context ‘iaxtel700’ in context ‘local’
– Including context ‘trunktollfree’ in context ‘local’
– Including context ‘iaxprovider’ in context ‘local’
– Added extension ‘111’ priority 1 to local
– Added extension ‘222’ priority 1 to local
– Registered extension context ‘macro-stdexten’
– Added extension ‘s’ priority 1 to macro-stdexten
– Added extension ‘s’ priority 2 to macro-stdexten
– Added extension ‘s-NOANSWER’ priority 1 to macro-stdexten
– Added extension ‘s-NOANSWER’ priority 2 to macro-stdexten
– Added extension ‘s-BUSY’ priority 1 to macro-stdexten
– Added extension ‘s-BUSY’ priority 2 to macro-stdexten
– Added extension ‘_s-.’ priority 1 to macro-stdexten
– Added extension ‘a’ priority 1 to macro-stdexten
– Registered extension context ‘macro-stdPrivacyexten’
– Added extension ‘s’ priority 1 to macro-stdPrivacyexten
– Added extension ‘s’ priority 2 to macro-stdPrivacyexten
– Added extension ‘s-NOANSWER’ priority 1 to macro-stdPrivacyexten
– Added extension ‘s-NOANSWER’ priority 2 to macro-stdPrivacyexten
– Added extension ‘s-BUSY’ priority 1 to macro-stdPrivacyexten
– Added extension ‘s-BUSY’ priority 2 to macro-stdPrivacyexten
– Added extension ‘s-DONTCALL’ priority 1 to macro-stdPrivacyexten
– Added extension ‘s-TORTURE’ priority 1 to macro-stdPrivacyexten
– Added extension ‘_s-.’ priority 1 to macro-stdPrivacyexten
– Added extension ‘a’ priority 1 to macro-stdPrivacyexten
– Registered extension context ‘demo’
– Added extension ‘s’ priority 1 to demo
– Added extension ‘s’ priority 2 to demo
– Added extension ‘s’ priority 3 to demo
– Added extension ‘s’ priority 4 to demo
– Added extension ‘s’ priority 5 to demo
– Added extension ‘s’ priority 6 to demo
– Added extension ‘s’ priority 7 to demo
– Added extension ‘2’ priority 1 to demo
– Added extension ‘2’ priority 2 to demo
– Added extension ‘3’ priority 1 to demo
– Added extension ‘3’ priority 2 to demo
– Added extension ‘1000’ priority 1 to demo
– Added extension ‘1234’ priority 1 to demo
– Added extension ‘1234’ priority 2 to demo
– Added extension ‘1235’ priority 1 to demo
– Added extension ‘1236’ priority 1 to demo
– Added extension ‘1236’ priority 2 to demo
– Added extension ‘#’ priority 1 to demo
– Added extension ‘#’ priority 2 to demo
– Added extension ‘t’ priority 1 to demo
– Added extension ‘i’ priority 1 to demo
– Added extension ‘500’ priority 1 to demo
– Added extension ‘500’ priority 2 to demo
– Added extension ‘500’ priority 3 to demo
– Added extension ‘500’ priority 4 to demo
– Added extension ‘600’ priority 1 to demo
– Added extension ‘600’ priority 2 to demo
– Added extension ‘600’ priority 3 to demo
– Added extension ‘600’ priority 4 to demo
– Added extension ‘8500’ priority 1 to demo
– Added extension ‘8500’ priority 2 to demo
– Registered extension context ‘default’
– Including context ‘demo’ in context ‘default’
– Reloading module ‘pbx_dundi.so’ (Distributed Universal Number Discovery (DUNDi))
== Parsing ‘/etc/asterisk/dundi.conf’: Found
– Reloading module ‘pbx_ael.so’ (Asterisk Extension Language Compiler)
– Registered extension context ‘macro-std-exten-ael’
– Added extension ‘s’ priority 1 to macro-std-exten-ael
– Added extension ‘s’ priority 2 to macro-std-exten-ael
– Added extension ‘s’ priority 3 to macro-std-exten-ael
– Added extension ‘s’ priority 4 to macro-std-exten-ael
– Added extension ‘s’ priority 5 to macro-std-exten-ael
– Added extension ‘sw-4-BUSY’ priority 1 to macro-std-exten-ael
– Added extension ‘sw-4-BUSY’ priority 2 to macro-std-exten-ael
– Added extension ‘_sw-4-.’ priority 1 to macro-std-exten-ael
– Added extension ‘a’ priority 1 to macro-std-exten-ael
– Added extension ‘a’ priority 2 to macro-std-exten-ael
– Registered extension context ‘ael-demo’
– Added extension ‘s’ priority 1 to ael-demo
– Added extension ‘s’ priority 2 to ael-demo
– Added extension ‘s’ priority 3 to ael-demo
– Added extension ‘s’ priority 4 to ael-demo
– Added extension ‘s’ priority 5 to ael-demo
– Added extension ‘s’ priority 6 to ael-demo
– Added extension ‘s’ priority 8 to ael-demo
– Added extension ‘s’ priority 9 to ael-demo
– Added extension ‘s’ priority 10 to ael-demo
– Added extension ‘s’ priority 11 to ael-demo
– Added extension ‘s’ priority 12 to ael-demo
– Added extension ‘s’ priority 7 to ael-demo
– Added extension ‘2’ priority 1 to ael-demo
– Added extension ‘2’ priority 2 to ael-demo
localhost
CLI>
[/color]
Thanks
Aicha


#20

result of cdr status

[color=green]localhostCLI> cdr status
CDR logging: enabled
CDR mode: simple
CDR registered backend: cdr-custom
CDR registered backend: cdr_manager
CDR registered backend: csv
localhost
CLI>[/color]

Thanks
Aicha