Extensions.conf -> timeconditions

Hi

For using extra nummers on my trunk i need to edit extensions.conf.

I have added the next lines to get it working.
[sip_proxy-incoming]
exten => s,1,Set(Var_TO=${SIP_HEADER(TO)})
exten => s,2,Set(Var_TO=${CUT(Var_TO,:,2)})
exten => s,3,Set(Var_TO=${CUT(Var_TO,@,1):-4})
exten => s,4,GotoIf($["${Var_TO}" = “4567”]?extension1,s,1:5)
exten => s,5,GotoIf($["${Var_TO}" = “4321”]?extension2,s,1:6)
exten => s,6,Wait(30)

[extension1]
exten => s,1,Dial(SIP/XXXX)
exten => s,n,Hangup()

[extension2]
exten => s,1,Dial(SIP/XXXX)
exten => s,n,Hangup()

I made time conditions in freepbx name TimeCore.
How can i get back on extension1 to the time condition TimeCore?? (instead of programming it in asterisk???)

Your message makes no sense.

You should not have to do any programming for nummers (sic) or any other additions.

The only way i get serveals did’s working in this trunk is with programming in externtions.conf.
I have testing the other way in the gui of freepbx but it does not see any did in the inbound.
Maybe you have a simple way to see the sip headers in the gui, i can only get it working this way.

The i must go back to the timeconditions from externtions.conf and i do not know how.

pls advices

You need to put you sip header cutting code in extensions_custom.conf so it will play nice with FreePBX. Just rip the header data out and then put it in $EXTEN and goto from-trunk. call your route from-suck-sip-header or some such thing and change the context of the trunk to match your custom context.

I am writing this on my phone so if it doesn’t make sense I can elaborate later.

Your answer looks simpel but i do not know how to do that.
How can i rip header data?

Could you pls show me the steps to do that?