Refer / Reinvite Question

I’m setting up 2 peers in sip.conf, Peer 1 (Carrier) and Peer 2 (Down stream PBX). The scenario is the following:

  1. A call comes in via Peer 1, drops to a context that sends the call to Peer 2.
  2. Peer 2 answers, then decides to transfer the call to a different number on the pstn using refer to.
  3. The refer message comes back in to asterisk via the Peer 2 definition and we send a new invite out to the PSTN via Peer 1.

The goal is the following:

Once the second call is answered, I want asterisk to send 2 reinvites to peer 1 telling the first leg of the call and the second leg to point to each other’s SDP IP for media cut through, taking Asterisk out of the media path of the 2 calls.

My peer definitions are as follows:

(Carrier)
[Peer 1]
type=peer
host=x.x.x.x
context=to_peer2
disallow=all
allow=g729,ulaw
dtmfmode=rfc2833
canreinvite=yes
insecure=port,invite

(Downstream PBX)
[Peer 2]
type=peer
host=x.x.x.x
context=to_peer1
disallow=all
allow=g729,ulaw
dtmfmode=rfc2833
canreinvite=no
insecure=port,invite

Do I need to have Peer 1 and Peer 2 set to canreinvite = yes? or just Peer 1? I don’t want peer 1 bypassing Asterisk and re-inviting to peer 2 during the first part of the call setup. I only want the reinvite to come from asterisk to the incoming call leg from the PSTN and the outbound call leg to the PSTN to have them send media between the 2 PSTN peers.

This is version dependent, as canreinvite has been renamed.

There should not be any need to allow re-invites on anything except peer 1, although I cannot rule out bugs in this area.

Note that peer 1 is not obliged to accept the re-invite.

This is Asterisk 1.4.27

I was thinking of moving to a 1.6 or 1.8 branch but am trying to determine the benefit of doing so. If I do that, you’re saying that canreinvite has been changed to something else?

If so can you advise which version this has changed and what the new parameter is?

That aside, does what I have look right for achieving the goal of taking asterisk out of the media path?

1.6 will very soon be on security fixes only.

canreinvite has been renamed to reflect that it is about sending media directly. You will need to look at the sample sip.conf to work out the exact name used. There are other reinvites that it does not control.

Yeah it looks like the new syntax is directmedia = yes/no

On a second note I loaded up 1.8.2.3 on my back up server and noticed that with the out of the box config it’s taking about 35% of the available ram as compared to 2% on the box running the 1.4 code.

Is there a memory leak in 1.8.2.3?