Assistance Needed with Asterisk Call Termination Upon Answering

Hello All,

I am new to Asterisk , I have just installed Asterisk 22.0 and tested the hello world example using Zoiper and it worked successfully ,

Now i have two clients and and i have set a simple dial plan so i can exchange calls between the different clients .
the pjsip.conf file

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[6001]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6001
aors=6001

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

[6001]
type=aor
max_contacts=1

[6002]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6002
aors=6002

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

[6002]
type=aor

The dial plan is shown below
exten => 6001,1,Dial(PJSIP/6001)
exten => 6002,1,Dial(PJSIP/6002)

When I dial the extension the call goes through and it rings as expected , but when i answer, the call gets terminated immediately ,

I have checked the logs and dont seem to have any error pointing to what the issue is

on the console this is the logs been showing

Endpoint 6001 is now Reachable
– Executing [6002@from-internal:1] Dial(“PJSIP/6001-00000002”, “PJSIP/6002”) in new stack
– Called PJSIP/6002
– PJSIP/6002-00000003 is ringing
> 0x7f7d3006a0b0 – Strict RTP learning after remote address set to: 192.168.0.1:58751
– PJSIP/6002-00000003 answered PJSIP/6001-00000002
> 0x7f7d30121950 – Strict RTP learning after remote address set to: 192.168.0.1:62519
– Channel PJSIP/6002-00000003 joined ‘simple_bridge’ basic-bridge <383bda25-ee46-4a80-84a6-879a3014a4db>
– Channel PJSIP/6001-00000002 joined ‘simple_bridge’ basic-bridge <383bda25-ee46-4a80-84a6-879a3014a4db>
> Bridge 383bda25-ee46-4a80-84a6-879a3014a4db: switching from simple_bridge technology to native_rtp
> Remotely bridged ‘PJSIP/6001-00000002’ and ‘PJSIP/6002-00000003’ - media will flow directly between them
> 0x7f7d3006a0b0 – Strict RTP learning after remote address set to: 192.168.0.1:58751
– Channel PJSIP/6001-00000002 left ‘native_rtp’ basic-bridge <383bda25-ee46-4a80-84a6-879a3014a4db>
– Channel PJSIP/6002-00000003 left ‘native_rtp’ basic-bridge <383bda25-ee46-4a80-84a6-879a3014a4db>
== Spawn extension (from-internal, 6002, 1) exited non-zero on ‘PJSIP/6001-00000002’

Any help on this will be much appreaciated

Regards

You have not disabled direct media, so Asterisk is telling each side to send media directly to the other. They may or may not tolerate this. Try setting “direct_media” to “no” in the PJSIP endpoints.

Thanks @jcolp that resolved the issue.

I’m wondering if there’s a setting I’ve configured that’s causing this behavior. When I make a call, the audio doesn’t go through unless I press the hold key. After that, both sides can communicate. Can you help me troubleshoot this issue?

If you provide further information, such as the output of “pjsip set logger on” and “rtp set debug on” then someone may provide input.

On Monday 21 October 2024 at 11:50:48, clinton via Asterisk Community wrote:

I’m wondering if there’s a setting I’ve configured that’s causing this
behavior. When I make a call, the audio doesn’t go through unless I press
the hold key. After that, both sides can communicate. Can you help me
troubleshoot this issue?

Please explain your network setup between the caller, Asterisk, and the
callee, paying particular attention to describe where any Network Address
Translation is taking place.

Antony.


Never automate fully anything that does not have a manual override capability.
Never design anything that cannot work under degraded conditions in emergency.

                                               Please reply to the list;
                                                     please *don't* CC me.

i set pjsip set logger on abd rtp set debug on

when i initiate the call this is the

-- PJSIP/6002-00000005 is ringing

<— Transmitting SIP response (503 bytes) to UDP:192.168.0.1:51395 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.0.1:51395;rport=51395;received=192.168.0.1;branch=z9hG4bK-524287-1—239256a6d6a0ffb8
Call-ID: t7C9y1AW4yxUQNtw6kLO-w…
From: sip:6001@192.168.0.109;tag=91330521
To: sip:6002@192.168.0.109;tag=357f1002-a794-45c1-a6f8-2b1bf8fd0e0c
CSeq: 2 INVITE
Server: Asterisk PBX 22.0.0
Contact: sip:192.168.0.109:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Content-Length: 0

<— Received SIP response (967 bytes) from UDP:192.168.0.1:52501 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.109:5060;rport=5060;received=192.168.0.109;branch=z9hG4bKPjca02fd83-5098-42c9-bf62-0646c5c41a84
Call-ID: 07313c62-a04f-4531-bc22-9d6b1606e76d
From: sip:6001@192.168.0.109;tag=53e86360-b4d5-4eae-ad77-409277ae8d44
To: sip:6002@192.168.0.1;ob;tag=3359d3cdfacb4851b64a628c07173d46
CSeq: 23162 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Contact: “6002” sip:6002@192.168.0.1:52501;ob
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length: 315

v=0
o=- 3938504511 3938504512 IN IP4 192.168.0.1
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4022 RTP/AVP 0 101
c=IN IP4 192.168.0.1
b=TIAS:64000
a=rtcp:4023 IN IP4 172.30.30.114
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:2042906160 cname:3fd702f209b103f4

   > 0x7fe064024e30 -- Strict RTP learning after remote address set to: 192.168.0.1:4022

<— Transmitting SIP request (417 bytes) to UDP:192.168.0.1:52501 —>
ACK sip:6002@192.168.0.1:52501;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.0.109:5060;rport;branch=z9hG4bKPj627e2d3d-62db-4a5a-acfb-d36d4b158576
From: sip:6001@192.168.0.109;tag=53e86360-b4d5-4eae-ad77-409277ae8d44
To: sip:6002@192.168.0.1;ob;tag=3359d3cdfacb4851b64a628c07173d46
Call-ID: 07313c62-a04f-4531-bc22-9d6b1606e76d
CSeq: 23162 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 22.0.0
Content-Length: 0

-- PJSIP/6002-00000005 answered PJSIP/6001-00000004
   > 0x7fe06400ffe0 -- Strict RTP learning after remote address set to: 192.168.0.1:59360

<— Transmitting SIP response (809 bytes) to UDP:192.168.0.1:51395 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.1:51395;rport=51395;received=192.168.0.1;branch=z9hG4bK-524287-1—239256a6d6a0ffb8
Call-ID: t7C9y1AW4yxUQNtw6kLO-w…
From: sip:6001@192.168.0.109;tag=91330521
To: sip:6002@192.168.0.109;tag=357f1002-a794-45c1-a6f8-2b1bf8fd0e0c
CSeq: 2 INVITE
Server: Asterisk PBX 22.0.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, INFO, MESSAGE, REFER
Contact: sip:192.168.0.109:5060
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 229

v=0
o=- 0 123849572 IN IP4 192.168.0.109
s=Asterisk
c=IN IP4 192.168.0.109
t=0 0
m=audio 18634 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:140
a=sendrecv

-- Channel PJSIP/6002-00000005 joined 'simple_bridge' basic-bridge <6ef9e8d6-9dbc-42ef-ba0a-158c4a47f395>
-- Channel PJSIP/6001-00000004 joined 'simple_bridge' basic-bridge <6ef9e8d6-9dbc-42ef-ba0a-158c4a47f395>
   > Bridge 6ef9e8d6-9dbc-42ef-ba0a-158c4a47f395: switching from simple_bridge technology to native_rtp
   > Locally RTP bridged 'PJSIP/6001-00000004' and 'PJSIP/6002-00000005' in stack

<— Received SIP request (410 bytes) from UDP:192.168.0.1:51395 —>
ACK sip:192.168.0.109:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.1:51395;branch=z9hG4bK-524287-1—c32d8978470dd4d0;rport
Max-Forwards: 70
Contact: sip:6001@192.168.0.1:51395;transport=UDP
To: sip:6002@192.168.0.109;tag=357f1002-a794-45c1-a6f8-2b1bf8fd0e0c
From: sip:6001@192.168.0.109;tag=91330521
Call-ID: t7C9y1AW4yxUQNtw6kLO-w…
CSeq: 2 ACK
User-Agent: Zoiper v2.10.20.4_1
Content-Length: 0

----When I press Hold and after i notice this

Got RTP packet from 192.168.0.1:58007 (type 00, seq 022344, ts 4162381343, len 000160)
Sent RTP P2P packet to 192.168.0.1:4028 (type 00, len 000160)
Got RTP packet from 192.168.0.1:4028 (type 00, seq 030720, ts 181120, len 000160)
Sent RTP P2P packet to 192.168.0.1:58007 (type 00, len 000160)
Got RTP packet from 192.168.0.1:58007 (type 00, seq 022345, ts 4162381503, len 000160)

I have not set uo any NAT configuration as i am accessing the ip server directly and as for the zoiper clients i have registered by specifing the ip server .

Hello Team, I have observed while the call is ongoing without any voice being exchnaged

the /var/log/asterisk/messages.log emits

res_pjsip/pjsip_distributor.c: Request ‘REGISTER’ from ‘sip:6001@ipaddress’ failed for ‘ipaddress:55921’ (callid: 2Yom7ZyACGx5ihH33yIibQ…) - Failed to authenticate

There is no team; we are all individual volunteers.

Based on the information provided, the most likely reason is that ipaddress is that of a hacker, and the guessed your password wrong.

@david551 , I was asking in relation to the fact that when i make a call and I answer there is no voice being exchanged unless i press the hold key first it plays some music and the call off hold when i unhold the voice is now being exchanged .

If you set the “rtp_keepalive” option to “1” on the endpoints, does that change things? If so - that would mean that there is some kind of NAT/firewall in use which is requiring Asterisk to send media in order to allow media to be received from outside SIP clients.

Thanks @jcolp , it had to do with rtp port not allowing traffic in and out

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