This variable should contain the number of the called party. Unfortunately it is broken for now and only contains the second part of the internal/temporary channel information (the part after the technology ie gs1-8b21 if the DIALEDPEERNAME was ‘SIP/gs1-8b21).
See bug 0002590 on http://bugs.digium.com
Workaround for SIP:
exten => s,1,Answer
exten => s,2,Set(FOO1=${CHANNEL:4})
exten => s,3,Set(FOO1=${CUT(FOO1,-,1})
; FOO1 will now contain the dialed peernumber of the current SIP channel. peernumber must not have a "-" in it though.
; Let's say peernumber is 555, you'd then jump to the extension like this:
exten => s,4,Goto(${FOO1},1)
exten => 555,1,DoWhatever