Bug#691261: Phone PBX rejects refresh registration because of incorrect "expires" field in Contact header
Ramón García Fernández
ramong at cnmv.es
Tue Oct 23 16:18:02 UTC 2012
Package: libopal3.10.4
Version: 3.10.4~dfsg-3
Hello,
We are using t38modem from Debian testing for sending and receiving faxes. We found that our PBX rejects SIP REGISTER refreshes, it complains that the Expires field is too short. The reason is that the header has two contradictory Expires values. One in the Expires header that is correct, and another in the expires field in the Contact header.
Here is the SIP traffic. I am replacing the IP addresses. our_pbx_ip is the IP of the SIP PBX, and our_fax_sever_ip is the IP of the machine with Debian GNU Linux and t38modem.
REGISTER sip:our_pbx_ip SIP/2.0
Route: <sip: :our_pbx_ip:5060;lr>
CSeq: 3 REGISTER
Via: SIP/2.0/UDP our_fax_server_ip:5060;branch=z9hG4bK92bf38f5-8e17-e211-9b43-001a4bc9fa1e;rport
User-Agent: T38Modem/2.0.0
From: <sip:34915854997@:our_pbx_ip >;tag=ea874e9c-8e17-e211-9b43-001a4bc9fa1e
Call-ID: c07a4e9c-8e17-e211-9b43-001a4bc9fa1e at elhuyar1
Organization: Vyacheslav Frolov
To: <sip:34915854997@:our_pbx_ip >
Contact: <sip:34915854997 at our_fax_server_ip:5060>;audio;expires=298
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING,PRACK
Expires: 300
Content-Length: 0
Max-Forwards: 70
SIP/2.0 423 Interval Too Brief
CSeq: 3 REGISTER
Via: SIP/2.0/UDP our_fax_server_ip:5060;branch=z9hG4bK92bf38f5-8e17-e211-9b43-001a4bc9fa1e;rport
From: <sip:34915854997 at our_pbx_ip>;tag=ea874e9c-8e17-e211-9b43-001a4bc9fa1e
Call-ID: c07a4e9c-8e17-e211-9b43-001a4bc9fa1e at elhuyar1
Min-Expires: 300
To: <sip:34915854997 at our_pbx_ip>
Warning: 399 our_pbx_ip "Registration received contact header with Expire value that less than allowed value = 300."
Content-Length: 0
Note the request has a contraction in the SIP request: expires=298 in the Contact header in Expires: 300
The patch bellow fixes the problem for us. The change that it makes is, when a SIP request contains Contact headers that contain expire values, and those values are less than the values of Expires: header, the former are fixed. I think that it is a conservative patch. Please forward it to the upstream maintainers. I think that opal 3.10.8 still has the same issue.
Best regards.
--- opal-3.10.4~dfsg.orig/src/sip/handlers.cxx
+++ opal-3.10.4~dfsg/src/sip/handlers.cxx
@@ -699,8 +699,17 @@ SIPTransaction * SIPRegisterHandler::Cre
}
}
}
- else
+ else {
+ for (SIPURLList::iterator contact = m_contactAddresses.begin(); contact != m_contactAddresses.end(); ++contact) {
+ if (contact->GetFieldParameters().Has("expires")) {
+ int stored_expire = contact->GetFieldParameters().GetInteger("expires", 0);
+ if (stored_expire < GetExpire()) {
+ contact->GetFieldParameters().SetInteger("expires", GetExpire());
+ }
+ }
+ }
params.m_contactAddress = m_contactAddresses.ToString();
+ }
}
}
Aviso legal – Comisión Nacional del Mercado de Valores
Este mensaje y, en su caso, los ficheros que lleve incorporados, está dirigido exclusivamente a su destinatario y es de carácter confidencial. Si fuere recibido por error o se tuviere conocimiento del mismo sin ser su destinatario, rogamos nos lo comunique por la misma vía o telefónicamente (91 585 15 00) y proceda a su destrucción, debiendo abstenerse de utilizar, transmitir, divulgar o reproducir la información contenida en el mismo. La CNMV se reserva las acciones legales que procedan contra todo tercero que acceda de forma ilegítima al contenido de cualquier mensaje externo procedente de la entidad
Para información y consultas visite nuestra web: http://www.cnmv.es
Disclaimer - Comisión Nacional del Mercado de Valores
This message, its content and any file attached thereto is for the intended recipient only and is confidential. If you have received this e-mail in error or had access to it, you should note that the information in it is private and any use thereof is unauthorised. In such an event please notify us by e-mail or by telephone (+ 34 91 585 15 00). Any reproduction of this e-mail by whatsoever means and any transmission or dissemination thereof to other persons is prohibited. The Comisión Nacional del Mercado de Valores reserves the right to take legal action against any persons unlawfully gaining access to the content of any external message it has emitted
For additional information, please visit our website: http://www.cnmv.es
More information about the Pkg-voip-maintainers
mailing list