Apply HMR rules on new dialog only
I have an HMR rule in place that swaps the user part of the From header with the P-Asserted-Identity header on an Invite only. I'm doing this to authenticate a group of users with a single ID to a Broadsoft platform. This has been in production for a few months now and everything has worked well, until someone brought a transfer issue to my attention.
In this scenario, the dialog is established and then an asterisk box sends an INVITE to initiate a call transfer. My HMR swaps the above mentioned fields during this INVITE, and in fact it uses the P-Asserted-Id value that was in the INVITE that established the dialog. My question is, is there a way to only apply the rule for the first INVITE and subsequently ignore it for an INVITE within a dialog? Perhaps more generally, is there a way in HMR to determine if the request is within a dialog or is to establish a new dialog?