How to disable direct_media_glare_mitigation


#1

Hello,

I want to disable direct_media_glare_mitigation=none

even if direct_media_glare_mitigation=none is setted , asterisk still sends re-invite with sdp to incoming direction after getting 200 OK-ACK

direct_media_glare_mitigation
This setting attempts to avoid creating INVITE glare scenarios by disabling direct media 
reINVITEs in one direction thereby allowing designated servers (according to this option) to
 initiate direct media reINVITEs without contention and significantly reducing call setup time.

A more detailed description of how this option functions can be found on the Asterisk wiki https://wiki.asterisk.org/wiki/display/AST/SIP+Direct+Media+Reinvite+Glare+Avoidance

none
outgoing
incoming

direct_media_method
Method for setting up Direct Media between endpoints.

invite
reinvite - Alias for the invite value.
update

LINK direct_media_glare_mitigation

direct_media_glare_mitigation

Version

Asterisk 16.1.1

ENDPOINT CONFIG

[as]
type=endpoint
transport=transport-tcpipv6
context=default1
aors=as
dtmf_mode=rfc4733
identify_by=ip,username
rewrite_contact=no
direct_media=yes
direct_media_glare_mitigation=none
disallow=all
allow=ulaw
allow=alaw
contact_user=as
force_rport=no
ice_support=no

pjsip show endpoint

 direct_media                       : true
 direct_media_glare_mitigation      : none
 direct_media_method                : invite
 disable_direct_media_on_nat        : false


#2

What do you precisely want to happen?


#3

Hello,

Dont send Re-INVITE or Update both side . I think none means that both side ? :roll_eyes:

I guess that you will say Asterisk adds own codecs in SDP so A-leg doesnt know anything about updated codec list.

after i tested Asterisk ;

none = sends Re-INVITE/Update both side (A-leg and B-leg)
outgoing = sends re-Invite (B-leg)
incoming = sends re-Invite (A-leg)

#4

You are configuring the mitigation strategy, “none” disables that strategy. If you want to disable direct media then you use the “direct_media” option and Asterisk won’t send out a reinvite to either side to directly send the media.


#5

Hello,
I want direct_media=yes but dont like mitigation so try to disable mitigation.

Thanks


#6

“none” disables it. The glare mitigation strategy is to stop a re-invite from going out in a specific direction. Disabling it from both directions would be the same as doing “direct_media=no”.


#7

probably there is a problem my configuration . I will test more then solve it .

Thanks for information.


#8

Hello @jcolp

I tested various of configuration.

fd61:c23c:b3b6::1a => Asterisk IP6
fd61:c23c:b3b6::10 => SIPUA
fd61:c23c:b3b6::2 => Client
192.168.1.16 => is interface for Ubuntu -18 that isnt defined

version : Asterisk GIT-16-e8eb659afaM built by root

Client —> Asterisk -----> SIPUA

It is static line

[global]
max_forwards=70
type=global
user_agent=Asterisk 16
endpoint_identifier_order=ip,username,anonymous

[transport-tcp]
type=transport
protocol=tcp
bind=[fd61:c23c:b3b6::1a]:5060

[system]
threadpool_idle_timeout=240
threadpool_auto_increment=50
threadpool_initial_size=600
type=system

suffix V2 pcap and configuration

[sipuas]
type=endpoint
transport=transport-tcp
context=defaultc
;disallow=all
;allow=alaw
;allow=ulaw
allow=all
aors=sipuas,ali
dtmf_mode=rfc4733
identify_by=ip
rewrite_contact=no
direct_media=yes
direct_media_glare_mitigation=outgoing

[sipuas]
type=aor
contact=sip:[fd61:c23c:b3b6::10]:5060
authenticate_qualify=no

[sipuas]
type=identify
endpoint=sipuas
match=fd61:c23c:b3b6::2

[ali]
type=aor
contact=sip:[fd61:c23c:b3b6::2]:5060
authenticate_qualify=no
max_contacts=35

File: allow-all-ali-sipp-wrong-sdp-con-v2

Wrong -1, O line

Re-invite sdp body

o=- 0 3 IN IP4 192.168.1.16
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::10

Wrong -2 ,200 OK sdp body , connection line must be targets IP address

o=- 0 2 IN IP6 fd61:c23c:b3b6::1a
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::1a

suffix V2 pcap and configuration
--------------V3 ----------------

[sipuas]
type=endpoint
transport=transport-tcp
context=defaultc
disallow=all ; Changed Lines
allow=alaw   ; Changed Lines
allow=ulaw   ; Changed Lines
;allow=all   ; Changed Lines
aors=sipuas,ali
dtmf_mode=rfc4733
identify_by=ip
rewrite_contact=no
direct_media=yes
direct_media_glare_mitigation=outgoing

[sipuas]
type=aor
contact=sip:[fd61:c23c:b3b6::10]:5060
authenticate_qualify=no

[sipuas]
type=identify
endpoint=sipuas
match=fd61:c23c:b3b6::2

[ali]
type=aor
contact=sip:[fd61:c23c:b3b6::2]:5060
authenticate_qualify=no
max_contacts=35

File : disallow-all-wrong-sdp-c-V3.pcap

Wrong -1 Ack’s SDP for B side

o=- 53655765 2353687639 IN IP6 fd61:c23c:b3b6::1a
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::1a

Wrong -2 200 OK’s SDP for A side

o=- 0 2 IN IP6 fd61:c23c:b3b6::1a
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::1a

Same Configuration after restart Asterisk

File : after-restart-Failed-V4

Wrong -1 - B side SDP c line

=0
o=- 53655765 2353687639 IN IP6 fd61:c23c:b3b6::1a
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::1a

Wrong -2 - A side 200 OK Sdp c lines

v=0
o=- 0 2 IN IP6 fd61:c23c:b3b6::1a
s=Asterisk
c=IN IP6 fd61:c23c:b3b6::1a

V3 pcap
V2 pcap
V4 pcap


#9

If it is necessary to open an issue about direct media problem , please inform me

Thanks for your support


#10

IPv6 is not honestly something we test for with direct media and it’s likely noone has ever touched or confirmed before. If it’s not working then yes an issue should be open, but as always there is no time frame on when it would get looked into - in particular in this case because you’re likely the only one touching it.


#11

I will open an issue as soon as possible , maybe , if it is possible i can contribute for this issue.


#12

Opened issue on tracker . same behavior when it is IPv4.

Issue