Incoming call works only after restart


(Patcino) #1

Hello,

I explain the problem, all outgoing calls works fine, incoming calls works only once after reboot, after the first hang up all incoming calls does not work,
Can you help me please?

FreePBX 15.0.17.5
CHANSIP
Peers sip ok

Best regards.


#2

On a failing call, does anything get logged in the Asterisk log?

If so, paste the log for the call at pastebin.freepbx.org and post the link here. Also report what caller hears.

If nothing is logged, do incoming INVITEs appear in sngrep? If so, FreePBX firewall is blocking the call, set your provider IP addresses as trusted.

If sngrep shows nothing, your hardware router/firewall is likely blocking the call. Post details about make/model, special settings such as port forwarding, SIP ALG, etc.


(Patcino) #3

Hello, thank you for your answer,

indeed in the event of an overdue call, nothing is displayed in the Asterisk log nor in the sngrep I also checked the firewall level all seems normal, what I do not understand is that why when I restart the server the first call we take goes well and once hung up no incoming call.

Berst regards.


(Patcino) #4

Here is the log I have after the first successful call:

[2020-12-21 11:59:14] VERBOSE[4589][C-00000001] file.c: <SIP/+41*****-00000000> Playing ‘no-valid-responce-transfering.ulaw’ (language ‘fr’)
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx.c: Executing [t@ivr-3:6] Goto(“SIP/+41*****-00000000”, “app-blackhole,hangup,1”) in new stack
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx_builtins.c: Goto (app-blackhole,hangup,1)
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx.c: Executing [hangup@app-blackhole:1] NoOp(“SIP/+41*****-00000000”, “Blackhole Dest: Hangup”) in new stack
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx.c: Executing [hangup@app-blackhole:2] Hangup(“SIP/+41******-00000000”, “”) in new stack
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx.c: Executing [hangup@app-blackhole:2] Hangup(“SIP/+41*****-00000000”, “”) in new stack
[2020-12-21 11:59:20] VERBOSE[4589][C-00000001] pbx.c: Spawn extension (app-blackhole, hangup, 2) exited non-zero on ‘SIP/+41*******-00000000’
[2020-12-21 11:59:20] VERBOSE[2154][C-00000001] chan_sip.c: Incoming call: Got SIP response 403 “Forbidden ***” back from ***.***.***.***:5060


(Communication Technologies) #5

What do you hear on a failed call? What does the carrier report on it’s logs regarding the call?


(Patcino) #6

Hello,
Normal ringing, but no Asterisk log.
Regards.


#7

I had asked “If sngrep shows nothing, your hardware router/firewall is likely blocking the call. Post details about make/model, special settings such as port forwarding, SIP ALG, etc.”

Also, if you are not forwarding the chan_sip port in your firewall, confirm that you have qualify set in the trunk, to keep the NAT association from timing out.

What is the output of the Asterisk command
sip show registry


(Patcino) #8

Hello,

SIP ALG enabled in USG20 firewall, config USG20 PPPoE IP static

Host dnsmgr Username Refresh State Reg.Time
.swisscom.ch:5060 Y +41* 165 Registered Mon, 21 Dec 2020 20:29:31
.swisscom.ch:5060 Y +41* 165 Registered Mon, 21 Dec 2020 20:29:31
2 SIP registrations.

OUTGOING:
user=+41***
type=peer
transport=udp
srvlookup=yes
secret=***
qualify=yes
outboundproxy=fs1.ims.swisscom.ch
nat=yes
insecure=invite,port
host=swisscom.ch
fromuser=+41***
fromdomain=swisscom.ch
dtmfmode=auto
disallow=all
defaultuser=NC***@swisscom.ch
canreinvite=no
allow=alaw & ulaw & g729 & gsm & slinear & ulaw

INCOMING:
type=peer
qualify=yes
host=fs1.ims.swisscom.ch
fromdomain=swisscom.ch
disallow=all
allow=alaw & ulaw & g729 & gsm & slinear & ulaw

REGISTER STRING:
+41***@swisscom.ch:***:NC***@swisscom.ch@fs1.ims.swisscom.ch/+41***


#9

In the USG, turn off SIP ALG. If this causes any new troubles, confirm that in Asterisk SIP Settings, External Address and Local Networks are correctly set. Restart Asterisk if you change them. If you still have the new problem, post details.

Next, in the USG, change both UDP timeouts from 30 to 300 (seconds) and restart Asterisk.

If this doesn’t fix incoming, if your USG has a setting for Consistent NAT, turn that on.

I don’t understand why Asterisk shows two registrations. Are they still present? Do you have more than one trunk configured?

If incoming calls are still not working (and sngrep still shows no INVITEs for failing calls), do a packet capture on the USG’s WAN interface to see whether Swisscom is sending them. If so, we need to see why they aren’t being routed to the PBX. If not, we need to see why registration is being lost.


(Patcino) #10

Hello,
Yes i have 2 trunk configured,
Ihave disable SIP ALG and timeout has 600 as you requested, here is what i get in the sngrep
Register: 200 OK

REGISTER +41****@swisscom.ch +41****@swisscom.ch 2 192.168.1.:5060
REGISTER +41
***@swisscom.ch +41****@swisscom.ch 2 192.168.1.*:5060

Options: 403 Forbindden

OPTIONS Unknown@192.168.1.* fs1.ims.swisscom.ch 2 192.168.1.:5060 195.186.128.164:5060
OPTIONS Unknown@192.168.1.
fs1.ims.swisscom.ch 2 192.168.1.*:5060 195.186.128.164:5060

Options: 403 Forbindden

OPTIONS +41***@192.168.1.* swisscom.ch 2 192.168.1.:5060 195.186.128.164:5060
OPTIONS +41
**@192.168.1.* swisscom.ch 2 192.168.1.*:5060 195.186.128.164:5060

Sip general additional config:
accept_outofcall_message=yes
auth_message_requests=no
outofcall_message_context=dpma_message_context
faxdetect=no
vmexten=*97
useragent=FPBX-15.0.17.5(16.15.0)
language=fr
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g726
allow=g722
allow=g723
allow=g729
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=no
callevents=yes
jbenable=no
checkmwi=10
maxexpiry=3600
minexpiry=60
srvlookup=no
tlsenable=no
allowguest=yes
notifyhold=yes
rtptimeout=30
canreinvite=no
tlsbindaddr=[::]:5061
rtpkeepalive=0
videosupport=no
defaultexpiry=180
notifyringing=yes
maxcallbitrate=384
rtpholdtimeout=300
g726nonstandard=no
registertimeout=20
tlsclientmethod=tlsv1
registerattempts=0
nat=force_rport,comedia
ALLOW_SIP_ANON=no
udpbindaddr=0.0.0.0:5060
tlscafile=/etc/pki/tls/certs/ca-bundle.crt
localnet=192.168.1.0/24
Regards