Issue when using *45 feature code to toogle queue agent

Dears,

When I use the feature code *45 + 100(queue number) from any extension, the follow error comes from e-mail:
Some informations were masked for security reasons.

Notice: Undefined offset: 0 in /var/lib/asterisk/agi-bin/queue_devstate.agi on line 84

IP Address: xxx.xxx.xxx.xxx

Context:
Array
(
[agi] => AGI Object
(
[request] => Array
(
[agi_request] => queue_devstate.agi
[agi_channel] => SIP/0000-00000003
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => xxxxxxxx-1285953268.5
[agi_version] => 1.6.2.12
[agi_callerid] => 0000
[agi_calleridname] => xxxxxxxxxx
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 1
[agi_dnid] => *45100
[agi_rdnis] => unknown
[agi_context] => app-queue-toggle
[agi_extension] => s
[agi_priority] => 5
[agi_enhanced] => 0.0
[agi_accountcode] => 0000
[agi_threadid] => 1105959232
[agi_arg_1] => getqueues
[agi_arg_2] => 0000
)

        [config] => Array
            (
                [phpagi] => Array
                    (
                        [debug] => 
                        [error_handler] => 1
                        [admin] => [email protected]
                        [hostname] => xxxx.xxxx.com
                        [tempdir] => /tmp
                    )

                [asmanager] => Array
                    (
                        [server] => localhost
                        [port] => 5038
                        [username] => freepbx
                        [secret] => xxxxxxx
                    )

                [fastagi] => Array
                    (
                        [setuid] => 1
                        [basedir] => /var/lib/asterisk/agi-bin/
                    )

                [festival] => Array
                    (
                        [text2wave] => /usr/bin/text2wave
                    )

                [cepstral] => Array
                    (
                        [swift] => /opt/swift/bin/swift
                        [voice] => David
                    )

            )

        [asmanager] => 
        [in] => Resource id #1
        [out] => Resource id #2
        [socket] => 
        [audio] => 
    )

[astman] => AGI_AsteriskManager Object
    (
        [config] => Array
            (
                [phpagi] => Array
                    (
                        [debug] => 
                        [error_handler] => 1
                        [admin] => [email protected]
                        [hostname] => xxxxx.xxxxx.com
                        [tempdir] => /tmp
                    )

                [asmanager] => Array
                    (
                        [server] => localhost
                        [port] => 5038
                        [username] => freepbx
                        [secret] => xxxxxxxxx
                    )

                [fastagi] => Array
                    (
                        [setuid] => 1
                        [basedir] => /var/lib/asterisk/agi-bin/
                    )

                [festival] => Array
                    (
                        [text2wave] => /usr/bin/text2wave
                    )

                [cepstral] => Array
                    (
                        [swift] => /opt/swift/bin/swift
                        [voice] => David
                    )

            )

        [socket] => Resource id #9
        [server] => 127.0.0.1
        [port] => 5038
        [pagi] => 
        [event_handlers] => 
    )

[queues] => Array
    (
    )

[logged_agents_array] => Array
    (
    )

[static_agents_array] => Array
    (
    )

[response] => Array
    (
        [data] => Privilege: Command

default has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
No Members
No Callers

100 has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
Members:
Quarto (Local/[email protected]/n) (Unknown) has taken no calls yet
No Callers

        [Response] => Follows
    )

[response1] => Array
    (
        [0] => Privilege: Command
        [1] => default has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
        [2] =>    No Members
        [3] =>    No Callers
        [4] => 
        [5] => 100 has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
        [6] =>    Members: 
        [7] =>       Quarto (Local/[email protected]/n) (Unknown) has taken no calls yet
        [8] =>    No Callers
    )

[inqueue] => false
[item] => Privilege: Command
[item1] => Privilege: Command
[matches] => Array
    (
        [0] => Array
            (
            )

        [1] => Array
            (
            )

    )

)

GLOBALS:
Array
(
[GLOBALS] => Array
RECURSION
[argv] => Array
(
[0] => /var/lib/asterisk/agi-bin/queue_devstate.agi
[1] => getqueues
[2] => 6000
)

[argc] => 3
[_POST] => Array
    (
    )

[_GET] => Array
    (
    )

[_COOKIE] => Array
    (
    )

[_FILES] => Array
    (
    )

[_SERVER] => Array
    (
        [SELINUX_INIT] => YES
        [CONSOLE] => yes
        [TERM] => linux
        [INIT_VERSION] => sysvinit-2.86
        [PATH] => /sbin:/usr/sbin:/bin:/usr/bin
        [RUNLEVEL] => 3
        [runlevel] => 3
        [PWD] => /tmp
        [LANG] => en_US.UTF-8
        [PREVLEVEL] => N
        [previous] => N
        [HOME] => /
        [SHLVL] => 4
        [OLDPWD] => /
        [_] => /bin/nice
        [AST_CONFIG_DIR] => /etc/asterisk
        [AST_CONFIG_FILE] => 
        [AST_MODULE_DIR] => /usr/lib/asterisk/modules
        [AST_SPOOL_DIR] => /var/spool/asterisk
        [AST_MONITOR_DIR] => /var/spool/asterisk/monitor
        [AST_VAR_DIR] => /var/lib/asterisk
        [AST_DATA_DIR] => /var/lib/asterisk
        [AST_LOG_DIR] => /var/log/asterisk
        [AST_AGI_DIR] => /var/lib/asterisk/agi-bin
        [AST_KEY_DIR] => /var/lib/asterisk/keys
        [AST_RUN_DIR] => /var/run/asterisk
        [PHP_SELF] => /var/lib/asterisk/agi-bin/queue_devstate.agi
        [SCRIPT_NAME] => /var/lib/asterisk/agi-bin/queue_devstate.agi
        [SCRIPT_FILENAME] => /var/lib/asterisk/agi-bin/queue_devstate.agi
        [PATH_TRANSLATED] => /var/lib/asterisk/agi-bin/queue_devstate.agi
        [DOCUMENT_ROOT] => 
        [REQUEST_TIME] => 1285953269
        [argv] => Array
            (
                [0] => /var/lib/asterisk/agi-bin/queue_devstate.agi
                [1] => getqueues
                [2] => 6000
            )

        [argc] => 3
    )

[_ENV] => Array
    (
    )

[phpagi_error_handler_email] => [email protected]
[agi] => AGI Object
    (
        [request] => Array
            (
                [agi_request] => queue_devstate.agi
                [agi_channel] => SIP/0000-00000003
                [agi_language] => en
                [agi_type] => SIP
                [agi_uniqueid] => remi.lcvti.com-1285953268.5
                [agi_version] => 1.6.2.12
                [agi_callerid] => 0000
                [agi_calleridname] => xxxxxxx
                [agi_callingpres] => 0
                [agi_callingani2] => 0
                [agi_callington] => 0
                [agi_callingtns] => 1
                [agi_dnid] => *45100
                [agi_rdnis] => unknown
                [agi_context] => app-queue-toggle
                [agi_extension] => s
                [agi_priority] => 5
                [agi_enhanced] => 0.0
                [agi_accountcode] => 0000
                [agi_threadid] => 1105959232
                [agi_arg_1] => getqueues
                [agi_arg_2] => 0000
            )

        [config] => Array
            (
                [phpagi] => Array
                    (
                        [debug] => 
                        [error_handler] => 1
                        [admin] => [email protected]
                        [hostname] => xxxx.xxxx.com
                        [tempdir] => /tmp
                    )

                [asmanager] => Array
                    (
                        [server] => localhost
                        [port] => 5038
                        [username] => freepbx
                        [secret] => xxxxxx
                    )

                [fastagi] => Array
                    (
                        [setuid] => 1
                        [basedir] => /var/lib/asterisk/agi-bin/
                    )

                [festival] => Array
                    (
                        [text2wave] => /usr/bin/text2wave
                    )

                [cepstral] => Array
                    (
                        [swift] => /opt/swift/bin/swift
                        [voice] => David
                    )

            )

        [asmanager] => 
        [in] => Resource id #1
        [out] => Resource id #2
        [socket] => 
        [audio] => 
    )

[ampmgruser] => freepbx
[ampmgrpass] => xxxxxx
[astspooldir] => /var/spool/asterisk
[ast_version] => 1.6.2.12
[ast_version14] => 1
[astman] => AGI_AsteriskManager Object
    (
        [config] => Array
            (
                [phpagi] => Array
                    (
                        [debug] => 
                        [error_handler] => 1
                        [admin] => [email protected]
                        [hostname] => xxxxx.xxxxxxx.com
                        [tempdir] => /tmp
                    )

                [asmanager] => Array
                    (
                        [server] => localhost
                        [port] => 5038
                        [username] => freepbx
                        [secret] => xxxxxxxxxx
                    )

                [fastagi] => Array
                    (
                        [setuid] => 1
                        [basedir] => /var/lib/asterisk/agi-bin/
                    )

                [festival] => Array
                    (
                        [text2wave] => /usr/bin/text2wave
                    )

                [cepstral] => Array
                    (
                        [swift] => /opt/swift/bin/swift
                        [voice] => David
                    )

            )

        [socket] => Resource id #9
        [server] => 127.0.0.1
        [port] => 5038
        [pagi] => 
        [event_handlers] => 
    )

[queues] => Array
    (
    )

[logged_agents_array] => Array
    (
    )

[static_agents_array] => Array
    (
    )

[action] => getqueues
[new_user] => 6000
[queueno] => 100

)

Backtrace:
Array
(
[0] => Array
(
[file] => /var/lib/asterisk/agi-bin/queue_devstate.agi
[line] => 84
[function] => phpagi_error_handler
[args] => Array
(
[0] => 8
[1] => Undefined offset: 0
[2] => /var/lib/asterisk/agi-bin/queue_devstate.agi
[3] => 84
[4] => Array
(
[agi] => AGI Object
(
[request] => Array
(
[agi_request] => queue_devstate.agi
[agi_channel] => SIP/6000-00000003
[agi_language] => en
[agi_type] => SIP
[agi_uniqueid] => xxxxxx.xxxx.com-1285953268.5
[agi_version] => 1.6.2.12
[agi_callerid] => 6000
[agi_calleridname] => xxxxxxx
[agi_callingpres] => 0
[agi_callingani2] => 0
[agi_callington] => 0
[agi_callingtns] => 1
[agi_dnid] => *45100
[agi_rdnis] => unknown
[agi_context] => app-queue-toggle
[agi_extension] => s
[agi_priority] => 5
[agi_enhanced] => 0.0
[agi_accountcode] => 6000
[agi_threadid] => 1105959232
[agi_arg_1] => getqueues
[agi_arg_2] => 6000
)

                                [config] => Array
                                    (
                                        [phpagi] => Array
                                            (
                                                [debug] => 
                                                [error_handler] => 1
                                                [admin] => [email protected]
                                                [hostname] => xxxxx.xxxx.com
                                                [tempdir] => /tmp
                                            )

                                        [asmanager] => Array
                                            (
                                                [server] => localhost
                                                [port] => 5038
                                                [username] => freepbx
                                                [secret] => xxxxxxxxxx
                                            )

                                        [fastagi] => Array
                                            (
                                                [setuid] => 1
                                                [basedir] => /var/lib/asterisk/agi-bin/
                                            )

                                        [festival] => Array
                                            (
                                                [text2wave] => /usr/bin/text2wave
                                            )

                                        [cepstral] => Array
                                            (
                                                [swift] => /opt/swift/bin/swift
                                                [voice] => David
                                            )

                                    )

                                [asmanager] => 
                                [in] => Resource id #1
                                [out] => Resource id #2
                                [socket] => 
                                [audio] => 
                            )

                        [astman] => AGI_AsteriskManager Object
                            (
                                [config] => Array
                                    (
                                        [phpagi] => Array
                                            (
                                                [debug] => 
                                                [error_handler] => 1
                                                [admin] => [email protected]
                                                [hostname] => xxxx.xxxx.com
                                                [tempdir] => /tmp
                                            )

                                        [asmanager] => Array
                                            (
                                                [server] => localhost
                                                [port] => 5038
                                                [username] => freepbx
                                                [secret] => xxxxxxxxxx
                                            )

                                        [fastagi] => Array
                                            (
                                                [setuid] => 1
                                                [basedir] => /var/lib/asterisk/agi-bin/
                                            )

                                        [festival] => Array
                                            (
                                                [text2wave] => /usr/bin/text2wave
                                            )

                                        [cepstral] => Array
                                            (
                                                [swift] => /opt/swift/bin/swift
                                                [voice] => David
                                            )

                                    )

                                [socket] => Resource id #9
                                [server] => 127.0.0.1
                                [port] => 5038
                                [pagi] => 
                                [event_handlers] => 
                            )

                        [queues] => Array
                            (
                            )

                        [logged_agents_array] => Array
                            (
                            )

                        [static_agents_array] => Array
                            (
                            )

                        [response] => Array
                            (
                                [data] => Privilege: Command

default has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
No Members
No Callers

100 has 0 calls (max unlimited) in ‘ringall’ strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
Members:
Quarto (Local/[email protected]/n) (Unknown) has taken no calls yet
No Callers

                                [Response] => Follows
                            )

                        [response1] => Array
                            (
                                [0] => Privilege: Command
                                [1] => default has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 0s
                                [2] =>    No Members
                                [3] =>    No Callers
                                [4] => 
                                [5] => 100 has 0 calls (max unlimited) in 'ringall' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0% within 60s
                                [6] =>    Members: 
                                [7] =>       Quarto (Local/[email protected]/n) (Unknown) has taken no calls yet
                                [8] =>    No Callers
                            )

                        [inqueue] => false
                        [item] => Privilege: Command
                        [item1] => Privilege: Command
                        [matches] => Array
                            (
                                [0] => Array
                                    (
                                    )

                                [1] => Array
                                    (
                                    )

                            )

                    )

            )

    )

[1] => Array
    (
        [file] => /var/lib/asterisk/agi-bin/queue_devstate.agi
        [line] => 47
        [function] => sortqueues
        [args] => Array
            (
            )

    )

)

/var/lib/asterisk/agi-bin/queue_devstate.agi:
75 $response1=explode("\n",trim($response[‘data’]));
76 // Lets try and process our results here.
77 $inqueue=‘false’;
78 foreach ($response1 as $item) {
79 $item1=trim($item);
80 if ($inqueue == ‘false’) {
81 //TODO: deprecated ereg
82 if (ereg(’(\d+)’,$item1)) {
83 preg_match_all ("/(\d+)/is", $item1,$matches);
84 if ($matches[1][0] != ‘’) {
85 $queues[]=$matches[1][0];
86 $inqueue=$matches[1][0];
87 $logged_agents_array[$inqueue][]=’’;
88 $static_agents_array[$inqueue][]=’’;
89 }
90 }
91 } else {
92 // We should test to see if the item is an Agent description
93 //TODO: deprecated ereg
94 if (ereg(‘Local’,$item1)) {