Fields
The API response also includes
trunk, the object that trunkRef points to.
Constraints
nameis required and must be 1 to 60 characters.telUrlmust be E.164:tel:+followed by 2 to 15 digits, the first not0. Otherwise the create answersINVALID_ARGUMENT: telUrl "<x>" is not E.164: use tel:+ followed by 2 to 15 digits, the first not 0; or set spec.data.enforceE164Numbers: false, and the Data API’sfilesbackend logs the same text with the Number’srefand exits. Withspec.data.enforceE164Numbers: false,telUrlonly has to start withtel:, as in Routr 2. The rule applies when a Number is created, or loaded from files;telUrlcan’t be updated, so stored Numbers are never checked again.telUrlmust be unique and up to 60 characters. Thefilesbackend refuses to load two Numbers with the sametelUrl.countryIsoCodemust be a country libphonenumber has a numbering plan for, in any case (gbworks).XX,ZZand three-letter codes such asGBRare rejected withINVALID_ARGUMENT: countryIsoCode "<x>" is not a country with a numbering plan; thefilesbackend logs the same text with the Number’srefand exits.- Each alias is 1 to 60 letters, digits, or
+ * . _ -. Otherwise:alias "<a>" is invalid: use 1 to 60 letters, digits or + * . _ -. An alias is compared exactly, including case, with the Request-URI user, and tried after every form of the number. - An alias is unique among the Numbers of the same Trunk:
alias "<a>" is already used by Number <ref> on this Trunk. The check runs when a create or update sends aliases, and when an update moves a Number to another Trunk; a rejected write changes nothing. Thefilesbackend checks every Number when it loads and exits on a violation. Two Trunks can use the same alias. - On update, a non-empty
aliaseslist replaces the stored aliases,clearAliases: trueremoves them all, and an update that sends neither keeps them.extraHeadersworks the same way withclearExtraHeaders: true. - An alias is matched only on the Number’s own Trunk, so a Number with no Trunk is never matched by alias.
- In YAML, quote each alias (
["01234"]): unquoted,01234is read as a number and the file is rejected. aorLinkmust start withsip:orbackend:. In YAML it must be 5 to 255 characters; in pgdata it can be up to 323.sessionAffinityHeaderand eachextraHeaders[].namemay contain only letters, digits, and dashes, and can’t end with a dash. In pgdata, eachextraHeaders[].valuemust be non-empty. The YAML schema requires neithernamenorvalue.- In YAML,
metadata.geoInfomust be present. The loader reads it for every Number. - When
extended.accessKeyIdis set, a Peer can use this Number forpeer-to-pstncalls only if its request carries the same value inX-Access-Key-Id.
How Connect uses a Number
from-pstn: a call from the Number’s Trunk goes to the endpoints registered underaorLink, withextraHeadersadded andX-DID-Numberset to the Number’s+E.164. The carrier doesn’t have to write the number exactly astelUrl: Connect also matches the same digits without the+, the Number’s national and international forms, read with itscountryIsoCode, and last itsaliases. Only the Trunk’s own Numbers are searched, so a Number with no Trunk gets no calls from the PSTN. See the order.agent-to-pstn: a Domain egress policy selects the Number. Its Trunk carries the call, and itstelUrlbecomes the caller ID inP-Asserted-IdentityandRemote-Party-ID.peer-to-pstn: the Peer names the Number in theX-DOD-Numberheader, as thetelUrlwithouttel:.- On
agent-to-pstnandpeer-to-pstncalls, the Number’scountryIsoCodeis the country the Trunk’s number formats read and write the numbers in.
YAML example
The following Number routes calls to a Peer and keeps calls with the sameX-Room-Id on one instance.
rctl equivalent
Run the interactive create command and answer the prompts. Enter aliases as a comma-separated list, and extra headers as comma-separatedName:value pairs.
rctl numbers for the prompts and the other actions.