Call dropping Automatically after some time

I have installed asterisk and working fine in local and in NAT also but call is dropping automatically after sometime.
Im using pjsip and I have configured only pjsip.conf and extensions file.

So can anyone guide me what I’m missing.

Thank you

How about providing some information besides the remark that the call is dropped…?

Because without information we can not provide you with valid feedback.

How about attaching a log file that shows the call being dropped.

“Some time”, how much time, is it always the same time…?

The better you are in providing information about the issue you are experiencing, the better the feedback will be that you will receive from the community.

Thank you for your reply. Since I’m new to asterisk and still struggling to get logs of call activity if you can provide me any command through which I can see any log then I will provide you details. Mean while I have posted my configure in this post.

Thank you

As I beginner I started with this…

Here you can find most of the knowledge you need to acquire, some things are obsolete, but you will see that quickly enough.

To provide the signaling, grep that from the Asterisk console, or use the application ngrep. Where the command would be: ngrep -d any -qt -W byline port 5060

Make sure you attach the logging as a file, do not paste the contents on the portal.

1 Like

If calls always drop after exactly the same time, it could be that your voip provider uses session timers which can cause problems in NAT scenarios.

You can test that if you set
timers=no
In the endpoint section of your provider and see if it gets better.

I’m not using trunk line I’m using is in local and from outside network using public IP.
Call is dropping in both scenario locally also and from out side network also.
Call is dropping exactly at 32 Seconds

This is my pjsip.conf

[transport-udp]
type=transport
protocol=udp    ;udp,tcp,tls,ws,wss,flow
bind=192.168.0.94:7061

; UDP transport behind NAT
;
[transport-udp-nat]
type=transport
protocol=udp
bind=192.168.0.94:7060
local_net=192.168.0.94/24
external_media_address=<External IP>
external_signaling_address=<External IP>

[6001]
type=endpoint
transport=transport-udp
context=from-internal
;nat=yes
disallow=all
allow=ulaw
allow=gsm
auth=6001
aors=6001


[6002]
type=endpoint
transport=transport-udp
context=from-internal
;nat=yes
disallow=all
allow=ulaw
allow=gsm
auth=6002
aors=6002


[6001]
type=auth
auth_type=userpass
password=6001
username=6001

[6002]
type=auth
auth_type=userpass
password=6002
username=6002

[6001]
type=aor
max_contacts=3
contact=sip:6001@192.168.0.94:7060

[6002]
type=aor
max_contacts=3
contact=sip:6002@192.168.0.94:7060


[from-internal]
exten => 6001,1,Dial(PJSIP/6001)
exten => 6002,1,Dial(PJSIP/6002)

Thank you.

Thank you for your attachment I’m going through it.

After running your command I’m getting below mentioned log.

U 2024/01/22 23:59:32.988370 192.168.0.94:7060 -> 192.168.0.105:37613 #61
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.0.105:37613;rport=37613;received=192.168.0.105;branch=z9hG4bK-524287-1---4f8c1080ab4ead00.
Call-ID: BsFVm0FVE4slQcNCtMh3Ag...
From: <sip:6002@192.168.0.94>;tag=065fdc56.
To: <sip:6002@192.168.0.94>;tag=z9hG4bK-524287-1---4f8c1080ab4ead00.
CSeq: 32 REGISTER.
Date: Mon, 22 Jan 2024 18:29:32 GMT.
Contact: <sip:6002@192.168.0.94:7060>.
Contact: <sip:6002@192.168.0.105:37613;transport=UDP;rinstance=e04baa2028ec3d06>;expires=59.
Expires: 60.
Server: Asterisk PBX 20.5.2.
Content-Length:  0.
.

There is no call in that log.

This log I got during call

U 2024/01/23 01:20:22.947713 192.168.0.94:7060 -> 185.117.83.208:35080 #662
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 185.117.83.208:35080;rport=35080;received=185.117.83.208;branch=z9hG4bKpYvJlaCo.
Call-ID: VbsGb2XAu6K0Ruhp78hMXA...
From: <sip:6001@103.147.70.142>;tag=db60b273.
To: <sip:6002@103.147.70.142>;tag=da095b48-8ab7-4c2f-8259-851d05af4da2.
CSeq: 2 INVITE.
Server: Asterisk PBX 20.5.2.
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER.
Contact: <sip:192.168.0.94:7060>.
Supported: 100rel, timer, replaces, norefersub.
Content-Type: application/sdp.
Content-Length:   251.
.
v=0.
o=- 0 1496662258 IN IP4 192.168.0.94.
s=Asterisk.
c=IN IP4 192.168.0.94.
t=0 0.
m=audio 12922 RTP/AVP 0 3 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=maxptime:150.
a=sendrecv.

We need the whole call.

However, this is sending local IP addresses when it should be sending public ones,

 logger show channels
Logger queue limit: 1000

Channel                             Type     Formatter  Status    Configuration
-------                             ----     ---------  ------    -------------
/var/log/asterisk/messages.log      File     default    Enabled    - NOTICE WARNING ERROR 
                                    Console  default    Enabled    - NOTICE WARNING ERROR VERBOSE 

Can anyone tell what these log means.

Thank you

They mean you haven’t enable the full log, which is what you need for most debugging.

The output isn’t a log but a description of what has been decoded from logger.conf.

Thanks for the link to that guide. I can’t wait to read it.