Dialparties.agi Notice: Undefined index:


I am receiving the following message (via email) and I need help in tracking down the cause.

dialparties.agi/540/Notice: Undefined index: 21

Notice: Undefined index:  21 in /var/lib/asterisk/agi-bin/dialparties.agi on line 540

IP Address:


it then goes on to include a whole slew of variables and finally the offending lines in dialparties.agi which deals with a ringroup and ring group dialing method

534	if (($rgmethod == "hunt") || ($rgmethod == "memoryhunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone")) {
535		if ($cidnum) {
536			$AGI->set_variable('CALLTRACE_HUNT',$cidnum);
537		}
538		foreach ($extarray as $k ) {
539			// we loop through the original array to get the extensions in order of importance
540			if ($ext_hunt[$k]) {
541				//If the original array is included in the extension hash then set variables
542				$myhuntmember="HuntMember"."$loops";
543				if (($rgmethod == "hunt") || ($rgmethod == "firstavailable") || ($rgmethod == "firstnotonphone")) {

I have an extension 21 setup and working in my pbx.

Other details:
CentOS 5.4
Asterisk 1.4.30-rc2

Any thoughts, suggestions in tracking this down appreciated.


it’s probably technically a bug and should be

    if (isset($ext_hunt[$k]) && $ext_hunt[$k]) {

there is various filtering that occurs for many reasons and the configuration and circumstance may be that it got unset above.

As a general rule you don’t want to run production with notices being reported in php though it is fine during testing and it is technically a bug if circumstances can result in this. (You would have to analyze the configuration carefully to determine if in fact this was suppose to be unset or not.

Feel free to file a bug in the tracker for the above to be changed to check if it is set though (so it is not forgotten).

Thanks for the response - the strange things is that I do not get this error at other sites and I’m pretty sure they have the same ringgroup setup.
The only real differences are the Asterisk versions and probably the php version.

I will make the change to the dialparties.agi and see if it resolves the issue - if so, I will open a bug report otherwise I will attempt to debug further, just not sure how…

That change seemed to have fixed the error message - as you mentioned, it is not critical, but I’ll open a bug for it anyway.

It was interesting because I also received agi errors from using the aastra-xml scrips and so I thought they were related. I’ll take that one up with Aastra though…