A UAC MUST insert a Max-Forwards header field into each request it
originates with a value that SHOULD be 70.
Some SIP clients, like Linphone, mandates that Max-Forwards header is
present in ACK request packet. If not then they reject ACK packet with
400 Bad request packet.
With Linphone this is a big issue as Net::SIP currently is not able to
establish a SIP call because Linphone send 400 Bad request packet on the
final Net::SIP's ACK.
So add Max-Forwards header for ACK and CANCEL requests to be compliant with
RFC3261. With this change is also Linphone happy and accepts calls from
Net::SIP without any 400 Bad request error anymore.
RFC3261 in section 8.1.1.6 Max-Forwards says:
Some SIP clients, like Linphone, mandates that Max-Forwards header is present in ACK request packet. If not then they reject ACK packet with 400 Bad request packet.
With Linphone this is a big issue as Net::SIP currently is not able to establish a SIP call because Linphone send 400 Bad request packet on the final Net::SIP's ACK.
Linphone log of this issue:
So add Max-Forwards header for ACK and CANCEL requests to be compliant with RFC3261. With this change is also Linphone happy and accepts calls from Net::SIP without any 400 Bad request error anymore.