Professional Documents
Culture Documents
SCOPE
This Assignment requires the implementation on VOIP service between two organisations through their in-house Asterisk servers. Both the servers serving 2 VOIP phone extensions each through SIP, apart from trunking in between them. The dial plan should support overlapping numbers and hence an extension at each if the organisations should have overlapping names. Also, DHCP and DNS service should be built supporting the network architecture. As an extra effort , SIP servers have been built to support in-house presence information.
PC1
sip.voip.alpha.com
Virtual Switch
sip.voip.beta.com
C2950
PC2
1001
1002
ASSUMPTIONS
For simulating the network architecture following assumptions were made, 1) 2 Virtual Machines of which 1 runs Asterisk and DNS services and another runs Asterisk and DHCP services. In real time this may not be applicable, at least for the DHCP service. 2) A pair of X-Lite soft phones (on Windows7) and Ekiga (on Debian) soft phones are used to simulate real phones, each running on 4 separate virtual machines. 3) A single subnet 10.0.2.0/24 was chosen as suggested. 4) The two levels of IVR options to be built as a part of the dial plan are being tailored from the available sound files in the default collection as well as the asterisk-extra-sounds-en-ulawcurrent.tar package referred to in the SIP, Future of Telephony book. This could not support the names of the organisations and hence replaced with names viz. Engineering and Sales.
Page 1
COURSE
1) The correct OS to run all the services on virtual machines needed critical choice. The Cent OS 5.5 was to run on Sun Virtual Box 3.1.8. 2) The soft phones were installed on VMs and Asterisk and Bind packages on server VMs and compiled. 3) The DHCP service was built to support disbursal of IP addresses in the entire subnet range except for the fixed VMs that require static bindings, especially the servers and to disseminate DNS server address and domain information. All these information is written in a file called dhcpd.conf before starting the service. 4) The BIND9 based DNS service built with two zones serving each of the organisations. Two zone files and a reverse mapping file all being referenced by named.conf in /etc directory. 5) Having started the DNS and DHCP services, they were tested by intermediate ping with their domain names. 6) Asterisk service on one of the servers is turned on. The extensions were defined in sip.conf with type as friend allowing calls both ways, secret as a preshared secret and the hosts ip address as dynamic and the contexts in a dial plan were defined in extensions.conf with just auto fall through configuration to test the setup. 7) The soft phones were configured with the credentials and the domain name of the server to dock on. 8) When one phone was turned on the other and the packets were sniffed, the registration process could be clearly comprehended and the phone came into service. 9) The dial plan was then upgraded to test the extension by defining a playback function that will play an audio file and then to hang up when call is made to a test extension. 10) The playback function is then upgraded to a two level IVR that would guide the user to dial a valid extension or quit. 11) With the success in the first phone the same procedure is repeated for the second soft phone. 12) The dial plan was then modified to enable the phones call each other, which was then verified by sniffers. With the limitations in VMs, the debug was not left to commands in the server.
Page 2
CONCLUSION
This is an excellent assignment that offers room to study on the bones of SIP,VOIP, Virtual Machine management and MAC spoofing.
Page 3
Page 4
c) SIP1 starts first level of optimisation by sending invites in both the directions with the neighbour UAs IP address as connection point in SDP. Stream#2 d) Till the Phones directly communicate the SIP1 server tries optimising the call route. Stream#3
e) Phone to hangs up the call sending bye to SIP1 for it to take over. Stream #4 f) SIP1 takes over the session by sending invite to Phone1 and then hangs up the call. Stream #5.
2) A) Time Sequence Diagram for calls between Phone2(1001) registered to SIP1 and Phone4 (1002) registered to SIP2 server Non overlapping contexts Phone2 INVITE>1 <100 TRYING1 INVITE>1 <100 TRYING1 INVITE>1 SIP1 SIP2 Phone4
Page 5
Page 6
CALL <BYE 6 200OK>6 <INVITE6 100TRY>6 200OK>6 <ACK6 <BYE6 200OK>6 <INVITE6
Page 7
g) Before Phone 3 getting docked to SIP1 server the stream getting diverted as Phone2 SIP2 Phone4 h) Hence SIP1 resources are conserved. SIP2 initiates the second level of optimisation by initiation of stream #3 invites to both SIP1 and Phone 3. i) j) Since SIP1 is no longer the part of call it does not take this further with Phone 1 Phone3 however succeeds in fetching the IP address of Phone1 and directly routes its packets to Phone 1. Thus a triangular formation of Phone2 SIP2 Phone4 can be observed during the call.
k) It is to be noted that with the success of each level of optimisation the SIP servers again initiate Invites for the next level of optimisation. This is numbered # 4 (also trailing part of #2) l) Once Phone 4 hangs up, it sends a BYE to SIP2 which tries to modify the session, by including SIP1 into the loop and handing over the termination of the session to SIP1. This stream of requests has been numbered #6 for clarity. Page 8
B) Time Sequence Diagram for calls between Phone2(1001) and Phone3(1001) both registered to SIP1 server overlapping contexts Phone1 INVITE>1 <100 TRYING1 INVITE>1 <100 TRYING1 INVITE>1 <100 TRYING1 <180 RINGING1 <180 RINGING1 <180 RINGING1 <200 OK1 ACK>1 <200 OK1 INVITE>2 ACK>1 <200 OK1 INVITE>2 <INVITE2 <491 REQUEST PENDING5 ` 491 REQUEST PENDING>5 <ACK5 ACK>5 ACK>1 SIP1 SIP2 Phone3
Page 9
Page 10
Page 11
z) SIP2 sends BYE to its session with SIP1, which in turn repeats the same with Phone 1 to terminate the call. 3) BETWEEN PHONE AND ASTERISK SERVER A) 05:17:10.239186000 PHONE1 > SIP1
1>INVITE sip:91001@phones SIP/2.0 Invite a sip session with SIP1 2>Via:SIP/2.0/UDP 10.0.2.251:15458;branch=z9hG4bK-d8754z-cc3bd56218ceb5be-1---d8754z-;rport Path of the session recorded 3>Max-Forwards: 70 Defines maximum hops the request can take 4>Contact: sip:1001@10.0.2.251:15458 Defines the contact details for subsequent responses 5>To: sip:91001@phones Defines the logical recipient of the request the context in the proxy 6>From: <sip:1001@phones>;tag=c2713b23 Defines the logical initiator of the request the extension 7>Call-ID: NjZkM2FhZTc3YjYyYzc4MTVmMGEzMmMxYWI0MjZlZDY. Uniquely identifies the call 8>CSeq: 1 INVITE Sequence number of the transaction 9>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO All the methods supported by intiating UA 10>Content-Type: application/sdp Defines the contents of the application layer 11>Supported: replaces Ayyappan Ramanan 1144880 Page 12
28>SIP/2.0 100 Trying SIP1 acknowleges the INVITE request sent by Phone1 (packet A) 29>Via: SIP/2.0/UDP 10.0.2.251:15458;branch=z9hG4bK-d8754z-cc3bd56218ceb5be-1---d8754z;received=10.0.2.251;rport=15458 Matches VIA in the request, line 2 30>From: <sip:1001@phones>;tag=c2713b23 Matches From in the request, line 6 Ayyappan Ramanan 1144880 Page 13
74>ACK sip:91001@10.0.2.17 SIP/2.0 Phone1 acknowledges packet D for reliability. Remaining fields same as that of packet A 75>Via: SIP/2.0/UDP 10.0.2.251:15458;branch=z9hG4bK-d8754z-da39ae5e2549b0e2-1---d8754z;rport Max-Forwards: 70 Contact: <sip:1001@10.0.2.251:15458> To: <sip:91001@phones>;tag=as7b8c863b From: <sip:1001@phones>;tag=c2713b23 Call-ID: NjZkM2FhZTc3YjYyYzc4MTVmMGEzMmMxYWI0MjZlZDY. CSeq: 1 ACK Ayyappan Ramanan 1144880 Page 15
SUBSCRIBE
Page 16
The SIP1 server notifies Phone1 on the registration of Phone 2. h) 294 44.413213 10.0.2.17 10.0.2.254 SIP/XML sip:1001@10.0.2.254:12782 NOTIFY sip:1001@10.0.2.254:12782 SIP/2.0 Via: SIP/2.0/UDP 10.0.2.17:5060;branch=z9hG4bK717a7413;rport Max-Forwards: 70 From: <sip:1002@phones>;tag=as281b23b7 To: <sip:1001@phones>;tag=d232f0a4 Contact: <sip:1002@10.0.2.17> Call-ID: OWUyMzQ1NjY5YzYwY2QzYmQ0ZWEwMzkxYzdmZjhkYWU. CSeq: 102 NOTIFY User-Agent: Asterisk PBX 1.6.2.11 Event: presence Content-Type: application/pidf+xml Subscription-State: active Content-Length: 467 <?xml version="1.0" encoding="ISO-8859-1"?> <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:pp="urn:ietf:params:xml:ns:pidf:person" xmlns:es="urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status" xmlns:ep="urn:ietf:params:xml:ns:pidf:rpid:rpid-person" entity="sip:1001@phones"> <pp:person><status> </status></pp:person> <note>Ready</note> <tuple id="1002"> <contact priority="1">sip:1002@phones</contact> <status><basic>open</basic></status> </tuple> </presence>
Request:
NOTIFY
Page 17