Asterisk 20.4 sends two INVITES in an one call

Hi Asterisk Team,

I’ve configured two PJSIP extensions, and they call between them without problems. But, I see on the Flow SIP, Asterisk send a INVITE to endpoint B with contact IP Asterisk, later, send another INVITE with contact IP endpoint A to endpoint B. And, the flow RTP seems wrong.

Please, any advice to amend it? I don’t think it is a correct process in PJSIP.

Regards,
Mauro

Please proved a description of your network, in particular the role of 192.168.1.30, your dialplan, the pjsip set logger on output for both sides, and your pjsip.conf, redacted for passwords. As all the addresses are private, I see no need to redact addresses. Please confirm that SIP ALG has been disabled in routers.

Something strange is happening, but there is insufficient information to understand what. The main strange thing is that the exact same destination URI appears on both sides, although that is not impossible. Asterisk a a back to back user agent, so generally completely rewrites the request URI.

As @david551 has written, there is a lack of information about Your network. But I would guess, media is directed to flow between the endpoints. This is controlled by the directive “drectmedia” in the endpoint section.

Set

directmedia = no

in the endpoint sections and check if this helps.

HTH
Karsten

Hi @david551,

The network is a domestic network, Asterisk (192.168.1.45) is on a virtual machine, MicroSIP (192.168.1.39) and Yealink (192.168.1.30).

pjsip.conf:
type=transport
protocol=udp
bind=0.0.0.0:5060
[transport-udp-alternative]
type=transport
protocol=udp
bind=0.0.0.0:5080

[301]
type=endpoint
transport=transport-udp-main
context=from-internal
disallow=all
allow=ulaw
aors=301
auth=301
[301]
type=auth
auth_type=userpass
username=301
password=xxxxxxx
[301]
type=aor
max_contacts=2

[302]
type=endpoint
transport=transport-udp-main
context=from-internal
disallow=all
allow=ulaw
aors=302
auth=302
[302]
type=auth
auth_type=userpass
username=302
password=xxxxxxx
[302]
type=aor
max_contacts=2

dialplan:
[from-internal]
exten=>301,1,Dial(PJSIP/301)
exten=>302,1,Dial(PJSIP/302)

Regards,
Mauro

Hi @mauro19,

all components (phones and asterisk) are on the same network and you do not have a
directmedia statement in the endpoint sections.
After both phones are connected, asterisk sends INVITE requests to the phones. The SDP in this INVITES directs media directly from phone to phone. If You do not want this behavior put

directmedia = no

in the endpoint sections.

Have a nice day
Karsten

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