|
|
Re: Weird issues with 1.10.010: msg#00244
|
Subject: |
Re: Weird issues with 1.10.010 |
Andrei,
the purpose of the LIMIT 1 was actually to see last priority on the list, as you would notice, the priority didn't change,
which means that we still only have a single line in outbound-allroutes context, as the index unique key won't allow the creation
of two entries inside the same context with the same priority.
Nir S
On Wed, 2005-11-23 at 23:53 +0200, Andrey Stolyarenko wrote:
SELECT * FROM extensions WHERE context = 'outbound-allroutes' AND extension = 'include' order by priority desc limit 1;
LIMIT 1 - I think that the problem is here
On 11/23/05, Nir Simionovich <nirs-x55izMiovjtBDgjK7y7TUQ@xxxxxxxxxxxxxxxx> wrote:
Ok, this is getting really crazy here. Here's what I did and found out:
1. I deleted all the outbound routes and started from scratch.
2. I've added a new route, called outsideZAP which resulted in the following line in the database:
mysql> SELECT * FROM extensions WHERE context = 'outbound-allroutes' AND extension = 'include' order by priority desc limit 1;
+--------------------+-----------+----------+----------------------+------+-------+-------+
| context | extension | priority | application | args | descr | flags |
+--------------------+-----------+----------+----------------------+------+-------+-------+
| outbound-allroutes | include | 1 | outrt-001-outsideZAP | | | 2 |
+--------------------+-----------+----------+----------------------+------+-------+-------+
1 row in set (0.00 sec)
3. Now, I decided to add another route called outsideSIP, which resulted in the following in the database:
mysql> SELECT * FROM extensions WHERE context = 'outbound-allroutes' AND extension = 'include' order by priority desc limit 1;
+--------------------+-----------+----------+----------------------+------+-------+-------+
| context | extension | priority | application | args | descr | flags |
+--------------------+-----------+----------+----------------------+------+-------+-------+
| outbound-allroutes | include | 1 | outrt-001-outsideSIP | | | 2 |
+--------------------+-----------+----------+----------------------+------+-------+-------+
1 row in set (0.00 sec)
Now, this doesn't make any proper sense, as according to the code, there is no deletion of records
after the insert or before it. The only deletion of records is when performing a delete or an edit or a route.
Now, I've manager to narrow this down to the following piece of code:
// add an include=>outrt-$name to [outbound-allroutes]:
// we have to find the first available priority.. priority doesn't really matter for the include, but
// there is a unique index on (context,extension,priority) so if we don't do this we can't put more than
// one route in the outbound-allroutes context.
$sql = "SELECT priority FROM extensions WHERE context = 'outbound-allroutes' AND extension = 'include'";
$results = $db->getAll($sql);
if(DB::IsError($results)) {
die($results->getMessage());
}
$priorities = array();
foreach ($results as $row) {
$priorities[] = $row[0];
}
for ($priority = 1; in_array($priority, $priorities); $priority++);
// $priority should now be the lowest available number
$sql = "INSERT INTO extensions (context, extension, priority, application, args, descr, flags) VALUES ";
$sql .= "('outbound-allroutes', ";
$sql .= "'include', ";
$sql .= "'".$priority."', ";
$sql .= "'outrt-".$name."', ";
$sql .= "'', ";
$sql .= "'', ";
$sql .= "'2')";
$result = $db->query($sql);
if(DB::IsError($result)) {
die($priority.$result->getMessage());
}
Now, lets imagine the PEAR::DB goes about and performs an update to the table in stead of performing an insert?
Can that actually happen? In addition, what is the bloody difference between 3 boxes running the same code, the same
package versions, the same asterisk version - and for all practical matters the same hardware?
Question remains - would a hardware fault (lets say memory or CPU) would cause a fault like this? interesting, isn't it.
Nir S
On Wed, 2005-11-23 at 23:31 +0200, Nir Simionovich wrote:
All machines are running MySQL 5.0.15.
On Wed, 2005-11-23 at 22:44 +0200, Andrey Stolyarenko wrote:
What version of mysql are you using?
On 11/23/05, Nir Simionovich <nirs-x55izMiovjtBDgjK7y7TUQ@xxxxxxxxxxxxxxxx> wrote:
Ok,
A wise man once told me, "when everything looks strange, look for the solution in the most obvious place".
I've started digging into the code, especially the routing.php file, and found the following query:
select DISTINCT(context) from extensions where context like 'outrt-%' order by context;
As I understand, every time I add a new route, it will be added into the system into a context named outrt-something.
Now, when the extensions_additional.conf file is created, is would first look for the outrt- contexts in a distinct manner,
then loop the loop generating a prioritization list of the outbound-allroutes context.
Now, imagine my surprise to find the following:
mysql> use asterisk;
Database changed
mysql> select context from extensions where context like 'outrt-%' order by context;
+----------------------+
| context |
+----------------------+
| outrt-001-outside |
| outrt-001-outside |
| outrt-002-outsideSIP |
| outrt-002-outsideSIP |
| outrt-002-outsideSIP |
+----------------------+
5 rows in set (0.00 sec)
mysql> select DISTINCT(context) from extensions where context like 'outrt-%' order by context;
Empty set (0.00 sec)
AH? that sounds weird, doesn't it? this actually means, that the database isn't performing the query correctly.
I'll try upgrading my MySQL database, and we'll see what's going on here.
Nir S
On Wed, 2005-11-23 at 20:35 +0200, Nir Simionovich wrote:
Oh,
Just to make things a bit more strange, I've got 2 other boxes with the same installation.
A box running Mandriva Linux 10.2 (same as the problematic box) and a box running SuSE
Enterprise 9.1 - both running without a problem.
All boxes were installed exactly the same.
Nir S
On Tue, 2005-11-22 at 10:28 -0700, Jason Becker wrote:
Nir Simionovich - CTO wrote:
>Hmm....
>
>Well, I tried running it, but no output.
>
>
Okay.
>Any thoughts ?
>
>
How about in mysql?
mysql> select * from extensions where context='outbound-allroutes';
+--------------------+-----------+----------+---------------------+------+-------+-------+
| context | extension | priority | application | args
| descr | flags |
+--------------------+-----------+----------+---------------------+------+-------+-------+
| outbound-allroutes | include | 1 | outrt-001-9_outside |
| | 2 |
| outbound-allroutes | include | 2 | outrt-002-foo |
| | 2 |
+--------------------+-----------+----------+---------------------+------+-------+-------+
2 rows in set (0.00 sec)
Regards,
Jason
>Nir S
>
>
>-----Original Message-----
>From: amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>[mailto:amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx] On Behalf Of Jason
>Becker
>Sent: Tuesday, November 22, 2005 1:02 AM
>To: amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>Subject: Re: [Amportal-users] Weird issues with 1.10.010
>
>Nir Simionovich - CTO wrote:
>
>
>
>>Well, anything on this guys ?
>>
>>
>>
>>
>I assumed you were being fecitious with step #1 (Install Mandriva linux as
>it is.). Please note that although AMP has as one of its goals to be
>distribution agnostic our primary development platform is White Box/CentOS.
>You will find that the majority of AMP's knowledgebase revolves around the
>Red Hat Enterprise Linux clones, SUSE or Debian.
>That's not to say that AMP won't work on your distro of choice, just that
>YMMV.
>
>Your issue is obscure and probably has something to do with the install of
>PERL on Mandriva. Try running
>/var/www/html/admin/retrieve_extensions_from_mysql.pl from the Linux
>commandline and paste the output.
>
>Regards,
>
>Jason
>
>
>
>>Nir S
>>
>>-----Original Message-----
>>From: amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>[mailto:amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx] On Behalf Of Nir
>>Simionovich - CTO
>>Sent: Monday, November 21, 2005 7:20 PM
>>To: amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>Subject: RE: [Amportal-users] Weird issues with 1.10.010
>>
>>Ok, here goes:
>>
>>1. Install Mandriva linux as it is.
>>2. Start the installation of Asterisk and AMP, according to the manual
>>provided at
>>
>>http://www.coalescentsystems.ca/index.php?option=com_content&task=view&
>>id=31
>>&Itemid=57#
>>3. After installation, validate the AMP and Asterisk co-exist together 4.
>>Create a couple of extensions.
>>5. Create a new trunk (SIP, IAX, ZAP) - it doesn't really matter.
>>6. Create a new outbound route, which includes your newly created trunk.
>>7. Upon submission of the changes, you would see that
>>/etc/asterisk/extensions_additional
>> has the two contexts for each of the trunks. However, the
>>outbound-allroutes context contains
>> only a single outbound route, instead of containing all of the
>>routes together.
>>
>>Nir S
>>
>>-----Original Message-----
>>From: amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>[mailto:amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx] On Behalf Of Jason
>>Becker
>>Sent: Monday, November 21, 2005 7:05 PM
>>To: amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>Subject: Re: [Amportal-users] Weird issues with 1.10.010
>>
>>Nir Simionovich - CTO wrote:
>>
>>
>>
>>
>>
>>>I'm not using CentOS, I'm using Mandriva Linux.
>>>However, I followed the installation manual to the letter, and
>>>everything compiled just nicely.
>>>
>>>
>>>
>>>
>>>
>>>
>>Mandriva (Mandrake) is a bit of a different animal. You'll have to be
>>very explicit in your steps if we are to try to reproduce.
>>
>>Regards,
>>
>>Jason
>>
>>
>>
>>
>>
>>>Nir S
>>>
>>>-----Original Message-----
>>>From: amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>>[mailto:amportal-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx] On Behalf Of Jason
>>>Becker
>>>Sent: Monday, November 21, 2005 6:55 PM
>>>To: amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>>Subject: Re: [Amportal-users] Weird issues with 1.10.010
>>>
>>>Nir Simionovich - CTO wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hi all,
>>>>
>>>>Ok, I've been working on this for a few days now, but I can't seem to
>>>>find what's wrong.
>>>>It appears to be that the creationg of the extensions_additional.conf
>>>>file is somewhat sporadic, Thus craeting a fair havoc on my system.
>>>>
>>>>I will explain the steps to re-create:
>>>>
>>>>1. Install Asterisk 1.2.0 and AMP 1.10.010 according to the
>>>>installation manual.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>Please confirm that you are running CentOS 4.2.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>2. Now, check the /etc/asterisk/extensions_additional.conf, and note
>>>>the outbound
>>>> routing that exists at the end of the file.
>>>>3. Now, create a new outbound route and apply the configuration.
>>>>4. check the /etc/asterisk/extensions_additional.conf file again, and
>>>>notice that the
>>>> outbound routes do not include only the new outbound route, and not
>>>>the old outbound
>>>> root.
>>>>
>>>>Any ideas on why that happens ?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>Can you be more specific about the steps since we cannot reproduce.
>>>
>>>Thanks.
>>>
>>>Regards,
>>>
>>>--
>>>Jason Becker
>>>Director & CEO
>>>Coalescent Systems Inc.
>>>Enabling Open Source Telephony
>>>403.244.8089
>>>www.coalescentsystems.ca
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>>>Register for a JBoss Training Course. Free Certification Exam for All
>>>Training Attendees Through End of 2005. For more info visit:
>>>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>>>_______________________________________________
>>>Amportal-users mailing list
>>>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>>https://lists.sourceforge.net/lists/listinfo/amportal-users
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>>>Register for a JBoss Training Course. Free Certification Exam for All
>>>Training Attendees Through End of 2005. For more info visit:
>>>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>>>_______________________________________________
>>>Amportal-users mailing list
>>>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>>https://lists.sourceforge.net/lists/listinfo/amportal-users
>>>
>>>
>>>
>>>
>>>
>>>
>>--
>>Jason Becker
>>Director & CEO
>>Coalescent Systems Inc.
>>Enabling Open Source Telephony
>>403.244.8089
>>www.coalescentsystems.ca
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>>Register for a JBoss Training Course. Free Certification Exam for All
>>Training Attendees Through End of 2005. For more info visit:
>>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>>_______________________________________________
>>Amportal-users mailing list
>>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>https://lists.sourceforge.net/lists/listinfo/amportal-users
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>>Register for a JBoss Training Course. Free Certification Exam for All
>>Training Attendees Through End of 2005. For more info visit:
>>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>>_______________________________________________
>>Amportal-users mailing list
>>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>https://lists.sourceforge.net/lists/listinfo/amportal-users
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>>Register for a JBoss Training Course. Free Certification Exam for All
>>Training Attendees Through End of 2005. For more info visit:
>>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>>_______________________________________________
>>Amportal-users mailing list
>>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>https://lists.sourceforge.net/lists/listinfo/amportal-users
>>
>>
>>
>>
>
>
>--
>Jason Becker
>Director & CEO
>Coalescent Systems Inc.
>Enabling Open Source Telephony
>403.244.8089
>www.coalescentsystems.ca
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>Register for a JBoss Training Course. Free Certification Exam
>for All Training Attendees Through End of 2005. For more info visit:
>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>_______________________________________________
>Amportal-users mailing list
>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>https://lists.sourceforge.net/lists/listinfo/amportal-users
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
>Register for a JBoss Training Course. Free Certification Exam
>for All Training Attendees Through End of 2005. For more info visit:
>http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
>_______________________________________________
>Amportal-users mailing list
>Amportal-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>https://lists.sourceforge.net/lists/listinfo/amportal-users
>
>
--
Andrey
--
Andrey
|
| |