${SIPDOMAIN} and REFER

Hi,

I’m using Asterisk (15.2.2) in a multi-domain environment behind a Kamailio server.

To identify a customer, I’m using the variable {SIPDOMAIN}. This is working without any problem for INVITE requests (I suppose the information is taken from the From header) but the {SIPDOMAIN} is not set correctly in case of a REFER request.

For example, I get an INVITE from 201@domain1.com to 200@domain1.com, the call is established and users are talking. I the meantime I have another call from 300@domain2.com to 301@domain2.com. Next, 201@domain1.com send a REFER to 203@domain1.com, the ${SIPDOMAIN} variable is set to domain2.com instead of domain1.com

Is it a bug or a normal beheviour?

Best regards,

Cyrille