Unable to use SHARED function in dialplan

Hi,
I am very new to asterisk and currently using 1.6.1 version, but on this i am unable to use SHARED function, every time i use it gives error "No Application for ‘SHARED’"
as wrote following in dialplan:
“exten=>_NXXX,1,SHARED(temp)”

Reason why i an using shared variable is to share variables between channels as i am doing something like this

my context is [call-test-file]
"exten => _NXXX,5,Dial(SIP/${EXTEN})
"
That is i am dialling sip number from a local channel which in turn is created from a call file.

So basically what i need is to get CDR for a variable in Local channel whose value is manipulated in SIP channel, such that in CDR value assigned in SIP channel is shown.

I am stuck into this for some time and their by posting into this forum, it will be nice if this gets answered ASAP.

Thanks
Shivam Agarwal