Koozali.org: home of the SME Server

Country Code in Globals

Offline compsos

  • *
  • 472
  • +0/-0
Country Code in Globals
« on: November 06, 2011, 09:18:25 AM »
Hi Jeff
sail-3.1.0-135
We have 1 site where the country code in globals keeps going back to "us". Checking the DB in the tables globals there is no field "Country" and in the sarkglobals.pl, the country line has been # out.
Code: [Select]
#    my $country                        = ($global{'COUNTRY'})          || '';
Does this code store it somewhere outside the DB?
Code: [Select]
    my @CountryCode;
    my $ccode;
    foreach (@indications) {
                if (/\[(\w\w)\]/) {
                        push (@CountryCode, $1);
                }
                if ( /country=(\w\w)/ ) {
                                $ccode = $1;
                }
        }
Does it do anything? The system.conf the TDM cards are holding the correct Country Code. TIA

Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Country Code in Globals
« Reply #1 on: November 11, 2011, 11:28:18 PM »
Hi
Quote
Does it do anything?

Yes, it sets country= in /etc/asterisk/indications.conf.  However, SARK does not keep its own database entry, it merely reflects the value in the asterisk file.   The file will revert back to 'us' (the default) if you install a new release of asterisk and ask for the sample files to be generated or if the asterisk rpm you apply contains an image of indications.conf.

Indications.conf controls the tones that asterisk will generate for things like ringback, reorder and busy.

Kind Regards

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Country Code in Globals
« Reply #2 on: November 12, 2011, 12:15:40 AM »
Thanks Jeff. That explains why I could not find it in the DB.
Quote
if you install a new release of asterisk and ask for the sample files to be generated
Is there a way to preserve settings? This was the only site that "refused" to change the Country Code but all keep replacing the "/etc/asterisk/sark_cdr_mysql.conf " file with commented out entries, which blocks CDR records going to mysql. Are you planning on a new way of doing CDR analysis?
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Country Code in Globals
« Reply #3 on: November 12, 2011, 11:12:38 AM »
There are lots of Asterisk files and they all get overwritten whenever an asterisk upgrade is done.  We will look at it again.  With regard to cdr; the original "Areski Stats" package is no longer supported or distributed by the authors. The replacement Version 2 is very close to being uninstallable in any practical sense.   We are evaluating a third party package which looks quite good.  The only downside is that it is written in .net with all of the limitations implied by that platform and it is a commercial product so there may be a fee payable to the authors.

Best


 
« Last Edit: November 12, 2011, 11:14:33 AM by SARK devs »

Offline compsos

  • *
  • 472
  • +0/-0
Re: Country Code in Globals
« Reply #4 on: November 13, 2011, 03:02:11 AM »
Hi Jeff
Actually it was only a Sail upgrade that appears to be changing the files back to defaults. We only did the upgrade from sail-3.1.0-135.noarch.rpm to sail-3.1.0-136.noarch.rpm

These files are all included in the 136 rpm. Do they all reset the existing settings? Is there a way to preserve existing settings?
-rwxr-xr-x    1 root    root              422 May 11  2010 /etc/asterisk/sark_agents_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_agents_main.conf
-rw-r--r--    1 root    root               62 Oct 17  2010 /etc/asterisk/sark_buddies.conf
-rwxr-xr-x    1 root    root              921 Oct  4  2010 /etc/asterisk/sark_cdr_mysql.conf
-rwxr-xr-x    1 root    root              380 May 11  2010 /etc/asterisk/sark_features_applicationmap.conf
-rwxr-xr-x    1 root    root              340 May 11  2010 /etc/asterisk/sark_features_featuremap.conf
-rwxr-xr-x    1 root    root              423 May 11  2010 /etc/asterisk/sark_features_general.conf
-rwxr-xr-x    1 root    root              334 May 11  2010 /etc/asterisk/sark_iax_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_iax_localnet_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_iax_main.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_iax_registrations.conf
-rw-r--r--    1 root    root              550 Oct 17  2010 /etc/asterisk/sark_jabber.conf
-rw-r--r--    1 root    root              488 Jul 19 03:14 /etc/asterisk/sark_manager.conf
-rwxr-xr-x    1 root    root              306 May 11  2010 /etc/asterisk/sark_queues_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_queues_main.conf
-rwxr-xr-x    1 root    root              436 Jun 11  2010 /etc/asterisk/sark_sip_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_sip_localnet_header.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_sip_main.conf
-rw-r--r--    1 root    root              130 Jul 31 04:26 /etc/asterisk/sark_sip_notify.conf
-rw-r--r--    1 root    root                0 Aug  2  2010 /etc/asterisk/sark_sip_registrations.conf
-rwxr-xr-x    1 root    root              452 May 11  2010 /etc/asterisk/sark_vmail_header.conf
-rwxr-xr-x    1 root    root              875 May 11  2010 /etc/asterisk/sark_vmail_layout.conf
-rwxr-xr-x    1 root    root               10 Jun 23  2010 /etc/asterisk/sark_vmail_main.conf
-rwxr-xr-x    1 root    root                0 May  8  2010 /etc/asterisk/sarkdir.conf
-rw-r--r--    1 root    root              189 May 17  2011 /etc/asterisk/selauth.conf

We have a basic webpage cdr system operating provided the mysql module and the credentials all stay in place. We can email a copy to you (admin) if you think it might be useful.
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Country Code in Globals
« Reply #5 on: November 13, 2011, 08:24:12 PM »
Hi Gordon

I just did two test installs of -137 (which you will have shortly) and the country-code in indications did not change.  Also, from the list of files you provided, you can see that we don't touch indications.conf so its difficult to understand how it could change as a result of a sail rpm install.   As to the files you list, they are all internal sail files.  They will change from release to release.  For your own mods, we usually provide a customer equivalent file which we don't change and which is #included from our file.  The customer versions are all named sark_customer_{whatever the filename is }.   Like this...

Code: [Select]
ls /etc/asterisk/sark_cust*
/etc/asterisk/sark_customer_agents_header.conf
/etc/asterisk/sark_customer_agents_main.conf
/etc/asterisk/sark_customer_extensions_globals.conf
/etc/asterisk/sark_customer_iax_header.conf
/etc/asterisk/sark_customer_iax_main.conf
/etc/asterisk/sark_customer_manager.conf
/etc/asterisk/sark_customer_queues_header.conf
/etc/asterisk/sark_customer_queues_main.conf
/etc/asterisk/sark_customer_sip_header.conf
/etc/asterisk/sark_customer_sip_main.conf
/etc/asterisk/sark_customer_vmail_header.conf
/etc/asterisk/sark_customer_vmail_main.conf

Yes, please send cdr page to admin. 

Thanks

Jeff


Offline compsos

  • *
  • 472
  • +0/-0
Re: Country Code in Globals
« Reply #6 on: November 13, 2011, 09:54:38 PM »
Sorry Jeff
I was probably not clear on the issues. Only 1 system would not change the Country Code in the globals screen. It could be set to "au" but after a refresh went back to "us". Editing the file in the "system Editor" and changing the default to "au" in the indications.conf has worked. But it may come back with an update etc.
The second issue was effecting all systems on ver 3. In this case it was exposed as the mysql database settings being commented out by the updated file /etc/asterisk/sark_cdr_mysql.conf. So if we create a /etc/asterisk/sark_customer_cdr_mysql.conf file it will override the /etc/asterisk/sark_cdr_mysql.conf file? Another but minor example would be a "personalised" /etc/asterisk/sark_customer_vmail_header.conf but that would be replaced by the update?


Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Country Code in Globals
« Reply #7 on: November 14, 2011, 12:34:21 AM »
Hi Gordon

The countrycode is not changed by a sail update.  There is no mechanism in sail to do that so it must be happening elsewhere I think.  With regard to  sark_cdr_mysql.conf;  a sail upgrade will reset it but there is no companion "customer" file and no #include.   I will report a bug in Mantis and it should get fixed in the next point release.  Lastly, personalised customer files don't get overwritten by an upgrade.  The installation mechanism for these files is slightly different to the sark system files (which do get overwritten).  They are installed in an rpm post processor but ONLY if they don't already exist on the target system.
 
Hope this helps

Jeff


 

Offline compsos

  • *
  • 472
  • +0/-0
Re: Country Code in Globals
« Reply #8 on: November 14, 2011, 12:43:45 AM »
Thanks Jeff
On CountryCode, from the sail screens where does it record the selected country? By modifying the indications.conf file? The problem was not that it was happening elsewhere, I think it was not happening at all. Just stayed on "us".
So the sark_customer files are sail equal to configuration templates? Preserved during updates.
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Country Code in Globals
« Reply #9 on: November 16, 2011, 09:26:21 PM »
Hi Gordon

I'll put this on the list to re visit.  IN the meantime, I'm afraid you'll need to set it in indications either using ssh or the asterisk edit panel.

Best

S