T.38 gateway problem

Hi,

I’m trying to run T.38 gateway with asterisk 11.4.0. I have compiled from source spandsp (0.0.6pre21) and “fax show capabilities” shows that everything is ok:

Registered FAX Technology Modules:

Type : Spandsp
Description : Spandsp FAX Driver
Capabilities : SEND RECEIVE T.38 G.711 GATEWAY

1 registered modules

next I add to user in sip.conf t38pt_udptl=yes,redundancy,maxdatagram=400 and in extensions.conf Set(FAXOPT(gateway)=yes) before Dial. Also I have setup udptl.conf ports 4000-4999 (accepted by firewall).

I’m trying to make calls in this scenarios:

  • Zoiper -> asterisk / dahdi (libss7) -> ss7 operator,
  • Zoiper -> asterisk /dahdi (libpri) -> dss1 operator,
  • Zoiper -> asterisk -> ReceiveFax,
  • HT503 -> asterisk / dahdi (libss7) -> ss7 operator,
  • HT503 -> asterisk / dahdi (libpri) -> dss1 operator,
  • HT503 - > asterisk -> ReceiveFAX
    and none of those works.

Udptl debug shows only “Using UDPTL CoS mark 5” and many of lines like this:
UDPTL (SIP/michal-00000003): packet to 132.82.0.0:5004 (seq 0, len 6)
(I don’t know what is IP 132.82.0.0 - I haven’t set it anywhere).

Fax debug show nothing. In “fax show stats” after call there is information about t.38 call with status “Retries Exceeded”.

Sip debug is here:

<--- SIP read from UDP:81.219.46.10:33874 --->
INVITE sip:999@178.216.200.80 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK211235900;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 20 INVITE
Contact: "jacek" <sip:jacek@10.0.0.97:5060>
Max-Forwards: 70
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Privacy: none
P-Preferred-Identity: "jacek" <sip:jacek@178.216.200.80>
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 448

v=0
o=jacek 8000 8000 IN IP4 10.0.0.97
s=SIP Call
c=IN IP4 10.0.0.97
t=0 0
m=audio 5004 RTP/AVP 0 8 4 18 2 97 102 100 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:102 G729E/8000
a=rtpmap:100 AAL2-G726-16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54
<------------->
--- (16 headers 20 lines) ---
Sending to 81.219.46.10:33874 (NAT)
Sending to 81.219.46.10:33874 (NAT)
Using INVITE request as basis request - 1959374224-5060-3@BA.A.A.JH
Found peer 'jacek' for 'jacek' from 81.219.46.10:33874

<--- Reliably Transmitting (NAT) to 81.219.46.10:33874 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK211235900;received=81.219.46.10;rport=33874
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>;tag=as0c1c5afa
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 20 INVITE
Server: Asterisk T.38 test
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="65ce1fb5"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '1959374224-5060-3@BA.A.A.JH' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:81.219.46.10:33874 --->
ACK sip:999@178.216.200.80 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK211235900;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>;tag=as0c1c5afa
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 20 ACK
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---

<--- SIP read from UDP:81.219.46.10:33874 --->
INVITE sip:999@178.216.200.80 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK902706691;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 21 INVITE
Contact: "jacek" <sip:jacek@10.0.0.97:5060>
Authorization: Digest username="jacek", realm="asterisk", nonce="65ce1fb5", uri="sip:999@178.216.200.80", response="6c7216e8a09be188a157ae093b98acb9", algorithm=MD5
Max-Forwards: 70
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Privacy: none
P-Preferred-Identity: "jacek" <sip:jacek@178.216.200.80>
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length: 448

v=0
o=jacek 8000 8000 IN IP4 10.0.0.97
s=SIP Call
c=IN IP4 10.0.0.97
t=0 0
m=audio 5004 RTP/AVP 0 8 4 18 2 97 102 100 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:102 G729E/8000
a=rtpmap:100 AAL2-G726-16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54
<------------->
--- (17 headers 20 lines) ---
Sending to 81.219.46.10:33874 (NAT)
Using INVITE request as basis request - 1959374224-5060-3@BA.A.A.JH
Found peer 'jacek' for 'jacek' from 81.219.46.10:33874
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 4
Found RTP audio format 18
Found RTP audio format 2
Found RTP audio format 97
Found RTP audio format 102
Found RTP audio format 100
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G723 for ID 4
Found audio description format G729 for ID 18
Found audio description format G726-32 for ID 2
Found audio description format iLBC for ID 97
Found unknown media description format G729E for ID 102
Found unknown media description format AAL2-G726-16 for ID 100
Found audio description format telephone-event for ID 101
Capabilities: us - (alaw), peer - audio=(g723|ulaw|alaw|g726|g729|ilbc)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.0.0.97:5004
Looking for 999 in jacek (domain 178.216.200.80)
list_route: hop: <sip:jacek@10.0.0.97:5060>

<--- Transmitting (NAT) to 81.219.46.10:33874 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK902706691;received=81.219.46.10;rport=33874
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 21 INVITE
Server: Asterisk T.38 test
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:999@178.216.200.80:5060>
Content-Length: 0


<------------>
Audio is at 13094
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 81.219.46.10:33874 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK902706691;received=81.219.46.10;rport=33874
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>;tag=as3dcba4d1
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 21 INVITE
Server: Asterisk T.38 test
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:999@178.216.200.80:5060>
Content-Type: application/sdp
Require: timer
Content-Length: 266

v=0
o=root 1987209555 1987209555 IN IP4 178.216.200.80
s=Asterisk PBX 11.5.0
c=IN IP4 178.216.200.80
t=0 0
m=audio 13094 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>

<--- SIP read from UDP:81.219.46.10:33874 --->
ACK sip:999@178.216.200.80:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK2120319243;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
To: <sip:999@178.216.200.80>;tag=as3dcba4d1
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 21 ACK
Contact: <sip:jacek@10.0.0.97:5060>
Max-Forwards: 70
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
set_destination: Parsing <sip:jacek@10.0.0.97:5060> for address/port to send to
set_destination: set destination to 10.0.0.97:5060
Reliably Transmitting (NAT) to 81.219.46.10:33874:
INVITE sip:jacek@10.0.0.97:5060 SIP/2.0
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK3864f547;rport
Max-Forwards: 70
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Contact: <sip:999@178.216.200.80:5060>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 102 INVITE
User-Agent: Asterisk T.38 test
Session-Expires: 1800;refresher=uac
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 275

v=0
o=root 1987209555 1987209556 IN IP4 178.216.200.80
s=Asterisk PBX 11.5.0
c=IN IP4 178.216.200.80
t=0 0
m=image 4385 udptl t38
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxDatagram:1400
a=T38FaxUdpEC:t38UDPRedundancy

---

<--- SIP read from UDP:81.219.46.10:33874 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK3864f547;rport=5060
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 102 INVITE
Contact: <sip:jacek@10.0.0.97:5060>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Require: timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:81.219.46.10:33874 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK3864f547;rport=5060
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 102 INVITE
Contact: <sip:jacek@10.0.0.97:5060>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Session-Expires: 1800;refresher=uac
Require: timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Content-Length: 269

v=0
o=jacek 8000 8001 IN IP4 132.82.0.0
s=SIP Call
c=IN IP4 132.82.0.0
t=0 0
m=image 5004 udptl t38
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxBuffer:400
a=T38FaxMaxDatagram:1400
a=T38FaxUdpEC:t38UDPRedundancy
<------------->
--- (14 headers 12 lines) ---
Got T.38 offer in SDP in dialog 1959374224-5060-3@BA.A.A.JH
Capabilities: us - (alaw), peer - audio=(nothing)/video=(nothing)/text=(nothing), combined - (nothing)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
Got T.38 Re-invite without audio. Keeping RTP active during T.38 session.
set_destination: Parsing <sip:jacek@10.0.0.97:5060> for address/port to send to
set_destination: set destination to 10.0.0.97:5060
Transmitting (NAT) to 81.219.46.10:33874:
ACK sip:jacek@10.0.0.97:5060 SIP/2.0
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK5c6930cd;rport
Max-Forwards: 70
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Contact: <sip:999@178.216.200.80:5060>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 102 ACK
User-Agent: Asterisk T.38 test
Content-Length: 0


---
set_destination: Parsing <sip:jacek@10.0.0.97:5060> for address/port to send to
set_destination: set destination to 10.0.0.97:5060
Audio is at 13094
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 81.219.46.10:33874:
INVITE sip:jacek@10.0.0.97:5060 SIP/2.0
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK4962e551;rport
Max-Forwards: 70
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Contact: <sip:999@178.216.200.80:5060>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 103 INVITE
User-Agent: Asterisk T.38 test
Session-Expires: 1800;refresher=uac
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 266

v=0
o=root 1987209555 1987209557 IN IP4 178.216.200.80
s=Asterisk PBX 11.5.0
c=IN IP4 178.216.200.80
t=0 0
m=audio 13094 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:81.219.46.10:33874 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK4962e551;rport=5060
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 103 INVITE
Contact: <sip:jacek@10.0.0.97:5060>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Require: timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:81.219.46.10:33874 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK4962e551;rport=5060
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 103 INVITE
Contact: <sip:jacek@10.0.0.97:5060>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Session-Expires: 1800;refresher=uac
Require: timer
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Content-Length: 243

v=0
o=jacek 8000 8002 IN IP4 10.0.0.97
s=SIP Call
c=IN IP4 10.0.0.97
t=0 0
m=audio 5004 RTP/AVP 8 101
a=sendrecv
a=rtpmap:8 PCMA/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54
a=silenceSupp:off - - - -
<------------->
--- (14 headers 12 lines) ---
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (alaw), peer - audio=(alaw)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.0.0.97:5004
set_destination: Parsing <sip:jacek@10.0.0.97:5060> for address/port to send to
set_destination: set destination to 10.0.0.97:5060
Transmitting (NAT) to 81.219.46.10:33874:
ACK sip:jacek@10.0.0.97:5060 SIP/2.0
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK3d4aefeb;rport
Max-Forwards: 70
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Contact: <sip:999@178.216.200.80:5060>
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 103 ACK
User-Agent: Asterisk T.38 test
Content-Length: 0


---
Scheduling destruction of SIP dialog '1959374224-5060-3@BA.A.A.JH' in 32000 ms (Method: ACK)
set_destination: Parsing <sip:jacek@10.0.0.97:5060> for address/port to send to
set_destination: set destination to 10.0.0.97:5060
Reliably Transmitting (NAT) to 81.219.46.10:33874:
BYE sip:jacek@10.0.0.97:5060 SIP/2.0
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK492370f4;rport
Max-Forwards: 70
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 104 BYE
User-Agent: Asterisk T.38 test
Proxy-Authorization: Digest username="jacek", realm="asterisk", algorithm=MD5, uri="sip:178.216.200.80", nonce="65ce1fb5", response="606690fe00fc94fdbcd99a0b88eab6db"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---

<--- SIP read from UDP:81.219.46.10:33874 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 178.216.200.80:5060;branch=z9hG4bK492370f4;rport=5060
From: <sip:999@178.216.200.80>;tag=as3dcba4d1
To: "jacek" <sip:jacek@178.216.200.80>;tag=887820089
Call-ID: 1959374224-5060-3@BA.A.A.JH
CSeq: 104 BYE
Contact: <sip:jacek@10.0.0.97:5060>
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Really destroying SIP dialog '1959374224-5060-3@BA.A.A.JH' Method: ACK

<--- SIP read from UDP:81.219.46.10:33874 --->
REGISTER sip:178.216.200.80 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK62672580;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=1093378675
To: <sip:jacek@178.216.200.80>
Call-ID: 470802799-5060-1
CSeq: 2004 REGISTER
Contact: <sip:jacek@10.0.0.97:5060>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B8223F6CC>"
Authorization: Digest username="jacek", realm="asterisk", nonce="334a43ef", uri="sip:178.216.200.80", response="ba0b014a55b647a541fe25df351615e7", algorithm=MD5
Max-Forwards: 70
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Supported: path
Expires: 180
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (14 headers 0 lines) ---
Sending to 81.219.46.10:33874 (NAT)
Sending to 81.219.46.10:33874 (NAT)

<--- Transmitting (NAT) to 81.219.46.10:33874 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK62672580;received=81.219.46.10;rport=33874
From: "jacek" <sip:jacek@178.216.200.80>;tag=1093378675
To: <sip:jacek@178.216.200.80>;tag=as6599fe0a
Call-ID: 470802799-5060-1
CSeq: 2004 REGISTER
Server: Asterisk T.38 test
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6e345d11"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '470802799-5060-1' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:81.219.46.10:33874 --->
REGISTER sip:178.216.200.80 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK1577400622;rport
From: "jacek" <sip:jacek@178.216.200.80>;tag=1093378675
To: <sip:jacek@178.216.200.80>
Call-ID: 470802799-5060-1
CSeq: 2005 REGISTER
Contact: <sip:jacek@10.0.0.97:5060>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B8223F6CC>"
Authorization: Digest username="jacek", realm="asterisk", nonce="6e345d11", uri="sip:178.216.200.80", response="acb37ea74d026f4e589fae5a0e600ebc", algorithm=MD5
Max-Forwards: 70
User-Agent: Grandstream HT-503 V1.1B 1.0.9.1 chip V2.2
Supported: path
Expires: 180
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0

<------------->
--- (14 headers 0 lines) ---
Sending to 81.219.46.10:33874 (NAT)

<--- Transmitting (NAT) to 81.219.46.10:33874 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.97:5060;branch=z9hG4bK1577400622;received=81.219.46.10;rport=33874
From: "jacek" <sip:jacek@178.216.200.80>;tag=1093378675
To: <sip:jacek@178.216.200.80>;tag=as6599fe0a
Call-ID: 470802799-5060-1
CSeq: 2005 REGISTER
Server: Asterisk T.38 test
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Expires: 180
Contact: <sip:jacek@10.0.0.97:5060>;expires=180
Date: Sun, 18 Aug 2013 10:43:02 GMT
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '470802799-5060-1' in 32000 ms (Method: REGISTER)

What can be wrong?