Dropped call due to SIP 400

I received this message on the console after a call had been dropped. I searched on google as well as in this forum and no hits returned for “Got SIP response 400 “Missing, Erroneous or Multiple Contact header field(s)” back from” or “Got SIP response 400 Missing, Erroneous”.

anyone have some thoughts as to what may have been the root cause of this?

— Got SIP response 400 “Missing, Erroneous or Multiple Contact header field(s)” back from

Thanks for your input,

Rick

First thing I would do is sniff network traffic using wireshark and have a look exactly what is going on with SIP traffic.

Just a thought…

e[Krnvoice1*CLI>
– Got SIP response 400 “Missing, Erroneous or Multiple Contact header field(s)” back from [SIP_INTERNAL_IP]

e[Krnvoice1*CLI>
Scheduling destruction of SIP dialog ‘1395de6e3a7cea734acd14872cf40939@sip.[SIP_PROVIDER].com’ in 32000 ms (Method: INVITE)
set_destination: Parsing sip:IP_ADDRESS_1;lr for address/port to send to
set_destination: set destination to IP_ADDRESS_1], port 5060
Reliably Transmitting (no NAT) to [IP_ADDRESS_1]:5060:
BYE sip:[DIALED_NUMBER]@[IP_ADDRESS_2]:5060;transport=udp SIP/2.0

Via: SIP/2.0/UDP [ASTERISK_INTERNAL_IP]:5060;branch=z9hG4bK4b14143d;rport

Route: sip:IP_ADDRESS_1;lr,sip:IP_ADDRESS_3;lr

Max-Forwards: 70

From: “RNSupport” sip:[CALLER_ID_NUM]@sip.[SIP_PROVIDER].com;tag=as194b0eee

To: sip:1[DIALED_NUMBER]@sip.[SIP_PROVIDER].com;tag=14c031a8+1+c5a5002a+1e98ac16

Call-ID: 1395de6e3a7cea734acd14872cf40939@sip.[SIP_PROVIDER].com

CSeq: 104 BYE

User-Agent: Asterisk PBX 1.6.2.7

Proxy-Authorization: Digest username="[SIP_CREDENTIALS]", realm=“sip.[SIP_PROVIDER].com”, algorithm=MD5, uri=“sip:[DIALED_NUMBER]@[IP_ADDRESS_2]:5060”, nonce=“4bf6ae0c0000b99b904c7d925d7d4ab858042d5a66b1262b”, response=“dac90421550f084d8042adf6c2f7753f”, qop=auth, cnonce=“5a597239”, nc=00000002

X-Asterisk-HangupCause: Normal Clearing

X-Asterisk-HangupCauseCode: 16

Content-Length: 0

– Got SIP response 400 “Missing, Erroneous or Multiple Contact header field(s)” back from

Still dropping calls after 15 minutes due to the above error. Does anyone have any insight into the possible issue? I have done some searching, but have not found many hits.

Version Information:

Asterisk 1.6.2.7 built by root @ on a x86_64 running Linux on 2010-05-19 19:16:19 UTC

Your SIP trace starts just AFTER the important bit! You need to show the actual content of the 400 Response and the actual content of what it was objecting to.

how about this?


<--- SIP read from UDP:[IP_ADDRESS_1]:5060 --->
OPTIONS sip:[ASTERISK_INTERNAL_IP]:5060 SIP/2.0

Max-Forwards: 10

Record-Route: <sip:[IP_ADDRESS_1];lr>

Via: SIP/2.0/UDP [IP_ADDRESS_1];branch=z9hG4bK7c9a.52118838ecf70e7a544525c6651ceca6.0

Via: SIP/2.0/UDP [IP_ADDRESS_2]:5060;branch=0

Route: <sip:[IP_ADDRESS_1];lr;received="sip:[ASTERISK_INTERNAL_IP]:5060">

From: sip:ping@invalid;tag=e0203e25

To: sip:[ASTERISK_INTERNAL_IP]:5060

Call-ID: cd951952-c9478117-a2843@[IP_ADDRESS_2]

CSeq: 1 OPTIONS

Content-Length: 0




<------------->

e[Krnvoice1*CLI> 
--- (11 headers 0 lines) ---

e[Krnvoice1*CLI> 
Looking for s in from-sip (domain [ASTERISK_INTERNAL_IP])

e[Krnvoice1*CLI> 

<--- Transmitting (no NAT) to [IP_ADDRESS_1]:5060 --->
SIP/2.0 200 OK

Via: SIP/2.0/UDP [IP_ADDRESS_1];branch=z9hG4bK7c9a.52118838ecf70e7a544525c6651ceca6.0;received=[IP_ADDRESS_1]

Via: SIP/2.0/UDP [IP_ADDRESS_2]:5060;branch=0

Record-Route: <sip:[IP_ADDRESS_1];lr>

From: sip:ping@invalid;tag=e0203e25

To: sip:[ASTERISK_INTERNAL_IP]:5060;tag=as4125aadd

Call-ID: cd951952-c9478117-a2843@[IP_ADDRESS_2]

CSeq: 1 OPTIONS

Server: Asterisk PBX 1.6.2.7

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO

Supported: replaces, timer

Contact: <sip:[ASTERISK_INTERNAL_IP]>

Accept: application/sdp

Content-Length: 0




<------------>

e[Krnvoice1*CLI> 
Scheduling destruction of SIP dialog 'cd951952-c9478117-a2843@[IP_ADDRESS_2]' in 32000 ms (Method: OPTIONS)

e[Krnvoice1*CLI> 

<--- SIP read from UDP:[IP_ADDRESS_1]:5060 --->
OPTIONS sip:[ASTERISK_INTERNAL_IP]:5060 SIP/2.0

Max-Forwards: 10

Record-Route: <sip:[IP_ADDRESS_1];lr>

Via: SIP/2.0/UDP [IP_ADDRESS_1];branch=z9hG4bKb0d4.49a529786b76efa58b593f95b6e360de.0

Via: SIP/2.0/UDP [IP_ADDRESS_3]:5060;branch=0

Route: <sip:[IP_ADDRESS_1];lr;received="sip:[ASTERISK_INTERNAL_IP]:5060">

From: sip:ping@invalid;tag=7466bd92

To: sip:[ASTERISK_INTERNAL_IP]:5060

Call-ID: bf6db09-4a40f736-1bb43@[IP_ADDRESS_3]

CSeq: 1 OPTIONS

Content-Length: 0




<------------->

e[Krnvoice1*CLI> 
--- (11 headers 0 lines) ---

e[Krnvoice1*CLI> 
Looking for s in from-sip (domain [ASTERISK_INTERNAL_IP])

e[Krnvoice1*CLI> 

<--- Transmitting (no NAT) to [IP_ADDRESS_1]:5060 --->
SIP/2.0 200 OK

Via: SIP/2.0/UDP [IP_ADDRESS_1];branch=z9hG4bKb0d4.49a529786b76efa58b593f95b6e360de.0;received=[IP_ADDRESS_1]

Via: SIP/2.0/UDP [IP_ADDRESS_3]:5060;branch=0

Record-Route: <sip:[IP_ADDRESS_1];lr>

From: sip:ping@invalid;tag=7466bd92

To: sip:[ASTERISK_INTERNAL_IP]:5060;tag=as123083b9

Call-ID: bf6db09-4a40f736-1bb43@[IP_ADDRESS_3]

CSeq: 1 OPTIONS

Server: Asterisk PBX 1.6.2.7

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO

Supported: replaces, timer

Contact: <sip:[ASTERISK_INTERNAL_IP]>

Accept: application/sdp

Content-Length: 0




<------------>
Scheduling destruction of SIP dialog 'bf6db09-4a40f736-1bb43@[IP_ADDRESS_3]' in 32000 ms (Method: OPTIONS)

e[Krnvoice1*CLI> 
    -- Got SIP response 400 "Missing, Erroneous or Multiple Contact header field(s)" back from [SIP_PHONE_IP]

e[Krnvoice1*CLI> 
Scheduling destruction of SIP dialog '1395de6e3a7cea734acd14872cf40939@sip.[SIP_PROVIDER].com' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:[IP_ADDRESS_1];lr> for address/port to send to
set_destination: set destination to [IP_ADDRESS_1], port 5060
Reliably Transmitting (no NAT) to [IP_ADDRESS_1]:5060:
BYE sip:[DIALED_NUMBER]@[IP_ADDRESS_4]:5060;transport=udp SIP/2.0

Via: SIP/2.0/UDP [ASTERISK_INTERNAL_IP]:5060;branch=z9hG4bK4b14143d;rport

Route: <sip:[IP_ADDRESS_1];lr>,<sip:[IP_ADDRESS_5];lr>

Max-Forwards: 70

From: "[CALLERID_NAME]" <sip:[CALLERID_NUMBER]@sip.[SIP_PROVIDER].com>;tag=as194b0eee

To: <sip:1[DIALED_NUMBER]@sip.[SIP_PROVIDER].com>;tag=14c031a8+1+c5a5002a+1e98ac16

Call-ID: 1395de6e3a7cea734acd14872cf40939@sip.[SIP_PROVIDER].com

CSeq: 104 BYE

User-Agent: Asterisk PBX 1.6.2.7

Proxy-Authorization: Digest username="[SIP_USERNAME]", realm="sip.[SIP_PROVIDER].com", algorithm=MD5, uri="sip:[DIALED_NUMBER]@[IP_ADDRESS_4]:5060", nonce="4bf6ae0c0000b99b904c7d925d7d4ab858042d5a66b1262b", response="dac90421550f084d8042adf6c2f7753f", qop=auth, cnonce="5a597239", nc=00000002

X-Asterisk-HangupCause: Normal Clearing

X-Asterisk-HangupCauseCode: 16

Content-Length: 0




---
  == Spawn extension (3701, #11[DIALED_NUMBER], 5) exited non-zero on 'SIP/1318-0000003e'

There is no 400 response there.

Sure there is. Read from the bottom up. I think I figured it out. I was using a dialing pattern that contained a pound sign that would change the outbound caller ID number to a specific number when dialed. I have done some testing and since removing pound from the dialing string the “corrupted headers” do not appear.

Do you have any suggestions on how better to handle the changing of the outbound CID number?

All I could find was this:

I cannot find the text of the 400 status response that it is referring to. In fact, I cannot find anything sent to or read from [SIP_PHONE_IP]. Incidentally, 400 status indicates a non-specific client error.

okay, sorry about that. I must not have gone back far enough. I am pretty confident that the cause was the pound key as it was translating that into %23 in the “From:” field.

<--- SIP read from UDP:[ASTERISK_PUBLIC_IP]:2737 --->
SIP/2.0 400 Missing, Erroneous or Multiple Contact header field(s)
Via: SIP/2.0/UDP [ASTERISK_INTERNAL_IP]:5060;branch=z9hG4bK7fa017e2;rport=5060;received=[ASTERISK_INTERNAL_IP]
From: "#1[DIALED_NUMBER]" <sip:%231[DIALED_NUMBER]@[ASTERISK_INTERNAL_IP]:5060>;tag=as2d4fb5a4
To: "Name" <sip:1318@[INTERNAL_SIP_ADDRESS]:5060>;tag=e2f4f9df85
Call-ID: aa8e74283aa6a37c
CSeq: 102 INVITE
Server: Aastra 6730i/2.5.3.2002
Content-Length: 0

That’s not the Contact header and it is correct to URL encode # as it is not a valid character in a URL, becuase it is used as the fragment delimiter.

Thanks for all your help Dave. Do you know of any reason not to do what I am attempting to do here? Change the CID number based on having users dial an extra digit in front of the called number?

It’s complaining about Contact: headers, not From: headers.