Ticket #5492 (closed Bugs: fixed)

Opened 1 year ago

Last modified 1 year ago

callback not working

Reported by: sr377 Assigned to:
Priority: minor Milestone: 2.11
Component: Callback Version: 2.10-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

call back by version 2.10b not working.

Change History

01/14/12 13:13:24 changed by AndrewZ

Same issue.

Clean install of FPBX-2.9, immediately upgraded to FPBX-2.10.0beta3 on Ubuntu server 10.04

Callback doesn't work at all - incoming call rejected, no outgoing call placed:

-- Goto (callback,1,1)
-- Executing [1@callback:1] Set("SIP/Multifon-0000005e", "CALL=44") in new stack
-- Executing [1@callback:2] Set("SIP/Multifon-0000005e", "DESTINATION=ivr-2.s.1") in new stack
-- Executing [1@callback:3] Set("SIP/Multifon-0000005e", "SLEEP=3") in new stack
-- Executing [1@callback:4] System("SIP/Multifon-0000005e", "/var/lib/asterisk/bin/callback 44 ivr-2.s.1 3 &") in new stack
-- Executing [1@callback:5] Hangup("SIP/Multifon-0000005e", "") in new stack
== Spawn extension (callback, 1, 5) exited non-zero on 'SIP/Multifon-0000005e'

01/14/12 13:28:48 changed by AndrewZ

Just in case, the script is there:

~$ ll /var/lib/asterisk/bin/callback
lrwxrwxrwx 1 asterisk asterisk 49 2012-01-05 23:09 /var/lib/asterisk/bin/callback -> /var/www/html/admin/modules/callback/bin/callback

~$ ll /var/www/html/admin/modules/callback/bin/callback
-rwxrwxr-x 1 asterisk asterisk 2449 2011-08-05 01:39 /var/www/html/admin/modules/callback/bin/callback

01/26/12 12:55:04 changed by markuu

Having the same problem. Any updates on this?

Running Asterisk 1.8.8.0 PBX Firmware: 1.0.0.0 PBX Service Pack: 1.88.210.57-1

10.0rc1.0

Backup & Restore 2.10.0.6 Enabled Blacklist 2.10.0.0 Enabled Bulk Phone Restart 2.10.0.1 Enabled CallerID Lookup 2.10.0.0 Enabled Custom Applications 2.10.0.0 Enabled DUNDi Lookup Registry 2.10.0.0 Enabled Feature Code Admin 2.10.0.1 Enabled FreePBX ARI Framework 2.10.0rc1.0 Enabled FreePBX FOP Framework 2.10.0.2 Enabled PBX Framework 2.10.0rc1.0 Enabled Java SSH 2.10.0.0 Enabled Online Support 2.10.0.1 Enabled Phonebook 2.10.0.0 Enabled Phonebook Directory 2.10.0.0 Enabled Recordings 3.3.11.4 Enabled System Admin 2.10.0.20 Enabled User Panel 2.10.0.0 Enabled

I see this, and then nothing... pbx2*CLI>

== CDR updated on SIP/fpbx-2-2f9de31c-00000111

-- Executing [5@ivr-2:1] Goto("SIP/fpbx-2-2f9de31c-00000111", "callback,1,1") in new stack -- Goto (callback,1,1) -- Executing [1@callback:1] Set("SIP/fpbx-2-2f9de31c-00000111", "CALL=2f9de31c") in new stack -- Executing [1@callback:2] Set("SIP/fpbx-2-2f9de31c-00000111", "DESTINATION=app-blackhole.musiconhold.1") in new stack -- Executing [1@callback:3] Set("SIP/fpbx-2-2f9de31c-00000111", "SLEEP=10") in new stack -- Executing [1@callback:4] System("SIP/fpbx-2-2f9de31c-00000111", "/var/lib/asterisk/bin/callback 2f9de31c app-blackhole.musiconhold.1 10 &") in new stack -- Executing [1@callback:5] Hangup("SIP/fpbx-2-2f9de31c-00000111", "") in new stack

== Spawn extension (callback, 1, 5) exited non-zero on 'SIP/fpbx-2-2f9de31c-00000111'

-- Executing [h@macro-dialout-trunk:1] Macro("SIP/6006-0000010f", "hangupcall,") in new stack -- Executing [s@macro-hangupcall:1] GotoIf?("SIP/6006-0000010f", "1?theend") in new stack -- Goto (macro-hangupcall,s,3) -- Executing [s@macro-hangupcall:3] Hangup("SIP/6006-0000010f", "") in new stack

== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'SIP/6006-0000010f' in macro 'hangupcall' == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on 'SIP/6006-0000010f' == Spawn extension (macro-dialout-trunk, s, 22) exited non-zero on 'SIP/6006-0000010f' in macro 'dialout-trunk' == Spawn extension (from-internal, 3072007900, 5) exited non-zero on 'SIP/6006-0000010f'

03/06/12 17:41:33 changed by john@erba.tv

I have debugged callback on freepbx 2.10 using asterisk 1.8.10.0. The problem is in the freepbx class which calls asterisk manager interface.

In fact freepbx log shows errors like these: 2012-Mar-06 23:24:56 /srv/www/htdocs/admin/libraries/php-asmanager.php:635 [WARNING]: Invalid argument supplied for foreach()

2012-Mar-06 23:24:56 /srv/www/htdocs/admin/libraries/php-asmanager.php:640 [NOTICE]: Undefined variable: parameters

2012-Mar-06 23:24:56 /srv/www/htdocs/admin/libraries/php-asmanager.php:208 [WARNING]: Invalid argument supplied for foreach()

The solution seems a simple change. After this callback is working.

In freepbx libraries/php-asmanager.php line 598

if ($num_args === 11) {

should be replaced by

if ($num_args === 10) {

03/06/12 17:53:25 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [13775]) fixes #5492 re #5443 check for the proper number of arguments to run in old mode

03/06/12 18:09:07 changed by p_lindheimer

(In [13777]) Merged revisions 13775 via svnmerge from http://www.freepbx.org/v2/svn/freepbx/branches/2.10

........

r13775 | p_lindheimer | 2012-03-06 14:53:25 -0800 (Tue, 06 Mar 2012) | 1 line

fixes #5492 re #5443 check for the proper number of arguments to run in old mode

........

03/07/12 16:52:19 changed by john@erba.tv

Just a further update on this. Running with my proposed fix above, the ARI feature for playing back voicemail on your extension does not work. Here is the problem:

in recording/includes/callme.php line 105, originate is called with 11 arguments (the last one is null). So that corresponds to the number of parameters that originate in php-asmanager.php was expecting (even though it does nothing with the last one).

This is a bit of a mystery to me. The fix is to modify callme.php to pass only 10 parameters:

$status = $astman->Originate($channel, $extension, $context, $priority, NULL, $callerid, $variable, NULL, NULL, NULL);

instead of:

$status = $astman->Originate($channel, $extension, $context, $priority, NULL, $callerid, $variable, NULL, NULL, NULL, NULL);

but that leaves the question: where else in freepbx is originate being called with 11 parameters and what is the meaining of the last parameter. If the last one is always null, the calls can be modified like above. If the last parameter actually is for some purpose, then php-asmanager.php will need updating to actually do something with the parameter.

Or maybe callme.php had got the wrong number of parameters and php-asmanager.php was modified to accept the wrong number (11).

03/07/12 17:15:50 changed by john@erba.tv

I did a bit of checking. php-asmanager.php was updated to check for 11 parameters instead of 10 in

http://www.freepbx.org/trac/changeset/12941

then callme.php was updated to pass 11 parameters. http://www.freepbx.org/trac/changeset/13406

this last changeset needs to be backed out, 10 is the right number.

03/07/12 17:37:48 changed by mbrevda

john@erba.tv - 10 currently is what we have checked in. As far as callback, you can eleviate the 10 vs 11 mystery by passing in an array instead, with just the REQUIRED paramaters. Something along these lines:

$status = $astman->Originate(array(
	'channel'	=> $channel,
	'extension'	=> $extension,
	'context'	=> $context,
	/* SNIP */
));

03/07/12 18:52:36 changed by p_lindheimer

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from Undetermined to 2.11.

Looks like the issue here is related to something we've been ignoring for quite some time which is that there are two php-asmanager.php libraries which are substantially the same but not identical. I'll have a look at both with regards to the Originate command here to figure out how to best address this.

Re-opening for now until I an deal with the latest twist here.

03/07/12 23:14:46 changed by p_lindheimer

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [13781]) fixes #5492 callback issue re #5565 reverts r13406

03/07/12 23:22:38 changed by p_lindheimer

(In [13789]) Merged revisions 13780-13781 via svnmerge from http://www.freepbx.org/v2/svn/freepbx/branches/2.10

........

r13780 | p_lindheimer | 2012-03-07 20:05:52 -0800 (Wed, 07 Mar 2012) | 1 line

add Reload action and call instead of CLI module reload to trigger reload, re #5646 fixes the issue but other versions of FreePBX still broke as it's a real Asterisk bug

........

r13781 | p_lindheimer | 2012-03-07 20:14:46 -0800 (Wed, 07 Mar 2012) | 1 line

fixes #5492 callback issue re #5565 reverts r13406

........