I'm upgrading from OpenSER 1.2.2 to Kamailio 1.5.3 and I've run into a
problem with append_hf. It seems that my header only gets appended once
in a while.
Here's the shortened version of what I'm doing:
failure_route[1]{
if (t_check_status("(486)|(600)")){
# busy handler
route(15);
}
}
route[15]{
# look up forwarding number
....
if (does_uri_exist()){
append_hf("Diversion:
<sip:$var(orig_user)@$Ri>;user-id=\"$var(orig_user)@$Ri\";reason=busy\r\n");
t_relay();
}
}
Unfortunately, the Diversion header doesn't get set every time. I can't
see any difference in the logs from when it does get set and when it
doesn't. I added an xlog right above append_hf and confirmed that
append_hf runs each time.
On a whim I added a branch_route and called it using t_on_branch. I then
added duplicate code to call append_hf. I now seem to be getting more
instances of Diversion being set (twice!), but still not every time.
Is there something obvious I'm missing here? Any way I can ensure those
headers get set every time?
Corey