Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 3:44 pm
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Callback-daemon failing to start...
PostPosted: Wed Aug 08, 2007 2:58 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Hello All,

What is the solution for this problem: -

Code:
[root@connect1]# service a2billing-callback-daemon start
Can't call method "val" on an undefined value at /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon line 25.
Starting a2billing-callback-daemon:                        [FAILED]
[root@connect1]#



I checked my a2billing.conf and I don't have any ":" as a comment. Can anyone help?

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 7:27 pm 
Offline

Joined: Fri Apr 28, 2006 5:11 am
Posts: 426
try this:
Code:
perl -MCPAN -e shell
install Config::IniFiles
exit


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 8:04 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Thanks man...

Try that but still didn't work...

Code:
cpan> install Config::IniFiles
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Mon, 06 Aug 2007 22:48:24 GMT
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
  Database was generated on Mon, 06 Aug 2007 22:48:24 GMT
CPAN: HTTP::Date loaded ok

  There's a new CPAN.pm version (v1.9102) available!
  [Current version is v1.7602]
  You might want to try
    install Bundle::CPAN
    reload cpan
  without quitting the current session. It should be a seamless upgrade
  while we are running...

Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Config::IniFiles is up to date.

cpan> exit


And when I try to start... this is what I get...

Code:
[root@hyperion callback-daemon]# service a2billing-callback-daemon start
Can't call method "val" on an undefined value at /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon line 25.
Starting a2billing-callback-daemon:                        [FAILED]
[root@hyperion callback-daemon]#


I am following the same steps as explained in "Callback-Install.info" file. Anything else to do... Please help...

I am running CentOS 4.5 with Asterisk 1.2.18 and Asterisk2Billing - Version 1.3.0 (Yellowjacket) - Release : July 2007

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 10:14 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Even after much futzing around with permissions and bad syntax in a2billing.conf I can't make the callback daemon bail out in the same manner as yours.

I'm fairly certain the problem is either the content or the permissions of /etc/asterisk/a2billing.conf.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 12:00 am 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Thanks man...

I gave full permission to a2billing.conf
Code:
[root@hyperion asterisk]# ls -l a2billing.conf
-rwxrwxrwx  1 root root 30718 Aug  8 11:13 a2billing.conf
[root@hyperion asterisk]#


But same problem occur...

Cheers,
Nitesh


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 2:08 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Can anyone please help here... I have tried everything but still the callback-daemon is failing to start.

Please help...

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 6:04 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
What happens if you launch it directly, rather than using the init script?
Quote:
trunk asterisk2billing # /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon


If you just get the prompt back check it's running:
Quote:
trunk asterisk2billing # ps faux | grep callback
root 26450 0.0 0.0 1632 496 pts/2 S+ 18:58 0:00 \_ grep --colour=auto callback
root 26447 0.0 0.1 8012 5280 ? Ss 18:58 0:00 /usr/bin/perl -w /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon


And check for recent entries in the logfile:
Quote:
trunk asterisk2billing # tail -n 10 /var/log/asterisk/a2billing-daemon-callback.log

[2007-08-09 18:58:23][DAEMON START FORK]

[2007-08-09 18:58:23] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-08-09 18:58:30] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 6:11 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Thanks man...

Same problem: -
Code:
[root@hyperion nitesh]# /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon
Can't call method "val" on an undefined value at /var/lib/asterisk/a2billing/callback-daemon/a2billing-callback-daemon line 25.
[root@hyperion nitesh]#


I even "recompile Config::IniFiles", but that didn't help... The only option I am thinking right now is to remove perl completely and install it again. But I am thinking what if it breaks something else then I will be sitting duck.

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 6:29 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I don't know if you can spot anything important that's different for your perl -V:
Code:
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=linux, osvers=2.6.17-vs2.0.2-gentoo, archname=i686-linux
    uname='linux rw 2.6.17-vs2.0.2-gentoo #1 smp thu sep 21 16:06:48 local time zone must be set--see zic i686 intel(r) xeon(tm) cpu 3.20ghz gnulinux '
    config_args='-des -Darchname=i686-linux -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-O2 -march=pentium4 -pipe -fomit-frame-pointer -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/i686-linux 5.8.2 5.8.2/i686-linux 5.8.4 5.8.4/i686-linux 5.8.5 5.8.5/i686-linux 5.8.6 5.8.6/i686-linux 5.8.7 5.8.7/i686-linux  -Dcf_by=Gentoo -Ud_csh -Dusenm -Ui_ndbm -Ui_gdbm -Di_db'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='i686-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=pentium4 -pipe -fomit-frame-pointer',
    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement'
    ccversion='', gccversion='4.1.1 (Gentoo 4.1.1)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='i686-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.4'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO
  Built under linux
  Compiled at Sep 26 2006 03:27:50
  @INC:
    /etc/perl
    /usr/lib/perl5/vendor_perl/5.8.8/i686-linux
    /usr/lib/perl5/vendor_perl/5.8.8
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/site_perl/5.8.8/i686-linux
    /usr/lib/perl5/site_perl/5.8.8
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/5.8.8/i686-linux
    /usr/lib/perl5/5.8.8
    /usr/local/lib/site_perl
    .


I'm stumped. Sorry man.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 6:42 pm 
Offline

Joined: Fri Apr 28, 2006 5:11 am
Posts: 426
hey neel_007, you can fix it by dirty but quickly hack:
just replace all lines with 'val' to lines like this:
mysql_port = 3306 and so on.. this WILL WORK. if you understand the idea. i can't explain better, sorry.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 7:15 pm 
Offline

Joined: Thu Oct 19, 2006 9:56 am
Posts: 300
Location: Athens, Greece
My €0,05 (in cash, please):

From 'man Config::Inifiles'

Quote:
new ( [-option=>value ...] )

Returns a new configuration object (or "undef" if the configuration
file has an error). One Config::IniFiles object is required per con-
figuration file. The following named parameters are available:

-file filename


So, if $cfg is undef, as you say, there is a syntax error in your .conf file !

also..
Quote:
DIAGNOSTICS
@Config::IniFiles::errors

Contains a list of errors encountered while parsing the configuration
file. If the new method returns undef, check the value of this to find
out what's wrong. This value is reset each time a config file is read.


thus, we have:


Code:
diff --git a/CallBack/callback-daemon/a2billing-callback-daemon b/CallBack/callback-daemon/a2billing-callback-daemon
index 8b64cb5..d34a5ec 100755
--- a/CallBack/callback-daemon/a2billing-callback-daemon
+++ b/CallBack/callback-daemon/a2billing-callback-daemon
@@ -21,6 +21,14 @@ my $conf_file = "/etc/asterisk/a2billing.conf";
# Read the config file
my $cfg = Config::IniFiles->new( -file => $conf_file );

+if (not defined $cfg) {
+       print "Failed to parse $conf_file: \n";
+       foreach(@Config::IniFiles::errors) {
+               print "Error: $_\n" ;
+       }
+       exit(1);
+}
+
######################### DB PARAMETER ########################
my $dbname = $cfg->val('database', 'dbname');
my $dbhost = $cfg->val('database', 'hostname');



Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 7:17 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Nice fix xrg!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 09, 2007 7:58 pm 
Offline
User avatar

Joined: Tue Jun 19, 2007 1:33 pm
Posts: 52
Location: Troy, Michigan
Now thats a smart fix... Awesome Xrg... it found 4 errors in a2billing.conf under language option line 681. It had some bizzare characters...

Thanks a million...

Cheers,
Neel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 4:12 pm 
Offline

Joined: Sun Mar 12, 2006 2:49 pm
Posts: 954
Location: Barcelona
Patch committed in revision 220!!!

Thanks for the enhancement :wink:

Cheers,
/Areski


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 
Auto Dialer Software


All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group