Can't run pbdirectory - it just exits and hangs up

I’m having a rough time getting my FreePBX + Asterisk 1.4.10.1 to let me use the dial-by-name directory. When I call “411” (where it is presently assigned) it just hangs up. It tries to run the “pbdirectory” script, then immediately returns with a “0” result code and hangs up. There is no announcement of instructions, no prompt, etc.

I’m not sure how to debug further? Anyone have any ideas?

Thanks,
Rick

[code:1]
cp1CLI>
– Executing [[email protected]:1] Answer(“SIP/104-b7d70940”, “”) in new stack
– Executing [[email protected]:2] Wait(“SIP/104-b7d70940”, “1”) in new stack
– Executing [[email protected]:3] Goto(“SIP/104-b7d70940”, “pbdirectory|1”) in new stack
– Goto (from-internal,pbdirectory,1)
– Executing [[email protected]:1] AGI(“SIP/104-b7d70940”, “pbdirectory”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/pbdirectory
– AGI Script pbdirectory completed, returning 0
– Executing [[email protected]:2] GotoIf(“SIP/104-b7d70940”, “1?hangup|1”) in new stack
– Goto (from-internal,hangup,1)
– Executing [[email protected]:1] Hangup(“SIP/104-b7d70940”, “”) in new stack
== Spawn extension (from-internal, hangup, 1) exited non-zero on ‘SIP/104-b7d70940’
– Executing [[email protected]:1] Macro(“SIP/104-b7d70940”, “hangupcall”) in new stack
– Executing [[email protected]:1] ResetCDR(“SIP/104-b7d70940”, “w”) in new stack
– Executing [[email protected]:2] NoCDR(“SIP/104-b7d70940”, “”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/104-b7d70940”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [[email protected]:6] GotoIf(“SIP/104-b7d70940”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/104-b7d70940”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [[email protected]:11] Hangup(“SIP/104-b7d70940”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/104-b7d70940’ in macro ‘hangupcall’
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/104-b7d70940’
cp1
CLI>
[/code:1]

I’m gonna play the annoying “Me Too” card here, I dont think this has ever worked for me, so I always thought it was just “broken”.

[quote=“dzone”]I’m having a rough time getting my FreePBX + Asterisk 1.4.10.1 to let me use the dial-by-name directory. When I call “411” (where it is presently assigned) it just hangs up. It tries to run the “pbdirectory” script, then immediately returns with a “0” result code and hangs up. There is no announcement of instructions, no prompt, etc.

I’m not sure how to debug further? Anyone have any ideas?

Thanks,
Rick

[/quote]

Isn’t this something to do with missing sound files?

I seem to recall:

[code:1] $agi->stream_file(“pbdirectory/welcome-to-phonebook”);
[/code:1]

being an issue and a missing ‘pbdirectory/welcome-to-phonebook’ sound file(s).

If you enable DEBUG in agi-bin/pbdirectory you should see debug logged in /tmp/pbdirectory.log which may help.

Sorry I can’t recall exactly what I did to fix it :frowning:

C.

Actually I just ran it and turned on core debug and agi debug - I see:

[size=9]
AGI Rx << Content-type: text/html
AGI Tx >> 510 Invalid or unknown command
AGI Rx << X-Powered-By: PHP/4.3.11
AGI Tx >> 510 Invalid or unknown command
AGI Rx << CLI>
AGI Tx >> 510 Invalid or unknown command
AGI Rx <<

AGI Tx >> 510 Invalid or unknown command
AGI Rx << Fatal error: Call to a member function on a non-object in /var/lib/asterisk/agi-bin/pbdirectory on line 59

AGI Tx >> 510 Invalid or unknown command
[/size]

You get the same if you run it by hand:-

[size=9][[email protected] asterisk]# /var/lib/asterisk/agi-bin/pbdirectory

Content-type: text/html
X-Powered-By: PHP/4.3.11


Fatal error: Call to a member function on a non-object in /var/lib/asterisk/agi-bin/pbdirectory on line 59
[[email protected] asterisk]# [/size]
57: function get_var( $agi, $value)
58: {
59:        $r = $agi->get_variable( $value );

Haven’t looked further…

C.

I submitted a fix for this, if you update to version 0.3.1.2 it should work now.

I’m on 2.3.1.2 and still does the same thing for me… 411 results in a 0 and hangs-up… can you let us know what the fix is?