[asterisk-users] original & reformat extension

Karl Fife karlfife at gmail.com
Wed Aug 5 02:16:24 CDT 2009


Question:
Naturally there are times when need to I reformat an extension in a context as such: 

;Reformat add CC1
exten => _NXXNXXXXXX,1,Goto(1${EXTEN},1) 

-or-
;Reformat 011 with with +CC 
exten => _011X.     ,1,Goto(+${EXTEN:3},1) 

It's a helpful trick, BUT there are times when I want to send the call to another context in its original un-reformatted state.  Naturally the ${EXTEN} variable has been changed.  It occurred to me to use CALLERID(DNID) as such:

exten => _1NXXNXXXXXX,n(fail),Goto(other-context,${CALLERID(DNID)},1) 

...but I am wondering if I can be 100% confident that CALLERID(DNID) will always be equal to the 'original' ${EXTEN} variable.  I observe that they are the same, but it occurs to me that it may be up to the convention of my ITSP(s) or PRI provider to populate that value equal to the original ${EXTEN}, and therefore it may vary over time and between providers.

If the answer is "NO, CALLERID(DNID) is not reliable and can vary between providers and implementations", I then ask whether there is a RELIABLE place from which to fetch that original EXTEN value without the added dialplan overhead of saving it myself

Thanks!

-Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090805/c24e24d0/attachment.htm 


More information about the asterisk-users mailing list