Connection to Asterisk of SIP number drops after some minutes

Hello,

I have an SIP number in my hands. I have registered it to myasterisk system as follows. Bu I am having trouble with the fact that its connection drops after a few minutes after I start with sudo asterisk -rvvvv.

I know this because initially when i call i see logs and it does answer.

Asterisk 22.1.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 22.1.0 currently running on emre-OptiPlex-7020 (pid = 3408018)
– Executing [s@from-netgsm:1] NoOp(“PJSIP/8503045647-00000000”, “”) in new stack
– Executing [s@from-netgsm:2] Stasis(“PJSIP/8503045647-00000000”, “tr_zarniwoop”) in new stack
> 0x775af025ffa0 – Strict RTP learning after remote address set to: 185.88.7.224:12490
> 0x775af025ffa0 – Strict RTP switching to RTP target address 185.88.7.224:12490 as source
– <PJSIP/8503045647-00000000> Playing ‘greeting_tr_zarniwoop.slin’ (language ‘en’)
> 0x775af025ffa0 – Strict RTP learning complete - Locking on source address 185.88.7.224:12490

But if I call again after a few minutes no logs appear at all and the call drops.
I think some sort of keep alive signal needs to be sent but i dont know how.

my pjsip_wizard.conf

[example]
type = wizard
sends_auth = yes
accepts_auth = no
sends_registrations = yes
accepts_registrations = no
transport = transport-udp
remote_hosts = sip.netgsm.com.tr:5060
outbound_auth/username = mynumber
outbound_auth/password = mypass
endpoint/allow = !all,ulaw,g722
endpoint/context = from-netgsm

[netgsm-identify/example]
type = identify
endpoint = from-netgsm
; This rule matches the “To” header if it contains mynumber
match_header = To:.*mynumber

You need to use the CLI command “pjsip set logger on”, to get a log of the actual SIP exchange, but such failures are typically due to not configuring public addresses and local networks correctly, or relying on the router to add dynamic routes or firewall rules.

Personally I find non-wizard configurations much easier to check.