Anyone knows why I keep getting following error message?
Aug 2 13:10:26 localhost openser[30695]: ERROR:
extract_body: message body has length zero
Aug 2 13:10:26 localhost openser[30695]: ERROR:
force_rtp_proxy2: can't extract body from the message
I turn on nathelper, and saw from the following source
code:
int extract_body(struct sip_msg *msg, str *body )
{
body->s =
get_body(msg);
if
(body->s==0) {
LOG(L_ERR, "ERROR: extract_body: failed to get the message body\n");
goto error;
}
body->len =
msg->len -(int)(body->s-msg->buf);
if
(body->len==0) {
LOG(L_ERR, "ERROR: extract_body: message body has length zero\n");
goto error;
}
Why do we care about the content-length, which normally is 0
for most of the SIP UAs? Following is an example SIP UA
Registration and you can see “Content-Length: 0” in the bottom:
Session Initiation Protocol
Request-Line: REGISTER
sip:sip.mycompany.com SIP/2.0
Method: REGISTER
Resent Packet:
True
Suspected resend
of frame: 62339
Message Header
Via: SIP/2.0/UDP
192.168.254.6:5062;branch=z9hG4bK0997e90280d2f8e5
From: "Bill
Office Phone" <sip:8001@sip.mycompany.com>;tag=ec200436c1169e42
SIP Display info: "Bill Office Phone"
SIP from address: sip:8001@sip.mycompany.com
SIP tag: ec200436c1169e42
To:
<sip:8001@sip.mycompany.com>
SIP to address: sip:8001@sip.mycompany.com
Contact:
<sip:8001@192.168.254.6:5062>
Call-ID: 5a2ae3a1b883568f@192.168.254.6
CSeq: 20113
REGISTER
Expires: 120
User-Agent: ABC
1.0.0.0
Max-Forwards: 70
Allow:
INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Content-Length: 0
Thanks in advance.
Best Regards,
Bill Zhang