вот что выводит debug при звонке с 101 на городской номер, когда разговор по одной линии (исходящий) уже идет
[Kasterisk*CLI>
[0K -- Executing [280223@from-internal:1] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35muser-callerid,SKIPTTL,[0m") in new stack
-- Executing [s@macro-user-callerid:1] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mAMPUSER=101[0m") in new stack
-- Executing [s@macro-user-callerid:2] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?report[0m") in new stack
-- Executing [s@macro-user-callerid:3] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?Set(REALCALLERIDNUM=101)[0m") in new stack
-- Executing [s@macro-user-callerid:4] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mAMPUSER=101[0m") in new stack
-- Executing [s@macro-user-callerid:5] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mAMPUSERCIDNAME=Zonov Andrey[0m") in new stack
-- Executing [s@macro-user-callerid:6] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?report[0m") in new stack
-- Executing [s@macro-user-callerid:7] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mAMPUSERCID=101[0m") in new stack
-- Executing [s@macro-user-callerid:8] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mCALLERID(all)="Zonov Andrey" <101>[0m") in new stack
-- Executing [s@macro-user-callerid:9] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(CHANNEL(language)=)[0m") in new stack
-- Executing [s@macro-user-callerid:10] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?continue[0m") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mCALLERID(number)=101[0m") in new stack
-- Executing [s@macro-user-callerid:20] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mCALLERID(name)=Zonov Andrey[0m") in new stack
-- Executing [s@macro-user-callerid:21] [1;36mNoOp[0m("[1;35mSIP/101-00001279[0m", "[1;35mUsing CallerID "Zonov Andrey" <101>[0m") in new stack
-- Executing [280223@from-internal:2] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35m_NODEST=[0m") in new stack
-- Executing [280223@from-internal:3] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mrecord-enable,101,OUT,[0m") in new stack
-- Executing [s@macro-record-enable:1] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?check[0m") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?MacroExit()[0m") in new stack
-- Executing [s@macro-record-enable:5] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Group:OUT[0m") in new stack
-- Goto (macro-record-enable,s,15)
-- Executing [s@macro-record-enable:15] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?IN[0m") in new stack
-- Executing [s@macro-record-enable:16] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?MacroExit()[0m") in new stack
-- Executing [280223@from-internal:4] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mdialout-trunk,1,280223,,[0m") in new stack
-- Executing [s@macro-dialout-trunk:1] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_TRUNK=1[0m") in new stack
-- Executing [s@macro-dialout-trunk:2] [1;36mGosubIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?sub-pincheck,s,1[0m") in new stack
-- Executing [s@macro-dialout-trunk:3] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?disabletrunk,1[0m") in new stack
-- Executing [s@macro-dialout-trunk:4] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_NUMBER=280223[0m") in new stack
-- Executing [s@macro-dialout-trunk:5] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_TRUNK_OPTIONS=tr[0m") in new stack
-- Executing [s@macro-dialout-trunk:6] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mOUTBOUND_GROUP=OUT_1[0m") in new stack
-- Executing [s@macro-dialout-trunk:7] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?nomax[0m") in new stack
-- Executing [s@macro-dialout-trunk:8] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?chanfull[0m") in new stack
-- Goto (macro-dialout-trunk,s,30)
-- Executing [s@macro-dialout-trunk:30] [1;36mNoOp[0m("[1;35mSIP/101-00001279[0m", "[1;35mmax channels used up[0m") in new stack
-- Executing [280223@from-internal:5] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mdialout-trunk,2,280223,,[0m") in new stack
-- Executing [s@macro-dialout-trunk:1] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_TRUNK=2[0m") in new stack
-- Executing [s@macro-dialout-trunk:2] [1;36mGosubIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?sub-pincheck,s,1[0m") in new stack
-- Executing [s@macro-dialout-trunk:3] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?disabletrunk,1[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:4] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_NUMBER=280223[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:5] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_TRUNK_OPTIONS=tr[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:6] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mOUTBOUND_GROUP=OUT_2[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:7] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?nomax[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:8] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?chanfull[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:9] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?skipoutcid[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:10] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mDIAL_TRUNK_OPTIONS=[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-dialout-trunk:11] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35moutbound-callerid,2[0m") in new stack
-- Executing [s@macro-outbound-callerid:1] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(CALLERPRES()=)[0m") in new stack
-- Executing [s@macro-outbound-callerid:2] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(REALCALLERIDNUM=101)[0m") in new stack
-- Executing [s@macro-outbound-callerid:3] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?normcid[0m") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mUSEROUTCID=[0m") in new stack
-- Executing [s@macro-outbound-callerid:7] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mEMERGENCYCID=[0m") in new stack
-- Executing [s@macro-outbound-callerid:8] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mTRUNKOUTCID=421962[0m") in new stack
[Kasterisk*CLI>
[0K -- Executing [s@macro-outbound-callerid:9] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?trunkcid[0m") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?Set(CALLERID(all)=421962)[0m") in new stack
-- Executing [s@macro-outbound-callerid:13] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(CALLERID(all)=)[0m") in new stack
-- Executing [s@macro-outbound-callerid:14] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(CALLERID(all)=)[0m") in new stack
-- Executing [s@macro-outbound-callerid:15] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(CALLERPRES()=prohib_passed_screen)[0m") in new stack
-- Executing [s@macro-dialout-trunk:12] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?AGI(fixlocalprefix)[0m") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
[Kasterisk*CLI>
[0K -- <SIP/101-00001279>AGI Script fixlocalprefix completed, returning 0
-- Executing [s@macro-dialout-trunk:13] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mOUTNUM=280223[0m") in new stack
-- Executing [s@macro-dialout-trunk:14] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mcustom=SIP/gorod421962[0m") in new stack
-- Executing [s@macro-dialout-trunk:15] [1;36mExecIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^))[0m") in new stack
-- Executing [s@macro-dialout-trunk:16] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mdialout-trunk-predial-hook,[0m") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] [1;36mMacroExit[0m("[1;35mSIP/101-00001279[0m", "[1;35m[0m") in new stack
-- Executing [s@macro-dialout-trunk:17] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?bypass,1[0m") in new stack
-- Executing [s@macro-dialout-trunk:18] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m0?customtrunk[0m") in new stack
-- Executing [s@macro-dialout-trunk:19] [1;36mDial[0m("[1;35mSIP/101-00001279[0m", "[1;35mSIP/gorod421962/280223,300,[0m") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called gorod421962/280223
-- SIP/gorod421962-0000127a is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
-- Executing [s@macro-dialout-trunk:20] [1;36mNoOp[0m("[1;35mSIP/101-00001279[0m", "[1;35mDial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 1[0m") in new stack
-- Executing [s@macro-dialout-trunk:21] [1;36mGoto[0m("[1;35mSIP/101-00001279[0m", "[1;35ms-CONGESTION,1[0m") in new stack
-- Goto (macro-dialout-trunk,s-CONGESTION,1)
-- Executing [s-CONGESTION@macro-dialout-trunk:1] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mRC=1[0m") in new stack
-- Executing [s-CONGESTION@macro-dialout-trunk:2] [1;36mGoto[0m("[1;35mSIP/101-00001279[0m", "[1;35m1,1[0m") in new stack
-- Goto (macro-dialout-trunk,1,1)
-- Executing [1@macro-dialout-trunk:1] [1;36mGoto[0m("[1;35mSIP/101-00001279[0m", "[1;35mcontinue,1[0m") in new stack
-- Goto (macro-dialout-trunk,continue,1)
-- Executing [continue@macro-dialout-trunk:1] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?noreport[0m") in new stack
-- Goto (macro-dialout-trunk,continue,3)
-- Executing [continue@macro-dialout-trunk:3] [1;36mNoOp[0m("[1;35mSIP/101-00001279[0m", "[1;35mTRUNK Dial failed due to CONGESTION HANGUPCAUSE: 1 - failing through to other trunks[0m") in new stack
-- Executing [continue@macro-dialout-trunk:4] [1;36mSet[0m("[1;35mSIP/101-00001279[0m", "[1;35mCALLERID(number)=101[0m") in new stack
-- Executing [280223@from-internal:6] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35moutisbusy,[0m") in new stack
-- Executing [s@macro-outisbusy:1] [1;36mProgress[0m("[1;35mSIP/101-00001279[0m", "[1;35m[0m") in new stack
-- Executing [s@macro-outisbusy:2] [1;36mPlayback[0m("[1;35mSIP/101-00001279[0m", "[1;35mall-circuits-busy-now,noanswer[0m") in new stack
-- <SIP/101-00001279> Playing 'all-circuits-busy-now.gsm' (language 'ru')
-- Executing [s@macro-outisbusy:3] [1;36mPlayback[0m("[1;35mSIP/106-00001277[0m", "[1;35mpls-try-call-later,noanswer[0m") in new stack
-- <SIP/106-00001277> Playing 'pls-try-call-later.gsm' (language 'ru')
-- Executing [s@macro-outisbusy:3] [1;36mPlayback[0m("[1;35mSIP/101-00001279[0m", "[1;35mpls-try-call-later,noanswer[0m") in new stack
-- <SIP/101-00001279> Playing 'pls-try-call-later.gsm' (language 'ru')
== Spawn extension (macro-outisbusy, s, 3) exited non-zero on 'SIP/106-00001277' in macro 'outisbusy'
== Spawn extension (from-internal, 429974, 6) exited non-zero on 'SIP/106-00001277'
-- Executing [h@from-internal:1] [1;36mMacro[0m("[1;35mSIP/106-00001277[0m", "[1;35mhangupcall[0m") in new stack
-- Executing [s@macro-hangupcall:1] [1;36mGotoIf[0m("[1;35mSIP/106-00001277[0m", "[1;35m1?skiprg[0m") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] [1;36mGotoIf[0m("[1;35mSIP/106-00001277[0m", "[1;35m1?skipblkvm[0m") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] [1;36mGotoIf[0m("[1;35mSIP/106-00001277[0m", "[1;35m1?theend[0m") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] [1;36mHangup[0m("[1;35mSIP/106-00001277[0m", "[1;35m[0m") in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/106-00001277' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/106-00001277'
-- Executing [s@macro-outisbusy:4] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mhangupcall[0m") in new stack
-- Executing [s@macro-hangupcall:1] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?skiprg[0m") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?skipblkvm[0m") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?theend[0m") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] [1;36mHangup[0m("[1;35mSIP/101-00001279[0m", "[1;35m[0m") in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/101-00001279' in macro 'hangupcall'
== Spawn extension (macro-outisbusy, s, 4) exited non-zero on 'SIP/101-00001279' in macro 'outisbusy'
== Spawn extension (from-internal, 280223, 6) exited non-zero on 'SIP/101-00001279'
-- Executing [h@from-internal:1] [1;36mMacro[0m("[1;35mSIP/101-00001279[0m", "[1;35mhangupcall[0m") in new stack
-- Executing [s@macro-hangupcall:1] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?skiprg[0m") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?skipblkvm[0m") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] [1;36mGotoIf[0m("[1;35mSIP/101-00001279[0m", "[1;35m1?theend[0m") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] [1;36mHangup[0m("[1;35mSIP/101-00001279[0m", "[1;35m[0m") in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/101-00001279' in macro 'hangupcall'
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/101-00001279'