{"id":323294,"date":"2021-05-17T21:00:52","date_gmt":"2021-05-17T21:00:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=323294"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=323294","title":{"rendered":"Asterisk. \u0418 \u0441\u043d\u043e\u0432\u0430 AMI Originate"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b &#171;<a href=\"https:\/\/habr.com\/ru\/post\/265647\/\" rel=\"noopener noreferrer nofollow\">AMI. \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 Originate. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 CTI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>&#171;. \u041d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430, \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043d\u0430. \u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f. <\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 Originate<\/h2>\n<pre><code>Action: Originate Channel: PJSIP\/201 Context: all-peers Exten: 203 Priority: 1 Callerid: 201<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 <strong>all-peers<\/strong><\/p>\n<pre><code>[all-peers] exten =&gt; _X!,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt) \tsame =&gt; n,Hangup()<\/code><\/pre>\n<ul>\n<li>\n<p><strong>201<\/strong> \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u043d\u0430 <strong>203<\/strong><\/p>\n<\/li>\n<li>\n<p>callerid \u0443 <strong>201<\/strong> \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a <strong>201<\/strong> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 &#171;<strong>Callerid<\/strong>&#187; \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 <strong>Originate<\/strong>) <\/p>\n<\/li>\n<li>\n<p>callerid \u0443 <strong>203<\/strong> \u043e\u0442\u043e\u0431\u0440\u0430\u0449\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a <strong>201<\/strong> &#8212; \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f  <\/p>\n<p><code>2021-05-17 16:34:17|2021-05-17 16:34:20|2021-05-17 16:34:32|201|PJSIP\/201-0000000a|203|PJSIP\/203-0000000b <\/code><\/p>\n<p>\u0412 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. <\/p>\n<p>\u0427\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>201 \u0432\u0438\u0434\u0438\u0442 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440, \u0441 \u043a\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f 201 \u0431\u0443\u0434\u0435\u0442 \u0437\u0432\u043e\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 contact. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0432\u043e\u043d\u0438\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 201 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/p>\n<\/li>\n<\/ul>\n<hr>\n<h2>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 <strong>extensions.conf<\/strong><\/p>\n<pre><code class=\"lua\">[internal-orig] exten =&gt; _X!,1,Set(DST_CONTACT=${PJSIP_DIAL_CONTACTS(${EXTEN})})   same =&gt; n,ExecIf($[\"${DST_CONTACT}x\" != \"x\"]?Dial(${DST_CONTACT},30,Tt))<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c Originate \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0430, \u0437\u0432\u043e\u043d\u044f\u0442 \u0432\u0441\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u043e, \u0432 CDR  \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0448\u0430:<\/p>\n<pre><code>2021-05-17 17:01:09|2021-05-17 17:01:12|2021-05-17 17:01:17|203|Local\/201@internal-orig-00000006;2|201|PJSIP\/201-00000012 2021-05-17 17:01:09|2021-05-17 17:01:12|2021-05-17 17:01:17|201|Local\/201@internal-orig-00000006;1|203|PJSIP\/203-00000013<\/code><\/pre>\n<ul>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <strong>Local<\/strong> \u043a\u0430\u043d\u0430\u043b\u044b <\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043f\u043e\u0437\u0436\u0435. <\/p>\n<h2>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 CallerID \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 AMI \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>origCid=203<\/strong>:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201 Variable: origCid=203 <\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c &#171;<strong>Exten<\/strong>&#187; \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 AMI. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c dialplan:<\/p>\n<pre><code>[internal-orig] exten =&gt; _X!,1,Set(D_CONT=${PJSIP_DIAL_CONTACTS(${EXTEN})})   same =&gt; n,Set(CALLERID(num)=${origCid})   same =&gt; n,ExecIf($[\"${D_CONT}x\" != \"x\"]?Dial(${D_CONT},${ringlength},Tt))<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0432\u0438\u0434\u0438\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 <strong>callerid<\/strong>. <\/p>\n<h2>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 CDR<\/h2>\n<p>\u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u043e.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u0431\u0438\u0442\u044c Local \u043a\u0430\u043d\u0430\u043b\u044b (hangup)<\/p>\n<\/li>\n<li>\n<p>Local \u043a\u0430\u043d\u0430\u043b\u044b \u041d\u0415 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c CDR \u0437\u0430\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. <\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e &#171;\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430&#187; (\u041d\u0415 Local) \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e <strong>U(orig-answer-channel)<\/strong> \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <strong>Dial<\/strong><\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 <strong>orig-answer-channel <\/strong>\u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>[orig-answer-channel] exten =&gt; s,1,Set(MASTER_CHANNEL(O_SRC_CHAN)=${CHANNEL})   same =&gt; n,return<\/code><\/pre>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430. <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0412 \u043d\u0435\u043c \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0432\u0441\u0435 <strong>Local<\/strong> \u043a\u0430\u043d\u0430\u043b\u044b \u0438 &#171;\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b&#187; \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>[all-peers] exten =&gt; _X!,1,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?ChannelRedirect(${O_SRC_CHAN},${CONTEXT},${EXTEN},1))   same =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?Hangup())   same =&gt; n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt)   same =&gt; n,Hangup()<\/code><\/pre>\n<p>\u0412 &#171;<strong>all-peers<\/strong>&#187; \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e\u043f\u0430\u0434\u0435\u0442 Local \u043a\u0430\u043d\u0430\u043b. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e \u0432 <strong>verbose<\/strong> \u043b\u043e\u0433\u0435:<\/p>\n<pre><code>Executing [203@all-peers:1] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?NoCDR()\") Executing [203@all-peers:2] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?ChannelRedirect(PJSIP\/201-00000016,all-peers,203,1)\") Executing [203@all-peers:3] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?Hangup()\")<\/code><\/pre>\n<p>\u0411\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#171;<strong>ChannelRedirect<\/strong>&#187; \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u043e\u0432\u0430\u043d \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 Local \u043a\u0430\u043d\u0430\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b. <\/p>\n<pre><code>Executing [203@all-peers:1] ExecIf(\"PJSIP\/201-00000016\", \"0?NoCDR()\") Executing [203@all-peers:2] ExecIf(\"PJSIP\/201-00000016\", \"0?ChannelRedirect(,all-peers,203,1)\") Executing [203@all-peers:3] ExecIf(\"PJSIP\/201-00000016\", \"0?Hangup()\") Executing [203@all-peers:4] Dial(\"PJSIP\/201-00000016\", \"PJSIP\/203\/sip:203@172.16.156.1:59442;ob,30,Tt\")<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 &#171;<strong>all-peers<\/strong>&#187; \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e sip \u043f\u0438\u0440\u0430, \u0442\u043e\u0433\u0434\u0430 \u0437\u0432\u043e\u043d\u043e\u043a \u0447\u0435\u0440\u0435\u0437 <strong>Originate<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c\u0443 \u0437\u0432\u043e\u043d\u043a\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>NoCDR<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c cdr \u0437\u0430\u043f\u0438\u0441\u0438 Local \u043a\u0430\u043d\u0430\u043b\u043e\u0432. <\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/h2>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 AMI \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201 Variable: origCid=203<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 dialplan, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432 \u043d\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u0432\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 <strong>NoCDR<\/strong>: <\/p>\n<pre><code>[internal-orig] exten =&gt; _X!,1,NoCDR() \tsame =&gt; n,Set(MASTER_CHANNEL(O_DST_CHAN)=${origCid}) \tsame =&gt; n,Set(CALLERID(num)=${origCid}) \tsame =&gt; n,Set(DST_CONTACT=${PJSIP_DIAL_CONTACTS(${EXTEN})}) \tsame =&gt; n,ExecIf($[\"${DST_CONTACT}x\" != \"x\"]?Dial(${DST_CONTACT},${ringlength},TtU(orig-answer-channel),s,1)))  [orig-answer-channel] exten =&gt; s,1,Set(MASTER_CHANNEL(O_SRC_CHAN)=${CHANNEL})   same =&gt; n,return  [all-peers] exten =&gt; _X!,1,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?NoCDR()) \tsame =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?ChannelRedirect(${O_SRC_CHAN},${CONTEXT},${O_DST_CHAN},1)) \tsame =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?Hangup()) \tsame =&gt; n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt) \tsame =&gt; n,Hangup() \t<\/code><\/pre>\n<p>\u0412 CDR \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c<\/p>\n<pre><code>2021-05-17 17:29:07|2021-05-17 17:29:10|2021-05-17 17:29:14|201|PJSIP\/201-00000018|203|PJSIP\/203-00000019<\/code><\/pre>\n<p>\u0422\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e! \ud83d\ude42<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u042f \u043d\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e, \u0447\u0442\u043e \u043e\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c. <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0410\u0422\u0421 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/www.mikopbx.ru\" rel=\"noopener noreferrer nofollow\">MikoPBX<\/a>. <\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/265647\/\" rel=\"noopener noreferrer nofollow\">AMI. \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 Originate. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 CTI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/wiki.asterisk.org\/wiki\/display\/AST\/ManagerAction_Originate\" rel=\"noopener noreferrer nofollow\">ManagerAction_Originate<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/wiki.asterisk.org\/wiki\/display\/AST\/Application_ChannelRedirect\" rel=\"noopener noreferrer nofollow\">Application_ChannelRedirect<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/mikopbx\/Core\" rel=\"noopener noreferrer nofollow\">MikoPBX<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/557850\/\"> https:\/\/habr.com\/ru\/post\/557850\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0420\u0430\u043d\u0435\u0435 \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b &#171;<a href=\"https:\/\/habr.com\/ru\/post\/265647\/\" rel=\"noopener noreferrer nofollow\">AMI. \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 Originate. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 CTI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a>&#171;. \u041d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430, \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u043d\u0430. \u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f. <\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 Originate<\/h2>\n<pre><code>Action: Originate Channel: PJSIP\/201 Context: all-peers Exten: 203 Priority: 1 Callerid: 201<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 <strong>all-peers<\/strong><\/p>\n<pre><code>[all-peers] exten =&gt; _X!,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt) \tsame =&gt; n,Hangup()<\/code><\/pre>\n<ul>\n<li>\n<p><strong>201<\/strong> \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u043d\u0430 <strong>203<\/strong><\/p>\n<\/li>\n<li>\n<p>callerid \u0443 <strong>201<\/strong> \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a <strong>201<\/strong> (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 &#171;<strong>Callerid<\/strong>&#187; \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 <strong>Originate<\/strong>) <\/p>\n<\/li>\n<li>\n<p>callerid \u0443 <strong>203<\/strong> \u043e\u0442\u043e\u0431\u0440\u0430\u0449\u0438\u0442\u044c\u0441\u044f \u043a\u0430\u043a <strong>201<\/strong> &#8212; \u0432\u0441\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f  <\/p>\n<p><code>2021-05-17 16:34:17|2021-05-17 16:34:20|2021-05-17 16:34:32|201|PJSIP\/201-0000000a|203|PJSIP\/203-0000000b <\/code><\/p>\n<p>\u0412 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e. <\/p>\n<p>\u0427\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>201 \u0432\u0438\u0434\u0438\u0442 \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u043e\u043c\u0435\u0440, \u0441 \u043a\u0435\u043c \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0437\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0434\u043b\u044f 201 \u0431\u0443\u0434\u0435\u0442 \u0437\u0432\u043e\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 contact. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0432\u043e\u043d\u0438\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 201 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/p>\n<\/li>\n<\/ul>\n<hr>\n<h2>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e<\/h2>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 <strong>extensions.conf<\/strong><\/p>\n<pre><code class=\"lua\">[internal-orig] exten =&gt; _X!,1,Set(DST_CONTACT=${PJSIP_DIAL_CONTACTS(${EXTEN})})   same =&gt; n,ExecIf($[\"${DST_CONTACT}x\" != \"x\"]?Dial(${DST_CONTACT},30,Tt))<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c Originate \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0430, \u0437\u0432\u043e\u043d\u044f\u0442 \u0432\u0441\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u043e, \u0432 CDR  \u0442\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0448\u0430:<\/p>\n<pre><code>2021-05-17 17:01:09|2021-05-17 17:01:12|2021-05-17 17:01:17|203|Local\/201@internal-orig-00000006;2|201|PJSIP\/201-00000012 2021-05-17 17:01:09|2021-05-17 17:01:12|2021-05-17 17:01:17|201|Local\/201@internal-orig-00000006;1|203|PJSIP\/203-00000013<\/code><\/pre>\n<ul>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <strong>Local<\/strong> \u043a\u0430\u043d\u0430\u043b\u044b <\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0432\u0441\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u043f\u043e\u0437\u0436\u0435. <\/p>\n<h2>\u041a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 CallerID \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 AMI \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>origCid=203<\/strong>:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201 Variable: origCid=203 <\/code><\/pre>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c &#171;<strong>Exten<\/strong>&#187; \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 AMI. <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043c dialplan:<\/p>\n<pre><code>[internal-orig] exten =&gt; _X!,1,Set(D_CONT=${PJSIP_DIAL_CONTACTS(${EXTEN})})   same =&gt; n,Set(CALLERID(num)=${origCid})   same =&gt; n,ExecIf($[\"${D_CONT}x\" != \"x\"]?Dial(${D_CONT},${ringlength},Tt))<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0432\u0438\u0434\u0438\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 <strong>callerid<\/strong>. <\/p>\n<h2>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 CDR<\/h2>\n<p>\u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0430\u043b\u043e.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443:<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u0431\u0438\u0442\u044c Local \u043a\u0430\u043d\u0430\u043b\u044b (hangup)<\/p>\n<\/li>\n<li>\n<p>Local \u043a\u0430\u043d\u0430\u043b\u044b \u041d\u0415 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c CDR \u0437\u0430\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u0437\u0432\u043e\u043d\u044f\u0449\u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. <\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e &#171;\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430&#187; (\u041d\u0415 Local) \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e <strong>U(orig-answer-channel)<\/strong> \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 <strong>Dial<\/strong><\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 <strong>orig-answer-channel <\/strong>\u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>[orig-answer-channel] exten =&gt; s,1,Set(MASTER_CHANNEL(O_SRC_CHAN)=${CHANNEL})   same =&gt; n,return<\/code><\/pre>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 &#8212; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043c\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430. <\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0412 \u043d\u0435\u043c \u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0432\u0441\u0435 <strong>Local<\/strong> \u043a\u0430\u043d\u0430\u043b\u044b \u0438 &#171;\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b&#187; \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>[all-peers] exten =&gt; _X!,1,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?ChannelRedirect(${O_SRC_CHAN},${CONTEXT},${EXTEN},1))   same =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?Hangup())   same =&gt; n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt)   same =&gt; n,Hangup()<\/code><\/pre>\n<p>\u0412 &#171;<strong>all-peers<\/strong>&#187; \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u043e\u043f\u0430\u0434\u0435\u0442 Local \u043a\u0430\u043d\u0430\u043b. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e \u0432 <strong>verbose<\/strong> \u043b\u043e\u0433\u0435:<\/p>\n<pre><code>Executing [203@all-peers:1] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?NoCDR()\") Executing [203@all-peers:2] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?ChannelRedirect(PJSIP\/201-00000016,all-peers,203,1)\") Executing [203@all-peers:3] ExecIf(\"Local\/201@internal-orig-00000009;1\", \"1?Hangup()\")<\/code><\/pre>\n<p>\u0411\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#171;<strong>ChannelRedirect<\/strong>&#187; \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0430\u0434\u0440\u0435\u0441\u043e\u0432\u0430\u043d \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0430 Local \u043a\u0430\u043d\u0430\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u044b. <\/p>\n<pre><code>Executing [203@all-peers:1] ExecIf(\"PJSIP\/201-00000016\", \"0?NoCDR()\") Executing [203@all-peers:2] ExecIf(\"PJSIP\/201-00000016\", \"0?ChannelRedirect(,all-peers,203,1)\") Executing [203@all-peers:3] ExecIf(\"PJSIP\/201-00000016\", \"0?Hangup()\") Executing [203@all-peers:4] Dial(\"PJSIP\/201-00000016\", \"PJSIP\/203\/sip:203@172.16.156.1:59442;ob,30,Tt\")<\/code><\/pre>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 &#171;<strong>all-peers<\/strong>&#187; \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e sip \u043f\u0438\u0440\u0430, \u0442\u043e\u0433\u0434\u0430 \u0437\u0432\u043e\u043d\u043e\u043a \u0447\u0435\u0440\u0435\u0437 <strong>Originate<\/strong> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c\u0443 \u0437\u0432\u043e\u043d\u043a\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430. <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <strong>NoCDR<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c cdr \u0437\u0430\u043f\u0438\u0441\u0438 Local \u043a\u0430\u043d\u0430\u043b\u043e\u0432. <\/p>\n<h2>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/h2>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 AMI \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<pre><code>Action: Originate Channel: Local\/201@internal-orig Context: all-peers Exten: 203 Priority: 1 Callerid: 201 Variable: origCid=203<\/code><\/pre>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 dialplan, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432 \u043d\u0435\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u0432\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 <strong>NoCDR<\/strong>: <\/p>\n<pre><code>[internal-orig] exten =&gt; _X!,1,NoCDR() \tsame =&gt; n,Set(MASTER_CHANNEL(O_DST_CHAN)=${origCid}) \tsame =&gt; n,Set(CALLERID(num)=${origCid}) \tsame =&gt; n,Set(DST_CONTACT=${PJSIP_DIAL_CONTACTS(${EXTEN})}) \tsame =&gt; n,ExecIf($[\"${DST_CONTACT}x\" != \"x\"]?Dial(${DST_CONTACT},${ringlength},TtU(orig-answer-channel),s,1)))  [orig-answer-channel] exten =&gt; s,1,Set(MASTER_CHANNEL(O_SRC_CHAN)=${CHANNEL})   same =&gt; n,return  [all-peers] exten =&gt; _X!,1,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?NoCDR()) \tsame =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?ChannelRedirect(${O_SRC_CHAN},${CONTEXT},${O_DST_CHAN},1)) \tsame =&gt; n,ExecIf($[ \"${O_SRC_CHAN}x\" != \"x\" ]?Hangup()) \tsame =&gt; n,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})},30,Tt) \tsame =&gt; n,Hangup() \t<\/code><\/pre>\n<p>\u0412 CDR \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c<\/p>\n<pre><code>2021-05-17 17:29:07|2021-05-17 17:29:10|2021-05-17 17:29:14|201|PJSIP\/201-00000018|203|PJSIP\/203-00000019<\/code><\/pre>\n<p>\u0422\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e! \ud83d\ude42<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u042f \u043d\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e, \u0447\u0442\u043e \u043e\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c. <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0410\u0422\u0421 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c <a href=\"https:\/\/www.mikopbx.ru\" rel=\"noopener noreferrer nofollow\">MikoPBX<\/a>. <\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/265647\/\" rel=\"noopener noreferrer nofollow\">AMI. \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 Originate. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432 CTI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/wiki.asterisk.org\/wiki\/display\/AST\/ManagerAction_Originate\" rel=\"noopener noreferrer nofollow\">ManagerAction_Originate<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/wiki.asterisk.org\/wiki\/display\/AST\/Application_ChannelRedirect\" rel=\"noopener noreferrer nofollow\">Application_ChannelRedirect<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/mikopbx\/Core\" rel=\"noopener noreferrer nofollow\">MikoPBX<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/557850\/\"> https:\/\/habr.com\/ru\/post\/557850\/<\/a><br \/><\/br><\/br><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-323294","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323294"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/323294\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}