Страница 1 из 1

Как добавить в заголовок "To" номер вызываемого абонента?

Добавлено: 18 июл 2023, 21:40
sevnet@mail.ru
Версия Asterisk 13.20.0-2.0
На АТС FreeBPX требуется в заголовок "To:" вставить по аналогии с заголовком "From:" набираемый номер, чтобы получилось:

Код: Выделить всё

To: "111" <sip:111@ip.***>,
а сейчас так:

Код: Выделить всё

INVITE sip:111@ip.*** SIP/2.0
Via: SIP/2.0/UDP 192.168.88.181:5060;branch=z9hG4bK7fb515e9;rport
Max-Forwards: 70
From: "219" <sip:sip2@ip.***>;tag=as2e53678f
To: <sip:111@ip.***>
Contact: <sip:sip2@192.168.88.181:5060>
Call-ID: 2393cc69787215ae4d047f2d0c562c39@ip.***
CSeq: 102 INVITE
User-Agent: FPBX-13.0.197.31(13.20.0)
Date: Tue, 18 Jul 2023 16:49:11 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 284
Пробовал добавить в экстеншене исходящего маршрута

Код: Выделить всё

exten => _1XX,n,Set(SIP_HEADER(To)="111")
Ничего не меняется(((
П.с.: диал план перезагружал (deailplan reload)

Весь исходящий маршрут выглядит так:

Код: Выделить всё

[outrt-1] ; voximplant
include => outrt-1-custom
exten => _1XX,1,Macro(user-callerid,LIMIT,EXTERNAL,)
exten => _1XX,n,Gosub(sub-record-check,s,1(out,${EXTEN},yes))
exten => _1XX,n,Set(_ROUTEID=1)
exten => _1XX,n,Set(_ROUTENAME=voximplant)
exten => _1XX,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _1XX,n,Set(_CALLERIDNAMEINTERNAL=${CALLERID(name)})
exten => _1XX,n,Set(_CALLERIDNUMINTERNAL=${CALLERID(num)})
exten => _1XX,n,Set(_EMAILNOTIFICATION=FALSE)
exten => _1XX,n,Set(_NODEST=)
exten => _1XX,n,Set(SIP_HEADER(To)="111")
exten => _1XX,n,Macro(dialout-trunk,2,${EXTEN},,off)
exten => _1XX,n,Macro(outisbusy,)
Лог звонка:

Код: Выделить всё

- Executing [111@from-internal:1] Macro("SIP/219-00000014", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/219-00000014", "TOUCH_MONITOR=1689705404.20") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/219-00000014", "AMPUSER=219") in new stack
    -- Executing [s@macro-user-callerid:3] Set("SIP/219-00000014", "HOTDESCKCHAN=219-00000014") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/219-00000014", "HOTDESKEXTEN=219") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/219-00000014", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:6] ExecIf("SIP/219-00000014", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:7] ExecIf("SIP/219-00000014", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/219-00000014", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] ExecIf("SIP/219-00000014", "1?Set(REALCALLERIDNUM=219)") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/219-00000014", "AMPUSER=219") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/219-00000014", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:12] Set("SIP/219-00000014", "AMPUSERCIDNAME=Anton Alttechno") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("SIP/219-00000014", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("SIP/219-00000014", "0?report") in new stack
    -- Executing [s@macro-user-callerid:15] Set("SIP/219-00000014", "AMPUSERCID=219") in new stack
    -- Executing [s@macro-user-callerid:16] Set("SIP/219-00000014", "__DIAL_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-user-callerid:17] Set("SIP/219-00000014", "CALLERID(all)="Anton Alttechno" <219>") in new stack
    -- Executing [s@macro-user-callerid:18] GotoIf("SIP/219-00000014", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:19] ExecIf("SIP/219-00000014", "1?Set(GROUP(concurrency_limit)=219)") in new stack
    -- Executing [s@macro-user-callerid:20] ExecIf("SIP/219-00000014", "1?Set(CHANNEL(language)=ru)") in new stack
    -- Executing [s@macro-user-callerid:21] NoOp("SIP/219-00000014", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:22] GotoIf("SIP/219-00000014", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,23)
    -- Executing [s@macro-user-callerid:23] GotoIf("SIP/219-00000014", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,41)
    -- Executing [s@macro-user-callerid:41] Set("SIP/219-00000014", "CALLERID(number)=219") in new stack
    -- Executing [s@macro-user-callerid:42] Set("SIP/219-00000014", "CALLERID(name)=Anton Alttechno") in new stack
    -- Executing [s@macro-user-callerid:43] GotoIf("SIP/219-00000014", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:44] Set("SIP/219-00000014", "CDR(cnam)=Anton Alttechno") in new stack
    -- Executing [s@macro-user-callerid:45] Set("SIP/219-00000014", "CDR(cnum)=219") in new stack
    -- Executing [s@macro-user-callerid:46] Set("SIP/219-00000014", "CHANNEL(language)=ru") in new stack
    -- Executing [111@from-internal:2] Gosub("SIP/219-00000014", "sub-record-check,s,1(out,111,yes)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/219-00000014", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/219-00000014", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/219-00000014", "NOW=1689705404") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/219-00000014", "__DAY=18") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/219-00000014", "__MONTH=07") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/219-00000014", "__YEAR=2023") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/219-00000014", "__TIMESTR=20230718-213644") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/219-00000014", "__FROMEXTEN=219") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/219-00000014", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/219-00000014", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/219-00000014", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/219-00000014", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/219-00000014", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/219-00000014", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/219-00000014", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("SIP/219-00000014", "Outbound Recording Check from 219 to 111") in new stack
    -- Executing [out@sub-record-check:2] Set("SIP/219-00000014", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("SIP/219-00000014", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("SIP/219-00000014", "recordcheck,1(yes,out,111)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/219-00000014", "Starting recording check against yes") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/219-00000014", "yes") in new stack
    -- Goto (sub-record-check,recordcheck,9)
    -- Executing [recordcheck@sub-record-check:9] ExecIf("SIP/219-00000014", "0?Return()") in new stack
    -- Executing [recordcheck@sub-record-check:10] Set("SIP/219-00000014", "__REC_POLICY_MODE=YES") in new stack
    -- Executing [recordcheck@sub-record-check:11] Goto("SIP/219-00000014", "startrec") in new stack
    -- Goto (sub-record-check,recordcheck,16)
    -- Executing [recordcheck@sub-record-check:16] NoOp("SIP/219-00000014", "Starting recording: out, 111") in new stack
    -- Executing [recordcheck@sub-record-check:17] Set("SIP/219-00000014", "__CALLFILENAME=out-111-219-20230718-213644-1689705404.20") in new stack
    -- Executing [recordcheck@sub-record-check:18] MixMonitor("SIP/219-00000014", "2023/07/18/out-111-219-20230718-213644-1689705404.20.wav,abi(LOCAL_MIXMON_ID),") in new stack
    -- Executing [recordcheck@sub-record-check:19] Set("SIP/219-00000014", "__MIXMON_ID=0x7fb364027c00") in new stack
  == Begin MixMonitor Recording SIP/219-00000014
    -- Executing [recordcheck@sub-record-check:20] Set("SIP/219-00000014", "__RECORD_ID=SIP/219-00000014") in new stack
    -- Executing [recordcheck@sub-record-check:21] Set("SIP/219-00000014", "__REC_STATUS=RECORDING") in new stack
    -- Executing [recordcheck@sub-record-check:22] Set("SIP/219-00000014", "CDR(recordingfile)=out-111-219-20230718-213644-1689705404.20.wav") in new stack
    -- Executing [recordcheck@sub-record-check:23] Return("SIP/219-00000014", "") in new stack
    -- Executing [out@sub-record-check:8] Return("SIP/219-00000014", "") in new stack
    -- Executing [111@from-internal:3] Set("SIP/219-00000014", "_ROUTEID=1") in new stack
    -- Executing [111@from-internal:4] Set("SIP/219-00000014", "_ROUTENAME=voximplant") in new stack
    -- Executing [111@from-internal:5] Set("SIP/219-00000014", "MOHCLASS=default") in new stack
    -- Executing [111@from-internal:6] Set("SIP/219-00000014", "_CALLERIDNAMEINTERNAL=Anton Alttechno") in new stack
    -- Executing [111@from-internal:7] Set("SIP/219-00000014", "_CALLERIDNUMINTERNAL=219") in new stack
    -- Executing [111@from-internal:8] Set("SIP/219-00000014", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [111@from-internal:9] Set("SIP/219-00000014", "_NODEST=") in new stack
    -- Executing [111@from-internal:10] Macro("SIP/219-00000014", "dialout-trunk,2,111,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/219-00000014", "DIAL_TRUNK=2") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("SIP/219-00000014", "0?Set(DIAL_OPTIONS=tr)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("SIP/219-00000014", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] GotoIf("SIP/219-00000014", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/219-00000014", "DIAL_NUMBER=111") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/219-00000014", "DIAL_TRUNK_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("SIP/219-00000014", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("SIP/219-00000014", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/219-00000014", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,11)
    -- Executing [s@macro-dialout-trunk:11] GotoIf("SIP/219-00000014", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:12] Macro("SIP/219-00000014", "outbound-callerid,2") in new stack
    -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/219-00000014", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/219-00000014", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:3] Set("SIP/219-00000014", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("SIP/219-00000014", "0?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("SIP/219-00000014", "0?Hangup()") in new stack
    -- Executing [s@macro-outbound-callerid:6] ExecIf("SIP/219-00000014", "0?Set(REALCALLERIDNUM=219)") in new stack
    -- Executing [s@macro-outbound-callerid:7] ExecIf("SIP/219-00000014", "0?Set(AMPUSER=219)") in new stack
    -- Executing [s@macro-outbound-callerid:8] GotoIf("SIP/219-00000014", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [s@macro-outbound-callerid:12] Set("SIP/219-00000014", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:13] Set("SIP/219-00000014", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/219-00000014", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:15] Set("SIP/219-00000014", "TRUNKOUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:16] GotoIf("SIP/219-00000014", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,22)
    -- Executing [s@macro-outbound-callerid:22] ExecIf("SIP/219-00000014", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:23] ExecIf("SIP/219-00000014", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:24] ExecIf("SIP/219-00000014", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:25] ExecIf("SIP/219-00000014", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:26] ExecIf("SIP/219-00000014", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:27] Set("SIP/219-00000014", "CDR(outbound_cnum)=219") in new stack
    -- Executing [s@macro-outbound-callerid:28] Set("SIP/219-00000014", "CDR(outbound_cnam)=Anton Alttechno") in new stack
    -- Executing [s@macro-dialout-trunk:13] GosubIf("SIP/219-00000014", "0?sub-flp-2,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/219-00000014", "OUTNUM=111") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("SIP/219-00000014", "custom=SIP/voximplant") in new stack
    -- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/219-00000014", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("SIP/219-00000014", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:18] Macro("SIP/219-00000014", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/219-00000014", "") in new stack
    -- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/219-00000014", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:20] ExecIf("SIP/219-00000014", "1?Set(CONNECTEDLINE(num,i)=111)") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("SIP/219-00000014", "1?Set(CONNECTEDLINE(name,i)=CID:219)") in new stack
    -- Executing [s@macro-dialout-trunk:22] ExecIf("SIP/219-00000014", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)219)") in new stack
    -- Executing [s@macro-dialout-trunk:23] GotoIf("SIP/219-00000014", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:24] ExecIf("SIP/219-00000014", "0?Set(DIAL_TRUNK_OPTIONS=)") in new stack
    -- Executing [s@macro-dialout-trunk:25] Set("SIP/219-00000014", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack
    -- Executing [s@macro-dialout-trunk:26] Dial("SIP/219-00000014", "SIP/voximplant/111,300,Tb(func-apply-sipheaders^s^1,(2))U(sub-send-obroute-email^111^111^2^1689705404^Anton Alttechno^219)") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- SIP/voximplant-00000015 Internal Gosub(func-apply-sipheaders,s,1(2)) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("SIP/voximplant-00000015", "Applying SIP Headers to channel SIP/voximplant-00000015") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("SIP/voximplant-00000015", "TECH=SIP") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("SIP/voximplant-00000015", "SIPHEADERKEYS=Alert-Info") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("SIP/voximplant-00000015", "1") in new stack
    -- Executing [s@func-apply-sipheaders:5] Set("SIP/voximplant-00000015", "sipheader=unset") in new stack
    -- Executing [s@func-apply-sipheaders:6] ExecIf("SIP/voximplant-00000015", "1?SIPRemoveHeader(Alert-Info:)") in new stack
    -- Executing [s@func-apply-sipheaders:7] ExecIf("SIP/voximplant-00000015", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:8] ExecIf("SIP/voximplant-00000015", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack
    -- Executing [s@func-apply-sipheaders:9] ExecIf("SIP/voximplant-00000015", "0?SIPAddHeader(Alert-Info:unset)") in new stack
    -- Executing [s@func-apply-sipheaders:10] EndWhile("SIP/voximplant-00000015", "") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("SIP/voximplant-00000015", "0") in new stack
    -- Executing [s@func-apply-sipheaders:11] Return("SIP/voximplant-00000015", "") in new stack
  == Spawn extension (from-trunk-sip-voximplant, 111, 1) exited non-zero on 'SIP/voximplant-00000015'
    -- SIP/voximplant-00000015 Internal Gosub(func-apply-sipheaders,s,1(2)) complete GOSUB_RETVAL=
    -- Called SIP/voximplant/111
    -- SIP/voximplant-00000015 is making progress passing it to SIP/219-00000014
    -- SIP/voximplant-00000015 answered SIP/219-00000014
    -- SIP/voximplant-00000015 Internal Gosub(sub-send-obroute-email,s,1(111,111,2,1689705404,Anton Alttechno,219)) start
    -- Executing [s@sub-send-obroute-email:1] GotoIf("SIP/voximplant-00000015", "0?sendEmail") in new stack
    -- Executing [s@sub-send-obroute-email:2] NoOp("SIP/voximplant-00000015", "email notifications disabled..exiting.") in new stack
    -- Executing [s@sub-send-obroute-email:3] Return("SIP/voximplant-00000015", "") in new stack
  == Spawn extension (from-trunk-sip-voximplant, , 1) exited non-zero on 'SIP/voximplant-00000015'
    -- SIP/voximplant-00000015 Internal Gosub(sub-send-obroute-email,s,1(111,111,2,1689705404,Anton Alttechno,219)) complete GOSUB_RETVAL=
    -- Channel SIP/voximplant-00000015 joined 'simple_bridge' basic-bridge <12f4d824-6e37-4f96-9583-404a5d11c045>
    -- Channel SIP/219-00000014 joined 'simple_bridge' basic-bridge <12f4d824-6e37-4f96-9583-404a5d11c045>
    -- Channel SIP/219-00000014 left 'simple_bridge' basic-bridge <12f4d824-6e37-4f96-9583-404a5d11c045>
    -- Channel SIP/voximplant-00000015 left 'simple_bridge' basic-bridge <12f4d824-6e37-4f96-9583-404a5d11c045>
  == Spawn extension (macro-dialout-trunk, s, 26) exited non-zero on 'SIP/219-00000014' in macro 'dialout-trunk'
  == Spawn extension (from-internal, 111, 10) exited non-zero on 'SIP/219-00000014'
    -- Executing [h@from-internal:1] Macro("SIP/219-00000014", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/219-00000014", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("SIP/219-00000014", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("SIP/219-00000014", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/219-00000014' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/219-00000014'

Re: Как добавить в заголовок "To" номер вызываемого абонента

Добавлено: 19 июл 2023, 10:14
ded

Re: Как добавить в заголовок "To" номер вызываемого абонента

Добавлено: 19 июл 2023, 12:50
Zavr2008
; voximplant
Зло.
Юзайте лучше коннектор какой типа itegrix к B24 вместо этого барахла, поскольку делаете петлю лишнюю звука на их сервера.

А так, есть книга Будущее Телефонии, есть и на русском и еще в инете много описано по авторизации про отличие type=peer от type=friend. Также и про insecure=port,invite.
Хоть адреса и замалеваны, надеюсь NAT и localnet настроены и SIP ALG отключен..