Invalid invite from Nokia e72 - please help

Hello,
I’m experimenting with Asterisk and TLS/SRTP.
When connecting a Nokia e72 phone everything is fine as long as I’m not using security (SIP over UDP and RTP).
When I enable TLS the nokia starts sending invalid INVITE request:

<--- SIP read from TLS:192.168.100.1:58385 --->
INVITE sips:home.ilian.org:5061 SIP/2.0
Route: <sips:600@home.ilian.org>
Via: SIP/2.0/TLS 192.168.100.100:5061;branch=z9hG4bK2ba9ok5thhhc6luc062goh4;rport
From: <sips:e72@home.ilian.org>;tag=podpok312thc6qcp062g
To: <sips:600@home.ilian.org>
Contact: <sips:cs2EIXlmpxk-HNysbdrd@192.168.100.100:5061>
Supported: precondition,100rel,timer,sec-agree
CSeq: 4771 INVITE
Call-ID: 6Fqsk0DWoIfuaw653bJt-waFHyAhQe
Allow: UPDATE,PRACK,SUBSCRIBE,REFER,NOTIFY,INVITE,ACK,CANCEL,OPTIONS,BYE
User-Agent: Nokia RM-530 052.005 (en)
Expires: 120
Privacy: None
Session-Expires: 1800
Max-Forwards: 70
Content-Type: application/sdp
Accept-Language: en
Content-Length: 803

v=0
o=e72 63458720826586125 63458720826586125 IN IP4 192.168.100.100
s=-
c=IN IP4 192.168.100.100
t=0 0
m=audio 49152 RTP/SAVP 100 96 0 8 97 18 98 13
a=sendrecv
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:RGMtdWtVN0ZZS2lFVDBJTzBCSHpwSVpNcWNXbmtO
a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:c25jOEdVbm0tU09UTDdLbnV1ZnVTanBia1oyVUk3
a=curr:sec e2e none
a=des:sec optional e2e sendrecv
a=rtcp:49153 IN IP4 192.168.100.100
a=rtpmap:100 AMR-WB/16000
a=ptime:20
a=maxptime:200
a=fmtp:100 mode-change-period=2; mode-change-neighbor=1
a=rtpmap:96 AMR/8000
a=fmtp:96 mode-set=0,1,2,3,4,5,6,7; mode-change-neighbor=1
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:98 telephone-event/8000
a=fmtp:98 0-15
a=rtpmap:13 CN/8000

<------------->
--- (18 headers 26 lines) ---
Sending to 192.168.100.1:58385 (NAT)
Using INVITE request as basis request - 6Fqsk0DWoIfuaw653bJt-waFHyAhQe
Found peer 'e72' for 'e72' from 192.168.100.1:58385
  == Using SIP RTP CoS mark 5
Found RTP audio format 100
Found RTP audio format 96
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 97
Found RTP audio format 18
Found RTP audio format 98
Found RTP audio format 13
Found audio description format AMR-WB for ID 100
Found audio description format AMR for ID 96
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format iLBC for ID 97
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 98
Found audio description format CN for ID 13
Capabilities: us - 0x80000008000e (gsm|ulaw|alaw|h263|testlaw), peer - audio=0x50c (ulaw|alaw|g729|ilbc)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x3 (telephone-event|CN|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.100.100:49152
Looking for  in default (domain home.ilian.org:5061)

<--- Reliably Transmitting (NAT) to 192.168.100.1:58385 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/TLS 192.168.100.100:5061;branch=z9hG4bK2ba9ok5thhhc6luc062goh4;received=192.168.100.1;rport=58385
From: <sips:e72@home.ilian.org>;tag=podpok312thc6qcp062g
To: <sips:600@home.ilian.org>;tag=as496f10d5
Call-ID: 6Fqsk0DWoIfuaw653bJt-waFHyAhQe
CSeq: 4771 INVITE
Server: Asterisk PBX SVN-trunk-r295748
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

This is parsed as the nokia trying to call: home.ilian.org instead of extention 600. Can anyone give me an idea how can I fix this?

You’re requesting SRTP there. Do you have encryption=yes set for that peer in sip.conf?

Yes:
[e72]
insecure=invite
encryption=yes
type=friend
secret=secret
nat=yes
srtpcapable=yes
host=dynamic
transport=tls

What version?

I see a problem there:

Asterisk is the latest version from trunk.
The nokia is with the latest software: 052.005

Meanwhile I did a little work-around, changed a little: get_destination() in chan_sip, to use the “To” header, if the INVITE line appears to be invalid. And it worked fine.

I don’t know enough about SIP, is this invite valid:
INVITE sips:home.ilian.org:5061 SIP/2.0

Shouldn’t it be:
INVITE sips:600@home.ilian.org:5061 SIP/2.0

I can’t quote the RFCs. :frowning:

But, Blink (a soft client) sends the initial invite:

INVITE sip:101@192.168.0.100 SIP/2.0

With the e72 then it only doesn’t send the dialed number when TLS is enabled?

Yes it appears to be so.

It’s very strange, because I read in the issues database that this tested OK a while back. Maybe Nokia broke it in the latest firmware.

This is reproducible with both Nokia e71 and Nokia e51 (both using the latest firmware). They both omit the called number from the invite line.

Maybe the developers can consider an option to allow for a nokia work-around, something like:
nokia_workaround=yes

:smile:

Are you up to speed on the various RFCs? Should we be tolerant of such a condition?

I’ll have to get back to you on that. Will read the RFC and post here. :smile:

The RFC states that the address in the INVITE line should be the same as the address in the “To” header. It is not required for these two addresses to be the same string, but they must be equivalent. So, it seems that this is a Nokia BUG.

It is now up to the developers to decide if you want to use the “To” header in when determining the target address in order to work around the Nokia bug.