Sip trunk problem with hipath

Hello,
I am trying to call an external pbx (HiPath 8000) via an old version (11.5.0) asterisk.
The other party asked for TCP with 65060 port gave a username and password.
My configuration is below.

Replacing the IP add and username with fake ones for sure…

register =>tcp://9011111111:123456:@111.222.111.222:65060

and for call

[abb]
context=CommPanels
username=9011111111
secret=123456
insecure=invite
canreinvite=no
transport=tcp
protocol=tcp
port=65060
allowguest=yes
type=peer
disallow=all
allow=alaw
allow=ulaw
sendrpid=yes
directrtpsetup=no
qualify=no
host=111.222.111.222
nat=force_rport,comedia

Asterisk is behind nat so, I wrote nat=force_rport,comedia to global setting also with externip parameter. (showed as 222.111.222.111 on logs)

Here is what happens. If I try the very same setting with microsip, microsip registers, makes call receives call.
If I set asterisk with the settings above, asterisk registers, receive calls, but when I try to make call from asterisk to remote party, . it waits waits then drops call.

Here is what I see on sip debug.
Executing [03014@CommPanelsWithAnalog:1] Set(“SIP/4567-00000014”, “CALLERID(all)=9011111111”) in new stack
– Executing [03014@CommPanelsWithAnalog:2] Dial(“SIP/4567-00000014”, “SIP/3014@abb, 40”) in new stack
== Using SIP RTP CoS mark 5
Audio is at 18128
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 111.222.111.222:65060:
INVITE sip:3014@111.222.111.222:65060 SIP/2.0
Via: SIP/2.0/TCP 222.111.222.111:5060;branch=z9hG4bK7b1872a2;rport
Max-Forwards: 70
From: sip:9011111111@222.111.222.111;tag=as05d80c64
To: sip:3014@111.222.111.222:65060
Contact: sip:9011111111@222.111.222.111:5060;transport=TCP
Call-ID: 2addf34041405d023570831a6262ea31@222.111.222.111:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.5.0
Date: Thu, 18 Feb 2021 13:35:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Remote-Party-ID: “9011111111” sip:9011111111@222.111.222.111;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 288

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


-- Called SIP/3014@abb

Assuming the content length is correct for the un-redacted contents, there is no reason why the peer should not have responded in some way.

(Note that force_rport and comedia are the defaults when sending with a modified external IP, so the nat= option was redundant. In any case, the reply should have been on the same connection, so the rport should not be relevant (and force_rport only applies to incoming requests.)

I couldn’t figure out any difference with microsip wireshark output either.
Couldn’t figure out why microsip works but asterisk don’t.

There should be something different with asterisks behavior with starting a call.
If it was a firewall issue, microsip should’nt work also.
Thinking of a bug relating to tcp but on this case, it works well when in the same network with remote pbx.
Any ideas are welcome.

To test if it is something about asterisk version, I installed asterisk 16.16.1
Created the config

[abb]
context=CommPanels
username=90312511111
secret=xxxxxxx
insecure=invite
canreinvite=yes
dtmfmode=rfc2833
directmedia=yes
fromdomain=2111.222.111.222
transport=tcp
protocol=tcp
port=65060
allowguest=yes
type=peer
allow=all
qualify=no
host=111.222.111.222
nat=force_rport,comedia

But again no difference
rtp debug is on… but no packet traffic occurs on rtp
only sip traffic,
I also monitored from our external firewall, no reply comes back from hipath side.

-- Executing [003014@CommPanelsWithAnalog:1] Set("SIP/4567-00000006", "CALLERID(all)=903121111111") in new stack
-- Executing [003014@CommPanelsWithAnalog:2] Dial("SIP/4567-00000006", "SIP/03014@abb,40,o") in new stack

== Using SIP RTP CoS mark 5
We think we can do text
Audio is at 65064
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec codec2 to SDP
Adding codec g723 to SDP
Adding codec g726 to SDP
Adding codec g726aal2 to SDP
Adding codec adpcm to SDP
Adding codec slin to SDP
Adding codec slin12 to SDP
Adding codec slin16 to SDP
Adding codec slin24 to SDP
Adding codec slin32 to SDP
Adding codec slin44 to SDP
Adding codec slin48 to SDP
Adding codec slin96 to SDP
Adding codec slin192 to SDP
Adding codec lpc10 to SDP
Adding codec g729 to SDP
Adding codec speex to SDP
Adding codec speex16 to SDP
Adding codec speex32 to SDP
Adding codec ilbc to SDP
Adding codec g722 to SDP
Adding codec siren7 to SDP
Adding codec siren14 to SDP
Adding codec testlaw to SDP
Adding codec g719 to SDP
Adding codec opus to SDP
Adding codec silk8 to SDP
Adding codec silk12 to SDP
Adding codec silk16 to SDP
Adding codec silk24 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 111.222.111.222:65060:
INVITE sip:03014@111.222.111.222:65060 SIP/2.0
Via: SIP/2.0/TCP 222.111.222.111:65060;branch=z9hG4bK4f0d04d3;rport
Max-Forwards: 70
From: sip:903121111111@222.111.222.111:65060;tag=as050bcf85
To: sip:03014@111.222.111.222:65060
Contact: sip:903121111111@222.111.222.111:65060;transport=tcp
Call-ID: 697fc415184b76462677d0430ce968ca@222.111.222.111:65060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 16.16.1
Date: Wed, 24 Feb 2021 12:20:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 1095

v=0
o=root 811739834 811739834 IN IP4 222.111.222.111
s=Asterisk PBX 16.16.1
c=IN IP4 222.111.222.111
t=0 0
m=audio 65064 RTP/AVP 0 8 3 4 111 112 5 10 122 118 123 124 125 126 127 96 7 18 110 117 119 97 9 102 115 116 107 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:111 G726-32/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:10 L16/8000
a=rtpmap:122 L16/12000
a=rtpmap:118 L16/16000
a=rtpmap:123 L16/24000
a=rtpmap:124 L16/32000
a=rtpmap:125 L16/44000
a=rtpmap:126 L16/48000
a=rtpmap:127 L16/96000
a=rtpmap:96 L16/192000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:110 speex/8000
a=rtpmap:117 speex/16000
a=rtpmap:119 speex/32000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=fmtp:116 bitrate=64000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:20
a=sendrecv


-- Called SIP/03014@abb

Reliably Transmitting (NAT) to 10.1.200.51:57042:
OPTIONS sip:4567@10.1.200.51:57042;ob SIP/2.0
Via: SIP/2.0/UDP 10.1.200.54:5060;branch=z9hG4bK06350926;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.1.200.54;tag=as034eb86e
To: sip:4567@10.1.200.51:57042;ob
Contact: sip:asterisk@10.1.200.54:5060
Call-ID: 0455b3a022dd7b9a2e1640e73a6d08c1@10.1.200.54:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.16.1
Date: Wed, 24 Feb 2021 12:20:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:10.1.200.51:57042 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.200.54:5060;rport=5060;received=10.1.200.54;branch=z9hG4bK06350926
Call-ID: 0455b3a022dd7b9a2e1640e73a6d08c1@10.1.200.54:5060
From: “asterisk” sip:asterisk@10.1.200.54;tag=as034eb86e
To: sip:4567@10.1.200.51;ob;tag=z9hG4bK06350926
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: MicroSIP/3.20.1
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Really destroying SIP dialog ‘0455b3a022dd7b9a2e1640e73a6d08c1@10.1.200.54:5060’ Method: OPTIONS
Reliably Transmitting (NAT) to 10.1.200.51:57042:
OPTIONS sip:4567@10.1.200.51:57042;ob SIP/2.0
Via: SIP/2.0/UDP 10.1.200.54:5060;branch=z9hG4bK5bbc93f5;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.1.200.54;tag=as42cccace
To: sip:4567@10.1.200.51:57042;ob
Contact: sip:asterisk@10.1.200.54:5060
Call-ID: 7feb906e2e618f665ac6d81479ea2be5@10.1.200.54:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.16.1
Date: Wed, 24 Feb 2021 12:20:47 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:10.1.200.51:57042 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.200.54:5060;rport=5060;received=10.1.200.54;branch=z9hG4bK5bbc93f5
Call-ID: 7feb906e2e618f665ac6d81479ea2be5@10.1.200.54:5060
From: “asterisk” sip:asterisk@10.1.200.54;tag=as42cccace
To: sip:4567@10.1.200.51;ob;tag=z9hG4bK5bbc93f5
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
User-Agent: MicroSIP/3.20.1
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Really destroying SIP dialog ‘7feb906e2e618f665ac6d81479ea2be5@10.1.200.54:5060’ Method: OPTIONS
Reliably Transmitting (NAT) to 10.1.200.51:57042:
OPTIONS sip:4567@10.1.200.51:57042;ob SIP/2.0
Via: SIP/2.0/UDP 10.1.200.54:5060;branch=z9hG4bK117c9e44;rport
Max-Forwards: 70
From: “asterisk” sip:asterisk@10.1.200.54;tag=as465e4c6c
To: sip:4567@10.1.200.51:57042;ob
Contact: sip:asterisk@10.1.200.54:5060
Call-ID: 2fc75744166702de27ad2cf374b8c315@10.1.200.54:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 16.16.1
Date: Wed, 24 Feb 2021 12:20:48 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

What I notice was,
as I wrote before I have two configurations for this trunk.
First register line.
and I can see I am registered via sip show registry.

But for second part (sip account)
it seems it is failing.
If I enable qualify, this trunk seems unreachable. This might be the reason I can not dial outside.

From the same remote network, I was able to run a simple yealink phone without any problems.

2021-02-26_11-12-47

I am trying the same on asterisk but it does not connect.

2021-02-26_11-17-08

2021-02-26_11-22-51

Is there any anormalities that you can see on configuration?

No tcpenable and the default is no.

Infact it is enabled on general section of sip.conf
This configuration works on LAN connection.
Problem is when connecting from wan side.

I suspect there is a SBC between hipath and firewall on remote side and it does not like something on my sip headers.

I found the problem and the solution.
I was digging on wrong settings. It was all about register for outgoing calls.
made the register line liike this
register =>tcp://9011111111:xxxxx:@222.111.222.111:65060/9011111111~3600

and same name used in sip account

[9011111111] <= here
context=CommPanelsWithAnalog
host=222.111.222.111
username=9011111111
secret=xxxxx
authuser=9011111111
fromuser=9011111111
fromdomain=222.111.222.111:65060
insecure=port,invite
canreinvite=no
directmedia=no
transport=tcp
port=65060
allowguest=yes
type=peer
disallow=all
allow=ulaw,alaw
nat=force_rport,comedia
callerid=9011111111
qualify=10000
trustrpid=yes
sendrpid=yes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.