> For the complete documentation index, see [llms.txt](https://itgro-aly.gitbook.io/test-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://itgro-aly.gitbook.io/test-docs/custom_common/trunk-and-client-number.md).

# trunk and client number

Для склеивания имени контакта из битрикса и номера линии исправляем экстеншн, используемый для автораспределения в /etc/asterisk/extensions.conf .

**В данном примере:**

DID транка – 17472325060

Имя транка – TEST\_LINE

```
exten => 17472325060,1,Set(CALLERID(num)=${CALLERID(num):1})
same = n,Set(DB(CLID_OUT/${CALLERID(num)})=${EXTEN})
same = n,Set(CURLOPT(hashcompat)=yes)
same = n,Set(CURLOPT(httptimeout)=5)
same = n,Set(CURLOPT(conntimeout)=5)
same = n,Set(HASH(forwardHash)=${CURL(http://localhost:8077/forward?phone=${CALLERID(num)})})
same = n,Set(CALLERID(name)=TEST_LINE-${HASH(forwardHash,name)})
same = n,GoSub(callrecord,${EXTEN},1)
same = n,NoOp(${CALLERID(num)})
same = n,NoOp(${CALLERID(name)})
same = n,Dial(SIP/213)
same = n,Hangup()
```

{% hint style="danger" %}
При внесении изменений в диалплан Астериска нужно быть предельно внимательным.\
Это может влиять на логику всех звонков, в том числе полностью отключить прием звонков.
{% endhint %}
