# COUNTRY\_TO\_PHONE\_PREFIX

### Description

`COUNTRY_TO_PHONE_PREFIX` returns the international telephone calling code for a given ISO 3166-1 country code, as a string prefixed with `+`. Both alpha-2 (2-letter) and alpha-3 (3-letter) codes are accepted.

Returns `unknown` if the input is not a recognised country code.

### Syntax

```
COUNTRY_TO_PHONE_PREFIX(country_code)
```

**Returns:** A string such as `'+41'`, or `unknown` if the input is unrecognised.

### Example

```
COUNTRY_TO_PHONE_PREFIX('CH')
```

This returns `'+41'`.

```
COUNTRY_TO_PHONE_PREFIX('CHE')
```

This also returns `'+41'`.

```
COUNTRY_TO_PHONE_PREFIX('US')
```

This returns `'+1'`.

```
COUNTRY_TO_PHONE_PREFIX('XX')
```

This returns `unknown` — `'XX'` is not a valid ISO country code.

### Example in context

```
p is Person
CONCAT(COUNTRY_TO_PHONE_PREFIX(p.country), p.local_phone_number)
```

Combines the calling prefix for the person's country with their local number to produce a full international phone number, e.g. `'+41791234567'`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/special-operators/country_to_phone_prefix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
