About "canreinvite" option

First, let’s see if I understand the ‘canreinvite’ option properly.

As I understand it, the 2 SIP phones send text messages to each other through the Asterisk (or other) SIP server during call progress.

Then, for efficiency’s sake, when the RTP phase comes, they say to each other (who says to whom?): “let’s start talking codec directly, without using the SIP server as intermediary”.

Is that correct?

Second: is the ‘canreinvite’ option mandatory to the phones?

If Asterisk tells them: “you can reinvite”, does it mean: “you MUST reinvite”.

TIA,

-RFH

[quote=“Telephony”]As I understand it, the 2 SIP phones send text messages to each other through the Asterisk (or other) SIP server during call progress.

Then, for efficiency’s sake, when the RTP phase comes, they say to each other (who says to whom?): “let’s start talking codec directly, without using the SIP server as intermediary”.

Is that correct?[/quote]
More or less - except the phones don’t “send […] messages to each other”, they send them to Asterisk. It would be slightly more accurate to describe it in the following way:[ol]
[li] The phones swap SIP messages with Asterisk to initiate the session (Session Initiation Protocol). Part of this session initiation transaction is setting up the RTP (RealTime Protocol) media path - this includes setting up IP address and port combinations for the endpoints.
[/li]
[li]Then the RTP connections are initiated. If both phones support the ‘canreinvite’ option, they setup direct RTP connections with each other, if they can’t they set up RTP connections with Asterisk, which bridges the two channels, translating the encoding if necessary.[/li][/ol]

[quote]Second: is the ‘canreinvite’ option mandatory to the phones?

If Asterisk tells them: “you can reinvite”, does it mean: “you MUST reinvite”.[/quote]

That’s not how it works. Asterisk can’t tell them “you can reinvite” - rather, they tell Asterisk “i can reinvite”. After all, only the phone can know if it can reinvite or not - Asterisk can’t know that. Issues that determine whether you can reinvite or not are things like firewall access - if you’re behind a restrictive firewall, it may simply not be possible to do a direct connection with something on the other side of the firewall.

I guess the “canreinvite” option in sip.conf is what’s confusing you. I’m not sure i’ve got all aspects of this completely clear in my head, but as basically it’s saying whether or not Asterisk can reinvite over this connection. Of course this doesn’t make any sense when the configuration relates to a phone - but if the configuration relates to another server it does.

Well, I guess I have to read the RFCs and capture some packets with Ethereal.

I am getting a clearer picture, though.

Thx!

-Ramon

[quote=“WillKemp”]

Asterisk can’t tell them “you can reinvite” - rather, they tell Asterisk “i can reinvite”. After all, only the phone can know if it can reinvite or not - Asterisk can’t know that. Issues that determine whether you can reinvite or not are things like firewall access - if you’re behind a restrictive firewall, it may simply not be possible to do a direct connection with something on the other side of the firewall.

I guess the “canreinvite” option in sip.conf is what’s confusing you. I’m not sure i’ve got all aspects of this completely clear in my head, but as basically it’s saying whether or not Asterisk can reinvite over this connection. Of course this doesn’t make any sense when the configuration relates to a phone - but if the configuration relates to another server it does.[/quote]

It seems to me that the “canreinvite” option gives the Asterisk the last work: he has veto power over the SIP phones.

Even if telephone A says “I can reinvite” and telephone B says “I can reinvite” Asterisks still looks at the “canreinvite” option and if it is a “no”, Asterisks will say to both phones separately “I am sorry, but the other phone says he cannot reinvite”. (damn lier :smile:)

I think that’s the way it should be, because at the end, the party that knows better is the Asterisk administrator.

-Ramon

Yeah, that makes sense.

Apart from anything else, i can envision a situation where there are several SIP phones in a local network, inside a firewall, with an Asterisk server at the gateway and maybe an ITSP outside the firewall. All the SIP phones and the ITSP’s server are configured to reinvite. Allowing reinvites within the LAN is definintely a good idea, as it reduces bandwidth used on internal calls. But reinvites between an internal phone and the ITSP’s server is just not possible, because of the firewall, so asterisk says “no”.