forked from mozilla/ikran
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
185 lines (152 loc) · 6.18 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---------------
0. Introduction
---------------
Ikran is an experimental addon for Firefox that turns your browser into a SIP endpoint
for both audio and video. It currently uses GIPS for audio/video support.
The ikran is a bird from the mythical world of Pandora (Avatar). It is well known for
its birdcall which travels long distances using widely accepted standards for audio and video.
Source tree strcture:
<SOURCE>
tests [Standalone test application and add-on]
testapp_softphone
ikran [addon code and sample html]
third_party [Third party dependencies ]
chromium_base
lib [GIPS libraries go here].
src/sipcc [SIP stack]
src [ECC - call control wrapper for SIP stack]
--------------------
1. Platform Support
--------------------
Required for all platforms:
Python (www.python.org) - known to work with 2.6 & 2.7
SCons (www.scons.org) - 'sudo apt-get install scons' or 'sudo yum install scons'
MOZSDKPATH environment variable pointing to the Gecko2 SDK (6.0 or later)
WEBRTCPATH environment variable pointing to the webrtc source trunk
Linux:
Built regularly on Ubuntu 10.4 32bit and 64bit
Should build on Ubuntu 11.04 32-bit and close to building on Fedora 15 64-bit
Third-Party Libraries
+libxml2 - sudo apt-get install libxml2-dev
+Glib - sudo apt-get install libdbus-glib-1-dev
+asound - sudo apt-get install libasound2-dev
+libgtk - sudo apt-get install libgtk2.0-dev
Mac OSX:
Built regularly on OSX 10.6 with XCode 3.2.6
Links to Framework 10.5
Windows:
Built regularly on Windows XP & Windows 7 32bit.
Python path is in runSconsBuild.py and set to c:\python27
Requires setting environment variables MS_VC_PATH and MS_WINDOWS_SDK_PATH and SCONS_LOCATION
e.g SCONS_LOCATION=c:\Python26\Scripts
-------------
2. Building
-------------
- Get Gecko2 SDK (32bit) for your platform from
https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/6.0/sdk
- Extract the package & Set the MOZSDKPATH env variable to point to it
- Build WEBRTC for video and audio engine libraries
+ Follow the instructions @ http://www.webrtc.org/reference/getting-started
+ Set WEBRTCPATH to point to it : export WEBRTCPATH=/Users/XTM/HTML5/webrtc/trunk
- Instead of using scons directly, use runSconsBuild.py like this
'python runSconsBuild.py debug' or
'python runSconsBuild.py clean'
Current command line options are 'debug', 'release', 'clean', 'noaddon' and 'x64'.
----------
4. Output
----------
Build will create a standalone test app and an addon for Firefox 4 or 5.
Test App Exe: TestApp_Softphone
Addon: ikran-0.2-dev.xpi
-----------------------
5. Testing the addon
-----------------------
To build & test 32bit addon , follow below steps
- Addon executable shall be generated under the <SOURCE>/ikran
called ikran-0.2-dev.xpi
- OSX
Start Firefox in 32 bit as
arch -i386 /Applications/Firefox.app/Contents/MacOS/firefox-bin
- Linux
Connect your camera and make sure it works :)
Start Firefox normally
- Install the addon
- Test add-on with sample page at
<SOURCE>/ikran/content/ikran.html
NOTES:
1. ikran.html should be served from a server due to permission issues
with file loaded locally (file://)
--------------------------------
6. Using the Test Application
--------------------------------
Use the command line test application to exercise the SIP stack.
There are two ways to use the Test Application
Run the Test Application from the command line with no parameters
./tests/testapp_softphone/TestApp_SoftPhone
Enter SIP Server IP address
Enter SIP Server Username (phone DN for CUCM)
Enter Password (not required for CUCM)
Enter device name (only required for CUCM)
Run the Test Application from the command line with a config file as a parameter
./tests/testapp_softphone/TestApp_SoftPhone cfg.txt
- Sample cfg.txt (create file named e.g. cfg.txt)
IP_ADDRESS=10.53.40.5
DEVICENAME=emannionsip1
LOGFILE=local.log
SIPUSER=1010
CREDENTIALS=1234
Notes
IP_ADDRESS = SIP server IP address, used as part of SIP AOR
DEVICENAME = name of device config file on SIP server, onlr for CUCM
SIPUSER = users DN configured on CUCM used as part of SIP AOR, i.e. SIPUSER@IP_ADDRESS
CREDENTIALS = secter configured for a SIP user on Asterisk
TestApp Commands
- ? -- view commands available
- d <digits> -- make call
- e -- end call
- h -- place a call on hold
- r -- resume a held call
- m -- mute audio while on a call
- n -- unmute audio
- k -- video mute
- j -- video unmute
- z -- enable\disable video
- v -- Setup video send direction, send only, sendrecv, revc only, inactive
- q -- quit
-------------
7. Addon API
-------------
The JS API offers support for
SIP Registration, Place Call, HangUp Call & Answer Call
window.navigator.service.call obtains handle to session-control
object.
<session-control>.registerUser(user_device, user, credential, sip-proxy, sessObserver);
registers user to the sip-proxy.
'sessObserver' is a JS function that will be called whenever there is
a change in the session state such as "no-registrar","registering",
"registered", "incoming-call" & "registration-failed".
On successful registration, one can place call with the below API
<session-control>.placeCall(dial-number, mediaObserver);
where dial-number is number to dial and mediaObserver reports
significant media state changes suhc as "call-connected",
"call-terminated" as of today.
JS APIs unRegisterUser() and hangupCall() allows de-registration
& end-call functionalities.
Few Points to Note
1. Only Audio is supported on OSX
2. One user is suported as registered by instance
Please see content/ikran.html for sample usage of the API.
-----------------------------------
8. Configuring Asterisk SIP Server
-----------------------------------
1. Create a SIP user in /etc/asterisk/sip.conf
[bob]
type=friend
defaultuser=bob
secret=1234
host=dynamic
context=ikran
2. Create a phone extension in /etc/asterisk/extensions.conf
[ikran]
extn => 1234,1,Dial(SIP/bob)
3. From the Asterisk CLI> sip reload