Error with recordings after Server IP change

Support forum for the ViciBox ISO Server Install and ISO LiveCD Demo

Moderators: enjay, williamconley, Staydog, mflorell, MJCoate, mcargile, Kumba

Error with recordings after Server IP change

Postby fibres » Tue Mar 01, 2011 8:12 pm

Hi all

We have recently moved our server to a new IP address.
I have run the ADMIN_update_server_ip script and updated.

Everything is working fine except for the links to click on recordings from the lead record screen.

any recordings since the change have the correct link to the recordings.

All recordings from before have the link to the old ip.

How can I fix this?

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

Postby mflorell » Tue Mar 01, 2011 8:20 pm

You can create a new Servers record using the old IP address(make sure you set it to inactive), then use the alternate IP in that server record to change it to the new IP address.
mflorell
Site Admin
 
Posts: 18399
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby fibres » Wed Mar 02, 2011 9:54 am

Right ok thanks.

Is there not somewhere I can change the records in the database?

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

Postby mflorell » Wed Mar 02, 2011 10:40 am

You can change them in the DB if you like, but it would take a rather complex SQL statement, or a program to go through the records and alter them.
mflorell
Site Admin
 
Posts: 18399
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Wed Mar 02, 2011 12:12 pm

it's a fairly simple update statement.

post the exact change you want to make (table, field, data from and data to with a sample record entry so i know what to strip out). for security, change one or two digits of your real ip address. but do NOT change the LENGTH of the ip address string when doing so (known length of string is what makes it easy to wring, otherwise it would be a bummer)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20346
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby fibres » Wed Mar 02, 2011 5:51 pm

Well I have located the recordings_log table in the database which seems to have 2 fields which apply.

Server_IP which looks easy enough to update with just a simple
update recordings_log set server_ip = "NEW IP"

However I suspect this will not update the field which seems to be where the admin page gets the location from which is called location.

this is currently
http://225.192.18.154/RECORDINGS/MP3/PH ... 35-all.mp3

and needs to be

http://225.192.22.54/RECORDINGS/MP3/PHO ... 35-all.mp3

But obviously this will need to be done for all entries of the above.

Matt. If you say simply adding a inactive server with the old IP and give it an alternate recordings location will change this.

Would changing the server_ip and then changing the locstion to external and then back on current server record give the action I desire?

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

Postby Kumba » Wed Mar 02, 2011 6:12 pm

What's the mysql output of this query:

SELECT location, concat('http://225.192.22.54', substr(location,1,21)) as new location FROM `recording_log` limit 1
Kumba
 
Posts: 958
Joined: Tue Oct 16, 2007 11:44 pm
Location: Florida

Postby williamconley » Wed Mar 02, 2011 6:56 pm

Code: Select all
mysql> SELECT location, concat('http://225.192.22.54', substr(location,1,21)) as new_location FROM `recording_log` limit 1;
+----------------------------------------------------------------------------------+-------------------------------------------+
| location                                                                         | new_location                              |
+----------------------------------------------------------------------------------+-------------------------------------------+
| http://225.192.18.154/RECORDINGS/MP3/PHONEINS_20110221-121910_7557353535-all.mp3 | http://225.192.22.54http://225.192.18.154 |
+----------------------------------------------------------------------------------+-------------------------------------------+
2 rows in set (0.00 sec)
Close ... but a wee bit off (and that's after i changed 'new location' to 'new_location') 8)

However:
Code: Select all
mysql> SELECT location, concat('http://225.192.22.54', substr(location,22)) as new_location FROM `recording_log` limit 1;
+----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
| location                                                                         | new_location                                                                    |
+----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
| http://225.192.18.154/RECORDINGS/MP3/PHONEINS_20110221-121910_7557353535-all.mp3 | http://225.192.22.54/RECORDINGS/MP3/PHONEINS_20110221-121910_7557353535-all.mp3 |
+----------------------------------------------------------------------------------+---------------------------------------------------------------------------------+
1 row in set (0.00 sec)

So:
Code: Select all
update `recording_log` set location=concat('http://225.192.22.54', substr(location,22)) where substr(location,1,21)='http://225.192.18.154' limit 1;
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20346
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby mflorell » Wed Mar 02, 2011 8:04 pm

Thanks for doing the SQL work on this one William!

As for the inactive servers record method, it doesn't change the SQL at all, it only changes the links as they appear in the admin pages that have the links to the recordings.
mflorell
Site Admin
 
Posts: 18399
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Wed Mar 02, 2011 8:39 pm

I know. You taught me that last year! 8)

But I also know that it makes the administrator "nervous" to have those records "wrong" in the database ... actually changing it gives a feeling of accomplishment. Administrator feels better because the "change to a new ip" seems more complete.

And I love sql. LOL
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20346
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby fibres » Thu Mar 03, 2011 5:21 pm

Thank you very much.

I love SQL too, When it is doing what I want. Rest of time I want to kill whoever invented the damn thing!!

Well that worked a treat soon as I reralised that I needed to remove the limit 1 from the end and it did it to all the records.

You are right as an administrator I prefer to update things than use workarounds!!

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

Postby mflorell » Thu Mar 03, 2011 5:59 pm

Mike pointed out to me that this script has been in the codebase and release for over a year and a half...


/usr/share/astguiclient/ADMIN_update_archive_url.pl - updates the url in the recording_log
command-line options:
[--debug] = shows the sql as it is being executed.
[--test] = activates debuging and does not actually
execute the updates.
[--old-server-url] = the old url used to access the recordings.
This is a required argument.
[--new-server-url] = the new url used to access the recordings.
This is a required argument.
mflorell
Site Admin
 
Posts: 18399
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Thu Mar 03, 2011 8:40 pm

eGads it is! LOL (2.2.0 and trunk and IN the perl script folder ready to go!) lol
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20346
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Postby fibres » Mon Mar 07, 2011 4:19 pm

Thats just what I was looking for Matt!!

Thanks william and others for the sql syntax to do it.

Yet again my humble thanks go out to the communtiy for all their support!!

Regards
Vicibox 4.0.3 ISO install.
VERSION: 2.6-393a
BUILD: 130124-1721
Astersik 1.4.44-vici
No Hardware
No other software installed
fibres
 
Posts: 313
Joined: Sun May 20, 2007 3:12 pm
Location: UK

Postby enavaro » Sun Dec 18, 2011 1:52 pm

Can someone tell me the proper usage of:

perl /usr/share/astguiclient/ADMIN_update_archive_url.pl

I already tried many combination but still it did not update my single server. First my server was in private IP then I updated it with the public IP (update_server_ip). Would like to update the recordings location on USER STATS.

I already tried this to see how the script would run.

/usr/share/astguiclient/ADMIN_update_archive_url.pl --debug

It returns with this:

/usr/share/astguiclient/ADMIN_update_archive_url.pl - updates the url in the recording_log
command-line options:
[--debug] = shows the sql as it is being executed.
[--test] = activates debuging and does not actually
execute the updates.
[--old-server-url] = the old url used to access the recordings.
This is a required argument.
[--new-server-url] = the new url used to access the recordings.
This is a required argument.

I tried this also:

/usr/share/astguiclient/ADMIN_update_archive_url.pl http://192.168.0.1/ http://220.xxx.xx.xxx/

Return with these results:

/usr/share/astguiclient/ADMIN_update_archive_url.pl - updates the url in the recording_log
command-line options:
[--debug] = shows the sql as it is being executed.
[--test] = activates debuging and does not actually
execute the updates.
[--old-server-url] = the old url used to access the recordings.
This is a required argument.
[--new-server-url] = the new url used to access the recordings.
This is a required argument.

By the way I am using the installer GoAutodial CE 2.1 Final

Would appreciate to give the correct command line options for ADMIN_update_archive_url.pl

enavaro
VicidialNow CE 1.3
Version: 2.0.5-174
Build: 90522-0506
Asterisk 1.2.30.2
enavaro
 
Posts: 43
Joined: Tue Aug 25, 2009 1:56 pm
Location: Philippines

Postby williamconley » Mon Dec 19, 2011 12:28 pm

leave off the special characters.

Code: Select all
/usr/share/astguiclient/ADMIN_update_archive_url.pl 192.168.0.1 220.xxx.xx.xxx
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20346
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Error with recordings after Server IP change

Postby gerski » Sat Aug 24, 2013 11:02 am

is this still working on 2.8 version?

when i run:

[root@Asterisk1 ~]# /usr/share/astguiclient/ADMIN_update_archive_url.pl
-bash: /usr/share/astguiclient/ADMIN_update_archive_url.pl: /usr/bin/perl^M: bad interpreter: No such file or directory
http://www.perfectnetworkcorp.com
Perfect Network Corporation
gerski
 
Posts: 432
Joined: Fri Jul 14, 2006 6:21 am

Re: Error with recordings after Server IP change

Postby DomeDan » Mon Aug 26, 2013 2:58 am

That's a bug, I've posted it to the issue tracker http://www.vicidial.org/VICIDIALmantis/view.php?id=697

in the meantime you can run it through perl to make it work:

[root@Asterisk1 ~]# perl /usr/share/astguiclient/ADMIN_update_archive_url.pl
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Error with recordings after Server IP change

Postby Kumba » Mon Aug 26, 2013 3:29 pm

This has to do with the EOLs being in a Windows/DOS format. You can just convert the file by running 'dos2unix /usr/share/astguiclient/ADMIN_update_archive_url.pl' and hitting enter. I've seen perl mis-inerpret the line feeds as well and would suggest you convert it until I can get the two code monkeys to fix it.
Kumba
 
Posts: 958
Joined: Tue Oct 16, 2007 11:44 pm
Location: Florida

Re: Error with recordings after Server IP change

Postby gerski » Mon Aug 26, 2013 3:45 pm

ok just let us know kumba.. after running dos2unix it seems like its not running other script:

Code: Select all
[root@dialer ~]# /usr/share/astguiclient/ADMIN_update_archive_url.pl XX.XX.XX.XX YY.YY.YY.YY
/usr/share/astguiclient/ADMIN_update_archive_url.pl - updates the url in the recording_log
command-line options:
  [--debug]          = shows the sql as it is being executed.
  [--test]           = activates debuging and does not actually
                       execute the updates.
  [--old-server-url] = the old url used to access the recordings.
                       This is a required argument.
  [--new-server-url] = the new url used to access the recordings.
                       This is a required argument.


even if i put perl

Code: Select all
[root@dialer ~]# perl /usr/share/astguiclient/ADMIN_update_archive_url.pl XX.XX.XX.XX YY.YY.YY.YY
/usr/share/astguiclient/ADMIN_update_archive_url.pl - updates the url in the recording_log
command-line options:
  [--debug]          = shows the sql as it is being executed.
  [--test]           = activates debuging and does not actually
                       execute the updates.
  [--old-server-url] = the old url used to access the recordings.
                       This is a required argument.
  [--new-server-url] = the new url used to access the recordings.
                       This is a required argument.
Last edited by gerski on Mon Aug 26, 2013 5:38 pm, edited 1 time in total.
http://www.perfectnetworkcorp.com
Perfect Network Corporation
gerski
 
Posts: 432
Joined: Fri Jul 14, 2006 6:21 am

Re: Error with recordings after Server IP change

Postby Kumba » Mon Aug 26, 2013 4:22 pm

Try reading the output on the screen. You aren't telling it to do anything. You need to read the --old-server-url and --new-server-url and use those options with your IPs.
Kumba
 
Posts: 958
Joined: Tue Oct 16, 2007 11:44 pm
Location: Florida

Re: Error with recordings after Server IP change

Postby gerski » Mon Aug 26, 2013 6:14 pm

already got it but it seems like it is not updating:

/usr/share/astguiclient/ADMIN_update_archive_url.pl --old-server-url=XX.XX.XX.XX --new-server-url=YY.YY.YY.YY --debugX
SELECT recording_id, location from recording_log where location LIKE 'XX.XX.XX.XX%';
Updated 0 records in the recording_log table
http://www.perfectnetworkcorp.com
Perfect Network Corporation
gerski
 
Posts: 432
Joined: Fri Jul 14, 2006 6:21 am

Re: Error with recordings after Server IP change

Postby gerski » Thu Sep 19, 2013 10:36 am

got it working just to help others it should be :

/usr/share/astguiclient/ADMIN_update_archive_url.pl --old-server-url=http://XX.XX.XX.XX --new-server-url=http://YY.YY.YY.YY --debugX
http://www.perfectnetworkcorp.com
Perfect Network Corporation
gerski
 
Posts: 432
Joined: Fri Jul 14, 2006 6:21 am


Return to ViciBox Server Install and Demo

Who is online

Users browsing this forum: No registered users and 23 guests