Tuesday, August 10, 2010

Apple iPhone 4 - FaceTime / SIP

Just tried what happens if I would dial the iphone on port 16402/udp
via sip from an other device. I tried a couple of sip devices (like Tandberg
E20, x-lite, ...) with or without a proxy.

Interesting enough the iPhone returns a: 100 Trying
and even more interesting a: 180 Ringing
but sadly no action at all on the phone and the 180 is directly followed by a: 603 Decline

Not 100% sure if it is random or depending on the codec selection, the 180 did not show up all the time.

Btw, if the iPhone is in "sleep mode" (display off) I only saw some igmp and mdns
packets, but no sip resonse on the INVITE. But as it does not answer on ICMP I guess
its wlan stack is sleeping as well, ..

Sadly I miss someone with a iphone 4 to do a test call to debug the real sip packets.
It would be great if someone could provide me with a full pcap trace of a short
FT call or let me know who is interesting on doing a short test call.


There are some other blogs out there with some other information:
http://www.packetstan.com/ or http://blog.roychowdhury.org/



Sip call flow & trace:

|Time | 192.168.101.160 |
| | | 192.168.101.145 |
|1140,242 | INVITE SDP ( telephone-event) |SIP From: sip:user@192.168.101.160:16402 To:sip:user@192.168.101.145
| |(16402) ------------------> (16402) |
|1140,251 | 100 Trying| |SIP Status
| |(16402) <------------------ (16402) | |1140,254 | 180 Ringing |SIP Status | |(16402) <------------------ (16402) | |1140,256 | 603 Decline |SIP Status | |(16402) <------------------ (16402) | |1140,273 | ACK | |SIP Request | |(16402) ------------------> (16402) |




INVITE sip:192.168.101.145:16402 SIP/2.0
Via: SIP/2.0/UDP 192.168.101.160:16402;rport;branch=z9hG4bK32ED0D90B5989B1D6EFC216D15F5D45A
From: +12345 <sip:user@192.168.101.160:16402>;tag=1732193028
To: <sip:user@192.168.101.145>
Contact: <sip:user@192.168.101.160:16402>
Call-ID: 46A9387C-EC31-16EF-0B72-B900DAF27E3C@192.168.101.160
CSeq: 32349 INVITE
Max-Forwards: 70
Content-Type: application/sdp
User-Agent: X-Lite release 1105d
Content-Length: 215
v=0
o=user 1497619765 1497619776 IN IP4 192.168.101.160
s=X-Lite
c=IN IP4 192.168.101.160
t=0 0
m=audio 8000 RTP/AVP 0 101
a=rtpmap:0 pcmu/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.101.160:16402;branch=z9hG4bK32ED0D90B5989B1D6EFC216D15F5D45A
To: <sip:user@192.168.101.145>
From: +12345 <sip:user@192.168.101.160:16402>;tag=1732193028
Call-ID: 46A9387C-EC31-16EF-0B72-B900DAF27E3C@192.168.101.160
CSeq: 32349 INVITE
User-Agent: Viceroy 1.4/GK
Content-Length: 0

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.101.160:16402;branch=z9hG4bK32ED0D90B5989B1D6EFC216D15F5D45A
To: <sip:user@192.168.101.145>;tag=1382422684
From: +12345 <sip:user@192.168.101.160:16402>;tag=1732193028
Call-ID: 46A9387C-EC31-16EF-0B72-B900DAF27E3C@192.168.101.160
CSeq: 32349 INVITE
Contact: <sip:user@192.168.101.145:16402>;isfocus
User-Agent: Viceroy 1.4/GK
Content-Length: 0

SIP/2.0 603 Decline
Via: SIP/2.0/UDP 192.168.101.160:16402;branch=z9hG4bK32ED0D90B5989B1D6EFC216D15F5D45A
To: <sip:user@192.168.101.145>;tag=1382422684
From: +12345 <sip:user@192.168.101.160:16402>;tag=1732193028
Call-ID: 46A9387C-EC31-16EF-0B72-B900DAF27E3C@192.168.101.160
CSeq: 32349 INVITE
Contact: <sip:user@192.168.101.145:16402>;isfocus
User-Agent: Viceroy 1.4/GK
Content-Length: 0

ACK sip:192.168.101.145:16402 SIP/2.0
Via: SIP/2.0/UDP 192.168.101.160:16402;rport;branch=z9hG4bK32ED0D90B5989B1D6EFC216D15F5D45A
From: +12345 <sip:user@192.168.101.160:16402>;tag=1732193028
To: <sip:user@192.168.101.145>;tag=1382422684
Contact: <sip:user@192.168.101.160:16402>
Call-ID: 46A9387C-EC31-16EF-0B72-B900DAF27E3C@192.168.101.160
CSeq: 32349 ACK
Max-Forwards: 70
Content-Length: 0