К провайдеру подключены по sip без нат-а (выделенный оптический канал).
Не получается настроить приём факсов. Проблема в том, что при входящем звонке провайдер шлёт BYE сразу после того как мы ответили OK на его INVITE:
провайдер->INVITE
наша атс->Tying
наша атс->OK
провайдер->ACK
провайдер->BYE
наша атс->OK
Так получается, если только во входящей маршрутизации стоит Fax Recipient для Set Destination.
Если принимать звонок на обычный экстеншн, то проблем нет.
И сам факс тоже работает, т.к. я могу принять звонок на обычный номер, затем перевести его на внутренний номер факса - при таком действии факс принимается.
Вот полный дебаг сессии(заменил внешний адрес провайдера на <ProviderIP>, входящий номер - <number1>, наш номер (на который звонят) - <number2>):
Код: Выделить всё
<--- SIP read from UDP:<ProviderIP>:5060 --->
INVITE sip:FIRMA_pilot@192.168.181.94:5060 SIP/2.0
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKt26frl103g21khgp0141.1
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202328 INVITE
Contact: <sip:<number1>@<ProviderIP>:5060;transport=udp>
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Accept: application/dtmf,application/dtmf-relay,application/media_control+xml,application/sdp,audio/telephone-event,multipart/mixed
Supported:
Max-Forwards: 9
Content-Type: application/sdp
Content-Length: 234
v=0
o=BroadWorks 1890590 1 IN IP4 <ProviderIP>
s=-
c=IN IP4 <ProviderIP>
t=0 0
m=audio 54054 RTP/AVP 8 0 18
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=silenceSupp:off - - - -
<------------->
--- (13 headers 11 lines) ---
Sending to <ProviderIP>:5060 (no NAT)
Using INVITE request as basis request - BW0827137101705121130407255@192.168.150.2
Found peer 'TLD' for '<number1>' from <ProviderIP>:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 18
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port <ProviderIP>:54054
Looking for FIRMA_pilot in from-pstn-toheader (domain 192.168.181.94)
list_route: hop: <sip:<number1>@<ProviderIP>:5060;transport=udp>
<--- Transmitting (no NAT) to <ProviderIP>:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKt26frl103g21khgp0141.1;received=<ProviderIP>
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202328 INVITE
Server: FPBX-2.9.0(1.8.12.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:FIRMA_pilot@192.168.181.94:5060>
Content-Length: 0
<------------>
-- Executing [FIRMA_pilot@from-pstn-toheader:1] Goto("SIP/TLD-0000029f", "from-pstn,<number2>,1") in new stack
-- Goto (from-pstn,<number2>,1)
-- Executing [<number2>@from-pstn:1] Set("SIP/TLD-0000029f", "__FROM_DID=<number2>") in new stack
-- Executing [<number2>@from-pstn:2] Gosub("SIP/TLD-0000029f", "app-blacklist-check,s,1") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/TLD-0000029f", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/TLD-0000029f", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/TLD-0000029f", "") in new stack
-- Executing [<number2>@from-pstn:3] Set("SIP/TLD-0000029f", "CHANNEL(language)=ru") in new stack
-- Executing [<number2>@from-pstn:4] ExecIf("SIP/TLD-0000029f", "0 ?Set(CALLERID(name)=<number1>)") in new stack
-- Executing [<number2>@from-pstn:5] Set("SIP/TLD-0000029f", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [<number2>@from-pstn:6] Set("SIP/TLD-0000029f", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [<number2>@from-pstn:7] Goto("SIP/TLD-0000029f", "ext-fax,514,1") in new stack
-- Goto (ext-fax,514,1)
-- Executing [514@ext-fax:1] NoOp("SIP/TLD-0000029f", "Receiving Fax for: FAX2 (514), From: "<number1>" <<number1>>") in new stack
-- Executing [514@ext-fax:2] Macro("SIP/TLD-0000029f", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/TLD-0000029f", "AMPUSER=<number1>") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/TLD-0000029f", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/TLD-0000029f", "1?Set(REALCALLERIDNUM=<number1>)") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/TLD-0000029f", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/TLD-0000029f", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/TLD-0000029f", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] GotoIf("SIP/TLD-0000029f", "0?continue") in new stack
-- Executing [s@macro-user-callerid:14] Set("SIP/TLD-0000029f", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:15] GotoIf("SIP/TLD-0000029f", "1?continue") in new stack
-- Goto (macro-user-callerid,s,26)
-- Executing [s@macro-user-callerid:26] Set("SIP/TLD-0000029f", "CALLERID(number)=<number1>") in new stack
-- Executing [s@macro-user-callerid:27] Set("SIP/TLD-0000029f", "CALLERID(name)=<number1>") in new stack
-- Executing [s@macro-user-callerid:28] Set("SIP/TLD-0000029f", "CHANNEL(language)=ru") in new stack
-- Executing [514@ext-fax:3] Set("SIP/TLD-0000029f", "FAX_RX_EMAIL=boao@firma.ru") in new stack
-- Executing [514@ext-fax:4] Goto("SIP/TLD-0000029f", "s,receivefax") in new stack
-- Goto (ext-fax,s,3)
-- Executing [s@ext-fax:3] StopPlayTones("SIP/TLD-0000029f", "") in new stack
-- Executing [s@ext-fax:4] ReceiveFAX("SIP/TLD-0000029f", "/var/spool/asterisk/fax/1337207129.675.tif,f") in new stack
-- Channel 'SIP/TLD-0000029f' receiving FAX '/var/spool/asterisk/fax/1337207129.675.tif'
Audio is at 11868
Adding codec 0x8 (alaw) to SDP
Adding codec 0x4 (ulaw) to SDP
<--- Reliably Transmitting (no NAT) to <ProviderIP>:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKt26frl103g21khgp0141.1;received=<ProviderIP>
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>;tag=as54455031
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202328 INVITE
Server: FPBX-2.9.0(1.8.12.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:FIRMA_pilot@192.168.181.94:5060>
Content-Type: application/sdp
Content-Length: 209
v=0
o=root 1428992834 1428992834 IN IP4 192.168.181.94
s=Asterisk PBX 1.8.12.0
c=IN IP4 192.168.181.94
t=0 0
m=audio 11868 RTP/AVP 8 0
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=ptime:20
a=sendrecv
<------------>
<--- SIP read from UDP:<ProviderIP>:5060 --->
ACK sip:FIRMA_pilot@192.168.181.94:5060 SIP/2.0
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKuicgtu104g4gvjcmc6b0.1
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>;tag=as54455031
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202328 ACK
Contact: <sip:<number1>@<ProviderIP>:5060;transport=udp>
Max-Forwards: 9
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
<--- SIP read from UDP:<ProviderIP>:5060 --->
BYE sip:FIRMA_pilot@192.168.181.94:5060 SIP/2.0
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKu2jjv72050dggjcmq6r0.1
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>;tag=as54455031
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202329 BYE
Max-Forwards: 9
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
Sending to <ProviderIP>:5060 (no NAT)
Scheduling destruction of SIP dialog 'BW0827137101705121130407255@192.168.150.2' in 6400 ms (Method: BYE)
<--- Transmitting (no NAT) to <ProviderIP>:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP <ProviderIP>:5060;branch=z9hG4bKu2jjv72050dggjcmq6r0.1;received=<ProviderIP>
From: "<number1>"<sip:<number1>@provider.ru;user=phone>;tag=1705673596-1337207233710-
To: "firma_6 firma_6"<sip:<number2>@provider.ru;endpoint=192.168.181.94:5060;firewall=192.168.181.94:5060>;tag=as54455031
Call-ID: BW0827137101705121130407255@192.168.150.2
CSeq: 736202329 BYE
Server: FPBX-2.9.0(1.8.12.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
<------------>
[May 17 08:25:29] ERROR[18360]: res_fax.c:1438 receivefax_t38_init: error reading frame while generating CED tone on SIP/TLD-0000029f
[May 17 08:25:29] ERROR[18360]: res_fax.c:1754 receivefax_exec: error initializing channel 'SIP/TLD-0000029f' in T.38 mode
== Spawn extension (ext-fax, s, 4) exited non-zero on 'SIP/TLD-0000029f'
-- Executing [h@ext-fax:1] GotoIf("SIP/TLD-0000029f", "1?failed") in new stack
-- Goto (ext-fax,h,103)
-- Executing [h@ext-fax:103] NoOp("SIP/TLD-0000029f", "FAX FAILED for: boao@firma.ru , From: "<number1>" <<number1>>") in new stack
-- Executing [h@ext-fax:104] Macro("SIP/TLD-0000029f", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/TLD-0000029f", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] Hangup("SIP/TLD-0000029f", "") in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'SIP/TLD-0000029f' in macro 'hangupcall'
== Spawn extension (ext-fax, h, 104) exited non-zero on 'SIP/TLD-0000029f'