Callback not triggering callback

Hi,
Im running Asterisk 1.6.2.5 and freepbx 2.8.0.4 on debian lenny.
When calling a dedicated line the caller should be called back (after 11sec) and then send to an IVR.
Right now it seems to me that the callback file is not created and consequently no callback is triggert.
But see for yourself:

 -- Executing [5XXXXXX@from-trunk-sip-sipgateXYZ:1] Set("SIP/sipgateXYZ-000000dc", "GROUP()=OUT_5") in new stack
    -- Executing [5XXXXXX@from-trunk-sip-sipgateXYZ:2] Goto("SIP/sipgateXYZ-000000dc", "from-trunk,5XXXXXX,1") in new stack
    -- Goto (from-trunk,5XXXXXX,1)
    -- Executing [5XXXXXX@from-trunk:1] Set("SIP/sipgateXYZ-000000dc", "__FROM_DID=5XXXXXX") in new stack
    -- Executing [5XXXXXX@from-trunk:2] ExecIf("SIP/sipgateXYZ-000000dc", "0 ?Set(CALLERID(name)=047XXXXXXX)") in new stack
    -- Executing [5XXXXXX@from-trunk:3] Ringing("SIP/sipgateXYZ-000000dc", "") in new stack
    -- Executing [5XXXXXX@from-trunk:4] Set("SIP/sipgateXYZ-000000dc", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [5XXXXXX@from-trunk:5] Set("SIP/sipgateXYZ-000000dc", "CALLERPRES()=allowed_not_screened") in new stack
    -- Executing [5XXXXXX@from-trunk:6] Goto("SIP/sipgateXYZ-000000dc", "callback,1,1") in new stack
    -- Goto (callback,1,1)
    -- Executing [1@callback:1] Set("SIP/sipgateXYZ-000000dc", "CALL=047XXXXXXX") in new stack
    -- Executing [1@callback:2] Set("SIP/sipgateXYZ-000000dc", "DESTINATION=ivr-2.s.1") in new stack
    -- Executing [1@callback:3] Set("SIP/sipgateXYZ-000000dc", "SLEEP=11") in new stack
    -- Executing [1@callback:4] System("SIP/sipgateXYZ-000000dc", "/var/lib/asterisk/bin/callback 047XXXXXXX ivr-2.s.1 11 &") in new stack
    -- Executing [1@callback:5] Hangup("SIP/sipgateXYZ-000000dc", "") in new stack
  == Spawn extension (callback, 1, 5) exited non-zero on 'SIP/sipgateXYZ-000000dc'

p_lindheimer (without seeing above code)suggested checking the originate permission in manager.conf, but it is all in place.
I then decided to take to topic to the forum and not to further spam module documentation http://www.freepbx.org/support/documentation/module-documentation/callback#comment-33023

the dialplan basically calls the script with a System() command.

If the script works, have a closer look at the parameters being passed in the CLI when you try it through the dialplan and see if something is being passed in wrong.

I havent made any progress, I checked logs, but can not find any hint to why callback is not working.

Using your sudo command, I was able to trigger a callback.
Asterisk is running on asterisk:asterisk and /etc/apache2/envars looks like this:

export APACHE_RUN_USER=asterisk
export APACHE_RUN_GROUP=asterisk
export APACHE_PID_FILE=/var/run/apache2.pid

/var/lib/asterisk/bin is also asterisk:asterisk

Still, when I call to trigger a callback nothing happens.

My guess is there may be permissions issues.

You can try doing the following form the Linux command line and get more visibility into the issue:

sudo -u asterisk /var/lib/asterisk/bin/callback 047XXXXXXX ivr-2.s.1 11

The assumption being that asterisk is running as user asterisk (which it should be). Then see if it runs and if not if it provides any useful feedback. (Or if necessary, add additional debug code).