0
나 SIP 서버로 INVITE 보내려고 :GCDAsyncSocket 전송할 SIP 패킷
GCDAsyncSocket *outgoingCallSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:socketOutgoingCallQueue];
BOOL result = [outgoingCallSocket connectToHost:currentSoftswitch.ip onPort:5060 error:&error];
- (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag
내부하고, 소켓 접속 :
여기
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port;
{
NSLog(@"Connected socket to %@:%hu", host, port);
[sock writeData:finalData withTimeout:-1 tag:OUTGOING_CALL];
NSLog(@"\n===================SEND START TO currentSoftswitch.ip->%@:5060 =================\n%@\n===================SEND FINISH=================\n",host,[[NSString alloc] initWithData:finalData encoding:NSUTF8StringEncoding]);
초래할 것이다 :
> ===================SEND START TO currentSoftswitch.ip->195.26.84.147:5060 ================= INVITE
> sip:[email protected];transport=tcp;lr SIP/2.0 Via:
> SIP/2.0/TCP 195.26.84.147:5060;rport;lr SIP/2.0 Max-Forwards: 70 From:
> "[email protected]"
> <sip:[email protected]>;tag=Ztr3.0MabqPlVkNJHHVdvAdeNGUXsz8E To:
> sip:[email protected] Contact: "[email protected]"
> <sip:[email protected]:5060;transport=TCP;ob> Call-ID:
> zu.MBTPcv87dylX2i-BsA.b551Kyflic CSeq: 25575 INVITE Route:
> <sip:195.26.84.147;transport=tcp;lr> Route: <sip:195.26.84.147;lr>
> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY,
> REFER, MESSAGE, OPTIONS Supported: replaces, 100rel, timer, norefersub
> Session-Expires: 1800 Min-SE: 90 User-Agent: CallsFreeCalls
> SSContent-Type: application/sdp Content-Length: 480
>
> v=0 o=- 3566574154 3566574154 IN IP4 46.211.183.202 s=pjmedia c=IN IP4
> 46.211.183.202 b=AS:84 t=0 0 a=X-nat:6 m=audio 40000 RTP/AVP 104 18 108 3 8 0 96 c=IN IP4 46.211.183.202 b=TIAS:64000 a=rtcp:40001 IN IP4
> 46.211.183.204 a=sendrecv a=rtpmap:104 SILK/8000 a=fmtp:104 useinbandfec=0 a=rtpmap:18 G729/8000 a=rtpmap:108 iLBC/8000 a=fmtp:108
> mode=30 a=rtpmap:3 GSM/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000
> a=rtpmap:96 telephone-event/8000
>
> ===================SEND FINISH=================
하지만 whireshark를 체크인하면 패킷이 SIP처럼 감지되지 않습니다. 내가 틀렸어?
왜 2 개의 소켓 객체를 사용합니까? 특별한 이유가 있니? –