Phone context

Last Updated : Apr 25, 2016 |

Phone Context is an optional field for ingress and egress adaptation rules. The allowed format for the Phone Context string can either be an E.164 number or a domain name (which can contain only alphanumeric characters, a hyphen, and periods).

Ingress message processing:

  • If the phone-context field of an ingress adaptation module rule contains a valid value, ingress adaptation is applied only if all four trigger fields (Matching Pattern, Min, Max, and Phone-context) match the header.

  • If the phone-context field is empty, ingress adaptation is applied based on the remaining fields (Matching Pattern, Min, and Max).

Egress message processing:

  • If the phone-context field of an egress adaptation module rule contains a valid value, the adaptation module modifies the digits and inserts phone-context when the three trigger fields Matching Pattern, Min, and Max) match the criteria.

  • If the phone-context field is empty, the egress adaptation module does not insert phone-context.

Precedence Rules

If a request matches the criteria of two rules (one with a valid phone-context and empty phone-context), the rule with valid phone-context string takes precedence. The following is an example of the rule precedence:

Rules

Ingress Adapter Rule

1

Matching pattern: 53853

Min: 7

Max: 7

Phone-Context:

Delete Digits: 3

Insert Digits: 538

Address to modify: both

2

Matching pattern: 538

Min: 7

Max: 7

Phone-Context: denver

Delete Digits: 0

Insert Digits: +1303

Address to modify: both

If an adapter has the above two rules, a request with R-URI of 5385335; phone-context=denver@avaya.com; user=phone matches both the rules. However, Rule 2 is selected for applying the adaptation because Rule 2 matches four fields as compared with three fields in Rule 1.

Presence of URI parameter phone-context and user=

During ingress adaptation, when the phone-context parameter is removed, the adaptation module also removes the URI parameter user= if it is present.

During egress adaptation, when the phone-context parameter is inserted, the adaptation module also inserts the URI parameter user=phone. However, if the URI parameter user=phone is already present, the adaptation module does not insert the parameter. The egress adaptation overwrites the phone-context parameter, if the parameter is present. If the phone-context parameter is present and egress adaptation does not result in a new phone-context, the egress adaptation does not change the original phone-context parameter.