Error with feature code, extensions.conf

Hello All

I am trying to enable call forwarding using the feature code 21number.

I have added the following to my extensions.conf file under the ‘phones’ context

[phones]
exten => _21X.,1,DBput(CFIM/{CALLERIDNUM}={EXTEN:4})
exten => _21X.,2,Hangup
exten => #21#,1,DBdel(CFIM/${CALLERIDNUM})
exten => #21#,2,Hangup

when i attempt the call i am disconnected and asterisk gives me the following error:

rejected because extension not found in context ‘phones’

Any help would be greatly appreciated, I am new to asterisk and editing the extensions.conf file.

Thank you!

To call what?

Missing $ in _21, priority 1, twice.
Nothing sets CALLERIDNUM.
No code to read back the value from the database.
Appears to stripping two digits from the destination number, before saving it.

David - thanks for the response. I am just about brand new to Asterisk and OpenBTS. Ive only been using the system for about 2 weeks, so i really appreciate any feedback…

We want to set up call forwarding. That is, if i call * 21 * number_ on one handset to forward calls to another handset. * 21 * being the GSM feature code, that i thought i had set up.

not sure why the * is missing from the first two lines, i copy and pasted it over. should the priority be 1 for the first line and n for the following lines?

Given that you will probably need a radio transmission licence from your government, I’m not sure that you want to be playing with OpenBTS until you have a good understanding of the rest of the system.

all that aside, can you point me in the direction of learning to use feature codes with asterisk? i would like to develop that good understanding you are referring too.

https://wiki.asterisk.org