User=phone and phone-context compatibility

Hello,

On an Asterisk 20 instance, I’m required to add a “phone-context=+1” or equivalent to SIP URIs when dialing out to the PSTN.
This phone-context is required to distinguish non-E164 domestic numbers (special-toll, short numbers, …) from E164 ones.
The PSTN trunk I’m using is set with user_eq_phone=yes.

When using Dial(PJSIP/12345@mytrunk), the outbound INVITE includes SIP URI like

12345@1.2.3.4;user=phone for request URI
<+123456799@9.8.7.6;user=phone> in From header
<12345@1.2.3.4;user=phone> in To header

When using Dial(PJSIP/123456;phone-context=+1@mytrunk), the outbound INVITE includes SIP URI like

12345;phone-context=+1@1.2.3.4 for request URI
<+123456799@9.8.7.6;user=phone> in From header
<12345;phone-context=+1@1.2.3.4;user=phone> in To header

When a ‘;phone-context=+1’ is appended at the end of a phone number, one may understand that this number is not a pure phone number anymore so ‘;user=phone’ must be removed
at the end of related SIP URIs (request and To URIs).
Symmetrically, the ‘;phone-context=+1’ can be considered a simple phone number attribute, so that ‘;user=phone’ still deserves its presence.

My questions are:

  1. Would you expect user=phone to be present or absent when a phone-context parameter is added like this at the end of dialed number ?
  2. How can I get my user=phone parameter back ?

Best regards

Have you tried including it in the dial string?

Not yet.
I wanted to know first both user=phone and phone-context are compatible with each other.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.