Hi,
I have the following trunk in my sip.conf file and reinvite is still hapenning between our SIP gateway and the phone even though canreinvite=no. Directmedia = yes in my realtime database because I want peer to peer to be working between our ip phones.
I know it can be done because the same setup works in FreePBX.
I’m running Asterisk 12.1.1 connected to a SIP to ISDN gateway.
NEC PBX <---------> SIP gateway <----------> Asterisk
[PBXTrunk2]
type=peer
secret=mypass
port=5061
qualify=yes
host=xxx.xxx.xxx.xxx
dtmfmode=info
context=FROM_NEC_PBX
directmedia=no
canreinvite=no
directrtpsetup=no
Any help will be greatly appreciated.
Re-invites are also used for connected line presentation updates. That can be disabled by turning off sendrpid.
Note that directmedia is the new name for canreinvite so should be set to “no”.
I have set sendrpid=no in the trunk and it’s still not working.
Is there anything else I could do to disable directmedia?
Maybe you are not using “trunk”. Make sure that allowguest is explicitly set to no and resolve any errors that result.
Here is my full sip.conf file as well as part of my extensions.cfg.
My internal context is in the database.
As you can see allowguess=0
[general]
context=internal
allowguest=no
port = 5060
srvlookup=no
bindaddr = 0.0.0.0
tcpenable=yes
disallow=all
allow=ulaw
vmexten=*97
language=fr
rtupdate=yes
mwi_from=asterisk
rtcachefriends=yes
limitonpeers = yes
callcounter=yes
allowsubscribe=yes
type=friend
host=dynamic
deny=0.0.0.0/0.0.0.0
permit=0.0.0.0/0.0.0.0
trustrpid=yes
sendrpid=no
nat=no
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
icesupport=no
encryption=no
faxdetect=no
cc_monitor_policy=generic
directmedia=no
canreinvite=no
;------------TRUNK---------------
[PBXTrunk]
type=peer
secret=mysecret
port=5060
qualify=yes
host=xxx.xxx.xxx.xxx
dtmfmode=info
context=FROM_NEC_PBX
directmedia=no
directrtpsetup=no
sendrpid=no
[PBXTrunk2]
type=peer
secret=mysecret
port=5061
qualify=yes
host=xxx.xxx.xxx.xxx
dtmfmode=info
directmedia=no
context=FROM_NEC_PBX
directrtpsetup=no
directmediadeny=yes
sendrpid=no
Here is part of my extensions.conf file:
[TO_NEC_PBX]
exten => _[4-6]XXX,1,Dial(SIP/${EXTEN}@PBXTrunk2,40)
What is your evidence that it is re-inviting out the media path? I suspect we need to see the actual SDP and the comments in the associated SIP.
You appear to have the right options to prevent that.
Re-invite is used for other purposes. sendrpid=no prevents one, but they are also used for session timers.
My evidence is wireshark connected to my ip phone with port mirroring and I have set
rtp set debug on in the asterisk console and no rtp stream is visible. If I set directmedia=no in my sip users database , only then asterisk is in the media path because I can see RTP packets in the console window. Can I disable session timers in my trunk?
This is now sounding like conflicting settings coming from different configuration sources. You need to show all your configurations sources, not just sip.conf. I have never used ARA, so I can’t help with the details of that.
I would note, again, that you said directmedia=yes, in your original question, even though you said canreinivite=no.
Re-invites for session timers will not introduce direct media. The reason you might want to disable them are that some peers handle them badly, or ignore them without rejecting them. You can, however, set session timers to refuse.
Just to be clear about my original question, directmedia=yes in my database for users but directmedia=no for the sip trunk in the static file. I will set session timers to refuse on monday and let you know how it goes.
sendrpid and session timers shouldn’t cause external bridging.
I think you need to provide the output of sip show peer xxxxx and see what configuration is actually being used.
Here you go:
Name/username Host Dyn Forcerport Comedia ACL Port Status Realtime
A002501-01-A-70CA9B9F44B4 XX.XXX.X.XXX D No No A 5060 OK (8 ms) Cached RT
A002501-01-A-A4934CFDF1BC XX.XXX.X.XXX D No No A 5060 OK (9 ms) Cached RT
PBXTrunk XXX.XXX.XXX.XX No No 5060 OK (6 ms)
PBXTrunk2 XXX.XXX.XXX.XX No No 5061 OK (6 ms)
Certainly seems to have direct media disabled, although I’m not familiar with directmediaacl. Maybe that has priority over directmedia=no?
Indeed, I saw that too, I will disable it and see what happen.
Disabling directmediaacl did not help… I had to go back to version 11 to make it work.
It could be a version 12 bug…