SIP trunk unable to connect

Hi,

Can someone please help me with the following issue

sip.conf
faxdetect=no
vmexten=*97
useragent=PBXact-14.0.3.1(13.19.1)
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g726
allow=g722
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
limitonpeers=yes
rtpend=20000
context=from-sip-external
callerid=Unknown
rtpstart=10000
tcpenable=yes
callevents=yes
bindport=5062
jbenable=no
checkmwi=10
maxexpiry=3600
minexpiry=90
srvlookup=yes
tlsenable=no
allowguest=yes
notifyhold=yes
rtptimeout=30
canreinvite=yes
tlsbindaddr=[::]:5060
rtpkeepalive=0
videosupport=no
defaultexpiry=60
notifyringing=yes
maxcallbitrate=384
rtpholdtimeout=300
g726nonstandard=no
registertimeout=600
tlsclientmethod=tlsv1
registerattempts=0
nat=force_rport,comedia
ALLOW_SIP_ANON=no
tlscafile=/etc/pki/tls/certs/ca-bundle.crt
externip=2.0.200.XXX
localnet=192.168.1.0/24
localnet=2.0.200.XXX/29
localnet=92.87.198.XXX/29
localnet=92.87.198.XXX/29
language=en

I tried to connect with an Xlite phone and everything was ok
Peer User/ANR Call ID Format Hold Last Message Expiry Peer
(null) 226029001055937 084690c94cdbd0a (nothing) No
1 active SIP dialog

Name/username Host Dyn Forcerport Comedia ACL Port Status Description
300/300 192.168.1.63 D Yes Yes A 5111 OK (6 ms)
Telekom/226029001055937@a (Unspecified) Yes Yes A 0 UNKNOWN
2 sip peers [Monitored: 1 online, 1 offline Unmonitored: 0 online, 0 offline]

Is the issue inbound or outbound calls ?
Where is the sip configuration for this peer ?

also if you use x lite to test the sip credentials you used an username and password, which you should be using on the asterisk side with the registration string, in order the inbound calls to work assuming they send the calls to a SIP user instead of SIP URI

Hi,
sory i am pretty new to asterisk, this is my first asterisk system which i am trying to set up.
I am having issues with both outgoing and incoming.

here is what i tryed to write up in sip.conf

permit=0.0.0.0/0.0.0.0
type=friend
username=22602900105XXX@as1.romteleXXX.net
secret=24129188129XXX
transport=TCP&UDP
domain=as1.romteleXXX.net
host=as1.romteleXXX.net
bindport=5060
udpbindaddr=0.0.0.0
nat=force_rport,comedia
registertimeout=600
insecure=port,invite
dtmfmode=RFC2833
disallow=all
allow=G711A&G729
context=from-pstn-toheader
qualify=yes
trustpid=yes

and the inbound string
226029001055XXX@as1.romtelecom.net:24129188129XXX@as1.romteleXXX.net:5060

register string start with register=>
Is this really the username or you add the username with the server name ?

also you have some settings that you can improve like type peer instead friend to add more security, dont need to use insecure port, as this wont make any difference really with your issue, invite it is not needed if use remotesecret and remove the secret

I will suggest enable the sip debug with sip set debug on and try to debug a call

Here is what the ISP gave me :

Minimum requirements for siptrunk :

The SIP credentials must be configurable with:

  • The all service codes were using * and # characters, must be sent to VoIP platform in clear mode, the # char should send as it is.
  • DTMF mode must be configurable: RFC2833, SIP Info, Inband.
  • FAX must working over G711Alaw as well as using T38.
  • Register Expire = 600 s
  • Session Expire =3600 s
  • Min Session Expire =90 s
  • Send Option =Enable
  • Proxy Server Port =5060
  • Registrar Server Port =5060
  • Register Retrying Interval = 60 s
  • Option Timer = 250 s
  • Device Must Support DHCP opt 121(Classless Static Route) on Voice WAN
  • DNS Servers - 193.231.100.XXX ; 193.231.100.XXX

<— SIP read from UDP:192.168.1.63:5213 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.10:5062;branch=z9hG4bK2306c48b;rport=5062
From: “Unknown” sip:Unknown@192.168.1.10:5062;tag=as1f540731
To: sip:300@192.168.1.63:5213;tag=1761016512
Call-ID: 7b95e3b23305e56b537b76274c96da44@192.168.1.10:5062
CSeq: 102 OPTIONS
Contact: sip:300@192.168.1.63:5213
Supported: 100rel, replaces, timer
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, REFER, NOTIFY, INFO, PRACK, UPDATE, MESSAGE
Accept: application/sdp, message/sipfrag, application/dtmf-relay
Content-Length: 0

[2019-03-25 20:09:21] ERROR[2501]: netsock2.c:305 ast_sockaddr_resolve: getaddrinfo(“as1.romtelecom.net”, “(null)”, …): Name or service not known
[2019-03-25 20:09:21] WARNING[2501]: acl.c:835 resolve_first: Unable to lookup ‘as1.romtelecom.net

There is DNS issue here

Also the trace you displayed is not for a SIP call it is an OPTION request for peer 300 nothing related to this issue

That hostname does not resolve. It also does not have an SRV record.

The ISP sugested that for Asterisk systems i should do a map-area in etc/hosts which i am not sure if i did it correctly :
127.0.0.1 Sangoma-PBX localhost localhost.localdomain localhost4
::1 Sangoma-PBX localhost localhost6
::2 92.87.198.XXX as1.romteleXXX.net

can you please tell me how to fix that like i said i am really new to Asterisk

many thanks

You did not place it into /etc/hosts correctly, it would be a line like:

92.87.198.XXX as1.romteleXXX.net
1 Like

127.0.0.1 Sangoma-PBX localhost localhost.localdomain localhost4
::1 Sangoma-PBX localhost localhost6
92.87.198.XXX as1.romteleXXX.net
i think now is correct

Now on peers i have this message

Telekom/226029001055XXX@a 92.87.198.XXX Yes Yes A 5060 UNKNOWN

Should i try to replace the domain with the IP address ?

as1.romteleXXX.net with 92.87.198.XXX

You can if you want to… but it is now resolving and the peer has info. What happens now if you try to use it?

eally destroying SIP dialog ‘48d238c2455c35167e7e545218551e3b@192.168.1.10:5062’ Method: OPTIONS
Reliably Transmitting (NAT) to 92.87.198.105:5060:
OPTIONS sip:as1.romtelecom.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5062;branch=z9hG4bK6f7f6ad9;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@192.168.1.10:5062;tag=as7f4e587c
To: sip:as1.romtelecom.net
Contact: sip:Unknown@192.168.1.10:5062
Call-ID: 32304b7b780ae018563a990149c4fc27@192.168.1.10:5062
CSeq: 102 OPTIONS
User-Agent: PBXact-14.0.3.1(13.19.1)
Date: Mon, 25 Mar 2019 18:42:24 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #1 (NAT) to 92.87.198.105:5060:
OPTIONS sip:as1.romtelecom.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5062;branch=z9hG4bK6f7f6ad9;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@192.168.1.10:5062;tag=as7f4e587c
To: sip:as1.romtelecom.net
Contact: sip:Unknown@192.168.1.10:5062
Call-ID: 32304b7b780ae018563a990149c4fc27@192.168.1.10:5062
CSeq: 102 OPTIONS
User-Agent: PBXact-14.0.3.1(13.19.1)
Date: Mon, 25 Mar 2019 18:42:24 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #2 (NAT) to 92.87.198.105:5060:
OPTIONS sip:as1.romtelecom.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5062;branch=z9hG4bK6f7f6ad9;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@192.168.1.10:5062;tag=as7f4e587c
To: sip:as1.romtelecom.net
Contact: sip:Unknown@192.168.1.10:5062
Call-ID: 32304b7b780ae018563a990149c4fc27@192.168.1.10:5062
CSeq: 102 OPTIONS
User-Agent: PBXact-14.0.3.1(13.19.1)
Date: Mon, 25 Mar 2019 18:42:24 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

Asterisk isn’t getting a response to the SIP OPTIONS. You’d need to ask the remote side if the IP address is correct, and why they aren’t responding.

userID: +40217940184
account name: +40217940184
authorization name: 226029001055937@as1.romtelecom.net
pssw: 24129188129782
IP_LAN_VoBB: 2.0.200.224/29
IP_GW: 2.0.200.225/29
IP_laptop (sau centrala clientului): 2.0.200.226/29, port 5060
IP_proxy: 92.87.198.105
domain: as1.romtelecom.net

Some SIP mis-implementations simply do not respond to OPTIONS. Asterisk will accept even failure responses, and any valid SIP implementation should produce at least a failure response, even if it has no idea what OPTIONS means.

Hi all sorry for my late reply, but it seems like when i am new user i can’t post more than 22 reply in 24hours,

I changed the config from Chan_sip to PJSIP and i managed to get it to register but my problem now is that i can’t receive any incoming calls

here is the config
#include pjsip.registration_custom.conf

[226029001055937@as1.romtelecom.net]
type=registration
transport=0.0.0.0-udp
outbound_auth=226029001055937@as1.romtelecom.net
retry_interval=60
max_retries=1000
expiration=600
line=yes
endpoint=226029001055937@as1.romtelecom.net
auth_rejection_permanent=no
server_uri=sip:as1.romtelecom.net:5060
client_uri=sip:+40217940184@as1.romtelecom.net:5060

#include pjsip.identify_custom.conf

[301-identify]
type=identify
endpoint=301

[226029001055937@as1.romtelecom.net]
type=identify
endpoint=226029001055937@as1.romtelecom.net
match=as1.romtelecom.net

#include pjsip.endpoint_custom.conf

[301]
type=endpoint
aors=301
auth=301-auth
tos_audio=ef
tos_video=af41
cos_audio=5
cos_video=4
allow=ulaw,alaw,gsm,g726,g722
context=from-internal
callerid=test <301>
dtmf_mode=rfc4733
mailboxes=301@device
mwi_subscribe_replaces_unsolicited=yes
aggregate_mwi=yes
use_avpf=no
rtcp_mux=no
ice_support=no
media_use_received_transport=no
trust_id_inbound=yes
media_encryption=no
timers=yes
media_encryption_optimistic=no
send_pai=yes
rtp_symmetric=yes
rewrite_contact=yes
force_rport=yes
language=en
set_var=CHANNEL(parkinglot)=default

[anonymous]
type=endpoint
context=from-sip-external
allow=all
transport=udp,tcp,ws,wss

[226029001055937@as1.romtelecom.net]
type=endpoint
transport=0.0.0.0-udp
context=from-trunk
disallow=all
allow=ulaw,alaw,gsm,g726,g722
aors=226029001055937@as1.romtelecom.net
language=en
auth=226029001055937@as1.romtelecom.net
t38_udptl=yes
t38_udptl_ec=redundancy
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=yes
direct_media=no
rewrite_contact=yes
rtp_symmetric=yes
dtmf_mode=auto

#include pjsip.auth_custom.conf

[301-auth]
type=auth
auth_type=userpass
password=c309e3005c6e653b8966c6a116ec3f04
username=301

[226029001055937@as1.romtelecom.net]
type=auth
auth_type=userpass
password=24129188129782
username=226029001055937@as1.romtelecom.net

#include pjsip.aor_custom.conf

[301]
type=aor
mailboxes=301@device
max_contacts=2
remove_existing=no
maximum_expiration=7200
minimum_expiration=60
qualify_frequency=60

[226029001055937@as1.romtelecom.net]
type=aor
qualify_frequency=0
contact=sip:as1.romtelecom.net:5060

#include pjsip.transports_custom.conf

[0.0.0.0-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=2.0.200.226
external_signaling_address=2.0.200.226
allow_reload=no
tos=cs3
cos=3
local_net=192.168.1.0/24
local_net=2.0.200.224/29
local_net=92.87.198.104/29
local_net=92.87.198.112/29

Endpoint: <Endpoint/CID…> <State…> <Channels.>
I/OAuth: <AuthId/UserName…>
Aor: <Aor…>
Contact: <Aor/ContactUri…> <Hash…> <RTT(ms)…>
Transport: <TransportId…> <BindAddress…>
Identify: <Identify/Endpoint…>
Match: <criteria…>
Channel: <ChannelId…> <State…> <Time…>
Exten: <DialedExten…> CLCID: <ConnectedLineCID…>

Endpoint: 226029001055937@as1.romtelecom.net Not in use 0 of inf
OutAuth: 226029001055937@as1.romtelecom.net/226029001055937@as1.romtelecom.net
InAuth: 226029001055937@as1.romtelecom.net/226029001055937@as1.romtelecom.net
Aor: 226029001055937@as1.romtelecom.net 0
Contact: 226029001055937@as1.romtelecom.net/sip:as1 86468a80c9 Unknown nan
Transport: 0.0.0.0-udp udp 3 96 0.0.0.0:5060
Identify: 226029001055937@as1.romtelecom.net/226029001055937@as1.romtelecom.net
Match: 92.87.198.105/32

Endpoint: 301/301 Not in use 0 of inf
InAuth: 301-auth/301
Aor: 301 2
Contact: 301/sip:301@192.168.1.94:61435;rinstance=8 8f8378342e Avail 17.933
Identify: 301-identify/301

Endpoint: anonymous Unavailable 0 of inf

Objects found: 3

Many thanks