OK More to report, but can confirm that 302 redirects are currently not functioning correctly :( Any kamailio experts want to weigh in?
Here's where Kamailio starts when observing that a 302 needs to be handled:
As you can see, it stores the redirect (as evidenced by the log output from my previous post, as well)
At the end of the block of code I've highlighted, Kamailio should be removing all X-Headers from the SIP message.
The "Failure route ignoring reply 302 <null>" happens because the if conditions end up here:
But that is "ok" because all of this happened in the first place because of this:
(We were in INTERNAL_FAULT)
After we exit INTERNAL_FAULT, we continue on eventually to t_relay() which passes the 302 back to the client (this does occur)
However, the 302 that ends up reaching the SIP UA looks like this:
Notice that it still contains the X-Redirect-Server header? Ive tried injecting more instances of remove_hf_re("^X-.*"); even within the "stored redirect mapping..." codeblock, the X- headers are still present.
Aside from that being "odd", the SIP UA ACK's the 302, but then never sends another invite out after that. I've tried with multiple phones, Polycom, Aastra, Soft clients, they all seem to just give up at this point.
I have to presume that the intention here, is to have the phone 302 back to Kamailio itself (rather than modifying the Contact or Diversion headers to instruct the endpoint to go talk to the FS server directly), and when the INVITE comes back to the SBC, it will do a lookup in the redirect htable that it just stored some data in to, and handle redirecting the client to the appropriate FS server from there. That all makes sense, and from reading the dispatcher-role config, it appears it should work that way.
Just gotta figure out why the endpoint is receiving the 302 and giving up. Anyone see anything in that packet that looks wrong? Also kind of confusing that the X- headers are still there despite asking to remove them.
This is Kamailio 4.2.3, and the configs are from the master branch of kazoo-configs
The callflow im using to get this to happen in the first place is cf_eavesdrop_function, and it builds a 302 when the server the call i am trying to eavesdrop lives on a different FS server than the one my eavesdrop request call was received on.