Header rules
Your phone system sometimes needs more than “send the call to this host”. It may require a custom X- header, a different number in a SIP identity field, or a Diversion value on the invite Myrmur sends. Header rules are how you describe those rewrites for calls that travel through a server list.
Skip this page unless your PBX or SBC documentation asked for those fields. Rules do not apply to a direct SIP connection, forward, SMS, or an AI agent. They cannot change which server is chosen, or its host, port, transport, priority, or share. The server list still owns delivery and failover.
If the Header rules tab is missing, ask Myrmur to switch them on (they travel with server lists and the delivery path).


What you are building
A rule set belongs to your account. You name it, list the managed X- headers you care about, add rules and actions in order, then Save changes. Saving creates a live version. If any server lists are already attached, those lists pick up the new version for new calls (normally within about a minute). Calls already in progress keep what they started with.
There is no separate customer “publish” button. Save is the commit. Attach is the step that puts the saved rules on a list.
Each server list can carry one rule set at a time. One rule set can attach to several lists.
Walk through the first set
Open Connections → Header rules.
Choose New rule set. Give it a Name only your team sees (“Reception headers”, “CRM X-Account-Ref”). You add the actual rules on the next screen.
On the editor, open Managed headers and add every custom header name you intend to control. Each name must start with
X-, then 1–48 letters, digits, or hyphens. Myrmur matches names without caring about case.Understand the managed-header contract before you save: for every name on that list, Myrmur removes all incoming copies before your actions run. If you list a header and never write an action for it, those incoming copies disappear and nothing replaces them. Only managed names can be added, replaced, or removed by an action.
Add rules from top to bottom (every call using the set runs them in that order; there are no conditions or caller filters). Inside each rule, add actions in the order they should run. Give each rule a distinct name so you can recognise it later on a delivery attempt.
Optional but useful: open Preview with a SIP INVITE, paste an example INVITE from your phone system (strip secrets first), set the dialled Myrmur number if needed, and choose Preview changes. Preview uses your current edits, even before save. It does not place a call, does not save, and is not a byte-for-byte copy of what the network will send after routing. Use it to see which actions would run or be skipped.
Choose Save changes. If nothing is attached yet, the notice tells you to attach a list. If lists are attached, the notice says how many lists will use the new version.
Under Server lists on the same page, choose a list and Attach rule set. Confirm you have reviewed the change. The list must be active and must not already carry another set (detach the other set there first; there is no direct swap).
Point a Myrmur number at that server list from Numbers (if it is not already), place a test call, then open the number’s Delivery attempts. You should see a header decision that names your rules (values themselves are not shown). That is how you know the edge picked up the set. An attempt does not prove your PBX accepted every value or that a person answered.
Actions you can use
| Action | What it changes |
|---|---|
| Add a header | Adds a managed X- header with the value you supply. |
| Replace a header | Removes any current copies of that managed X- header, then writes your value. |
| Remove a header | Removes that managed X- header. |
| Change the dialled number | Changes the user part of the outgoing SIP request address. Does not change which server was chosen. |
| Change the To number | Changes the user part of the SIP To address. |
| Change the caller | Changes the SIP From user part, display name, or both. |
| Diverting number | Adds the dialled Myrmur number as Diversion, or sends no Diversion header. |
Identity work (To, From, Diversion) goes through these actions. You cannot edit those names, or other protected SIP headers, as ordinary X- fields. Names beginning X-Myrmur-, X-Numbat-, and X-Edge- are reserved for the platform.
Values from the call
Type a fixed string, or insert a token exactly as shown. You can combine them (account-{{did.e164}}).
| Token | Value | Where it can be used |
|---|---|---|
{{did.e164}} | The Myrmur number the caller dialled, international form | Header values and number fields |
{{caller.e164}} | The caller’s number in international form, when available | Header values and number fields |
{{caller.display}} | The name presented by the caller | Header values and caller display name |
{{call.id}} | The call’s SIP reference | Header values only |
Only the two verified E.164 tokens can build a SIP number field. Fixed text in a number field may use letters, digits, +, ., _, and -, up to 64 characters after expansion. If a call lacks a variable an action needs, or the expanded value is too long or unsafe, that action is skipped and the rest continue. Preview shows skips for its example INVITE.
Stop or change a set
- To stop rules on one list: Detach that list on the rule set page. After the network refreshes, new calls stop both the rewrites and the stripping of that set’s managed incoming headers.
- To use a different set on a list: detach the current one, then attach the replacement.
- Switch off blocks further edits and new attachments. It does not stop rules already attached. Detach each list if you want new calls to stop using them. Switch on allows edits and attachments again.
- Delete is only for a brand-new set that has never been saved with a version and has no attachments. Sets with history stay for that history.
Limits worth knowing
Up to 25 rule sets per account; 32 managed headers, 16 rules, and 8 actions per rule; 256 characters per template; a shared 2,048-byte budget for header actions. The editor catches common mistakes; Myrmur validates the whole set on save. If save is refused, fix the marked field and save again.
When it misbehaves
- Attach is disabled: save first (chip should show you are ready to attach), clear unsaved edits, and make sure the rule set is switched on.
- List shows “(another rule set attached)”: detach that set from the list’s page or from the other rule set, then attach this one.
- Delivery attempts show rules absent or unchanged: confirm the number’s Where calls go is the server list you attached, wait about a minute, place a new call, and confirm the set is not merely switched off with an old attachment you forgot to detach.
- Preview looked good but the PBX still rejects the invite: preview is not a network guarantee. Check what your system actually requires, and read skip reasons on real attempts.
Related: Server lists, Connections overview, Route a number.