[Home]

Summary:ASTERISK-09279: CALLERID(num) Unavailable Via GetVar
Reporter:jiddings (jiddings)Labels:
Date Opened:2007-04-18 14:50:56Date Closed:2007-04-18 23:37:39
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/ManagerInterface
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:When trying to retrieving the channel variable CALLLERID(num) with GetVar, it is always null... Though other variables work as expected. Is this by design?
Comments:By: jiddings (jiddings) 2007-04-18 14:52:28

retrieve* - typo. ;)

By: Clod Patry (junky) 2007-04-18 16:14:32

I've remarked a bug similar to this:

If you're request missing the Channel:
Action: GetVar
Variable: CALLERID(num)

Connection closed by foreign host.


this should not result to close the socket, but something like:
Response: Error
Message: Missing channel in request

By: Tilghman Lesher (tilghman) 2007-04-18 21:13:26

jiddings:  please upload the log of a manager session that exhibits this problem.  I'll note that the name of the variable you posted in the subject has an extra 'L'.  Something as silly as this has been the problem before.

junky:  that's a crash and should be fixed.

By: jiddings (jiddings) 2007-04-18 21:18:14

ASTERISK MANAGER OUTPUT:
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted

Response: Success
Variable: CALLERID(num)
Value: (null)

Response: Goodbye
Message: Thanks for all the fish.

----- php code -----

<?php
$socket = fsockopen("127.0.0.1","5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: xxxxxxxxx\r\n\r\n");
fputs($socket, "Action: GetVar\r\n");
fputs($socket, "Channel: Zap/1-1\r\n");
fputs($socket, "Variable: CALLERID(num)\r\n\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while (!feof($socket)) {
$wrets .= fread($socket, 8192);
}
fclose($socket);
echo <<<ASTERISKMANAGEREND
ASTERISK MANAGER OUTPUT:
$wrets
ASTERISKMANAGEREND;
?>

By: jiddings (jiddings) 2007-04-18 21:19:59

-- Executing [519974XXXX@default:1] NoOp("Zap/1-1", "407583XXXX") in new stack
-- Executing [519974XXXX@default:2] Goto("Zap/1-1", "admin|s|1") in new stack

-- extenions.conf --

exten => 519974XXXX,1,NoOp(${CALLERID(num)})
exten => 519974XXXX,n,Goto(admin,s,1)

By: jiddings (jiddings) 2007-04-18 21:20:59

The first log shows that I am calling for the CALLERID(num) -- that same examples shows the code I used to achieve that...

The second example shows that CALLERID(num) is indeed set on that channel.

By: Clod Patry (junky) 2007-04-18 21:46:04

Corydon: yep, i know, that issue is on my todo.

By: Tilghman Lesher (tilghman) 2007-04-18 21:52:49

Junky:  you're too late.  Fix in 61680, 61681, 61682.

By: Clod Patry (junky) 2007-04-18 21:53:48

Bastard =)

By: Tilghman Lesher (tilghman) 2007-04-18 22:17:45

jiddings:  are you definitely running 1.4?  I can see where this is not in 1.2, but for 1.4, this should be working.

By: jiddings (jiddings) 2007-04-18 22:21:18

Yup.

Asterisk SVN-branch-1.4-r61681

By: Tilghman Lesher (tilghman) 2007-04-18 23:37:39

Fixed in 61683, merged in 61684.