-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
I add some private headerfields (append-hf) during main route resp. sub-routes like "route(3)" and in certain cases I want to remove (remove_hf) some of them in main route befor sending request out. Unfortunately that doesn't work.
Even when I add a header field and test for it directly afterwards or try to remove it, openser doesn't find anything. Test-Code is like this:
append_hf("P-SI: sad\r\n"); if(is_present_hf("P-SI")) xlog("L_INFO", "######## Found\n"); if(remove_hf("P-SI")) xlog("L_INFO", "######## Removed\n");
textops doc has a hint at append_hf:
" ... Note: Headers which are added in main route cannot be removed in further routes (e.g. failure routes). So, the idea is not to add there any headers that you might want to remove later. To add headers temporarely use the branch route because the changes you do there are per-branch. "
Not sure if this is the reason for my problem. Is this a bug? Is there a way to add header fields temporarely?
regards Helmut
On Tuesday 08 January 2008 11:52:00 Helmut Kuper wrote:
Even when I add a header field and test for it directly afterwards or try to remove it, openser doesn't find anything. Test-Code is like this:
append_hf("P-SI: sad\r\n"); if(is_present_hf("P-SI")) xlog("L_INFO", "######## Found\n"); if(remove_hf("P-SI")) xlog("L_INFO", "######## Removed\n");
Headers are added when the message leaves OpenSer. It's a bad idea to add/remove headers and try to read/test them after that. Instead you can use variables or AVP's to get the same funcionality.
On Tuesday 08 January 2008 11:52:00 Helmut Kuper wrote:
I add some private headerfields (append-hf) during main route resp. sub-routes like "route(3)" and in certain cases I want to remove (remove_hf) some of them in main route befor sending request out. Unfortunately that doesn't work.
Instead, store that info in variables of flags and later, just before t_relay(), add headers or not depending on the content of these variables.
Regards.