summaryrefslogtreecommitdiffstats
path: root/README.md
blob: a6c05be9071496c7302d5cb84b836d8bced491ca (plain)
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# Twinkle

Twinkle is a SIP-based VoIP client.

## Dependencies

To compile Twinkle you need the following libraries:

* ucommon [GNU uCommon C++](http://www.gnu.org/software/commoncpp/)
* ccRTP (version >= 1.5.0) [GNU RTP Stack](http://www.gnu.org/software/ccrtp/)
* libxml2
* libsndfile
* libmagic
* libreadline
* Qt 5 -- more specifically, the following submodules:
  * base
  * declarative
  * tools

The following tools are also required:

* cmake
* bison
* flex

### Optional dependencies

* alsa-lib (also known as libasound)
* libzrtpcpp (version >= 0.9.0) [ZRTP library, ccRTP support must be enabled](http://www.gnutelephony.org/index.php/GNU_ZRTP)
* bcg729 [G.729A codec library](http://www.linphone.org/technical-corner/bcg729/overview)
* Speex and SpeexDSP [Speex codec library](http://www.speex.org/)
* iLBC [iLBC codec library](http://www.ilbcfreeware.org/)

## Build

First of all, choose which options you want to have enabled.

All possible options are:

* Qt 5 GUI: `-DWITH_QT5=On` (on by default)
* D-Bus use: `-DWITH_DBUS=On` (on by default, requires `WITH_QT5`)
* ALSA support: `-DWITH_ALSA=On` (on by default)
* ZRTP support: `-DWITH_ZRTP=On`
* G.729A codec support: `-DWITH_G729=On`
* Speex codec support: `-DWITH_SPEEX=On`
* iLBC codec support: `-DWITH_ILBC=On`
* Diamondcard support: `-DWITH_DIAMONDCARD=On`

### Build instructions

	# Create a subdirectory for the build an enter it
	mkdir build && cd build

	# Run cmake with a list of build options
	cmake .. -Dexample_option=On

	# Build Twinkle
	make

	# Install Twinkle
	make install

## Shared user data

Installation will create the following directory for shared user data
on your system:

	${CMAKE_INSTALL_PREFIX}/share/twinkle

The typical default value for `CMAKE_INSTALL_PREFIX` is `/usr/local`.

## Application icon

If you want to create an application link on your desktop you
can find an application icon in the shared user data directory:

*	twinkle16.png	(16x16 icon)
*	twinkle32.png	(32x32 icon)
*	twinkle48.png	(48x48 icon)

## User data

On first run Twinkle will create the `.twinkle` directory in your home
directory. In this directory all user data will be put:

* user profiles (.cfg)
* log files (.log)
* system settings (twinkle.sys)
* call history (twinkle.ch)
* lock file (twinkle.lck)

## Starting Twinkle

Give the command: twinkle

`twinkle -h` will show you some command line options you may use.

NOTE: the CLI option is not fool proof. A command given at a wrong
      time may crash the program. It is recommended to use the GUI.
  
If you do not specify a configuration file (`-f <profile>`) on the command
line, then Twinkle will look for configuration files in your 
`.twinkle` directory. 

If you do not have any configuration file, the configuration file
editor will startup so you can create one. If you have
configuration files, then Twinkle lets you select an 
existing configuration file. See below for some hints on
settings to be made with the profile configuration editor.

If you specify a configuration file name, then Twinkle will
such for this configuration file in your .twinkle directory.
If you have put your configuration file in another location
you have to specify the full path name for the file, i.e.
starting with a slash.

NOTE: the configuration file editor only exists in the GUI.
      If you run the CLI mode, you must have a configuration file.
      So first create a configuration file in GUI mode or hand edit
      a configuration file, before running the CLI mode.
      If you run the CLI mode and you do not specify a file name
      on the command line, then Twinkle will use twinkle.cfg

## NAT

If there is a NAT between you and your SIP server then you have
3 options to make things work:

1. Your SIP provider uses a Session Border Controller
2. Your SIP provider offers a STUN server
3. Make static address mappings in your NAT for SIP and RTP

STUN can be enabled in the NAT section of the user profile.

For the static address mappings enable the following in
the NAT section of the user profile:

      Use statically configured public IP address inside SIP messages

And fill in the public IP address of your NAT.

Twinkle will then use this IP address inside SIP headers and
SDP bodies instead of the private IP address of your machine.

In addition you have to add the following port forwardings for UDP
on your NAT

	public:5060 --> private:5060 (for SIP signaling)
	public:8000 --> private:8000 (for RTP on line 1)
	public:8001 --> private:8001 (for RTCP on line 1)
	public:8002 --> private:8002 (for RTP on line 2)
	public:8003 --> private:8003 (for RTCP on line 2)
    public:8004 --> private:8004 (for RTP for call transfer)
    public:8005 --> private:8005 (for RTCP for call transfer)

If you have changed the SIP/RTP ports in your profile you have
to change the port forwarding rules likewise.

## Log files

During execution Twinkle will create the following log files in
your .twinkle directory:

* twinkle.log (latest log file)
* twinkle.log.old (previous log file)

When twinkle.log is full (default is 5 MB) then it is moved to 
twinkle.log.old and a new twinkle.log is created.

On startup an existing twinkle.log is moved to twinkle.log.old and a
new twinkle.log is created.

## User profile configuration

A user profile contains information about your user account,
SIP proxy, and several SIP protocol options. If you use Twinkle
with different user accounts you may create multiple user
profiles.

When you create a new profile you first give it a name and
then you can make the appropriate settings. The name of the
profile is what later on appears in the selection box
when you start Twinkle again. Or you can give the name.cfg
at the command line (-f option) to immediately start that
profile.

The user profile is stored as '<name>.cfg' in the .twinkle
directory where <name> is the name you gave to the profile.

At a minimum you have to specify the following:

* User name: this is your SIP user name (eg. phone number)
* Domain:    the domain of your provider (eg. fwd.pulver.com)
             this could also be the IP address of your SIP proxy
	     if you want to do IP-to-IP dialing (without proxy) then
	     fill in the IP address or FQDN of your computer.

If your SIP proxy does not request authentication and the value you
filled in for 'Domain' can be resolved to an IP address by Twinkle,
eg. it is an IP address or an FQDN that is in an A-record of the
DNS, then you are ready now.

## Authentication

If your proxy needs authentication, then specify the following fields
in the SIP authentication box:

* Realm:	the realm for authentication
	 	you might leave the realm empty. If you do so, then
		Twinkle will use the name and password regardless of
		the realm put in the challenge by the proxy. For most
		network setups this is fine. You only need to explicitly
		specify a realm when you have call scenario's where
		you have to access multiple realms. Then for the realms
		not known to Twinkle you will be requested for a login
		when needed.
* Name:		your authentication name
* Password:	your authentication password

If authentication fails during registration or any other SIP request
because you filled in wrong values, then Twinkle will at that time
interactively request your login and cache it.

## Outbound proxy

An outbound proxy is only needed if the domain value cannot be resolved
to an IP address by Twinkle or because your provider demands you to
use an outbound proxy that is at a different IP address.

Check the 'use outbound proxy' check box in the SIP server section.
For outbound proxy fill in an IP address or an FQDN that can be
resolved to an IP address via DNS.

By default only out-of-dialog requests (eg. REGISTER, OPTIONS, initial
INVITE) are sent to the outbound proxy. In-dialog requests (eg. re-INVITE,
BYE) are sent to the target indicated by the far end during call setup.
By checking 'send in-dialog requests to proxy' Twinkle will ignore this
target and send these requests also to the proxy. Normally you would
not need this. It could be useful in a scenario where the far-end
indicates a target that cannot be resolved to an IP address.

By checking "Do not send a request to proxy if its destination can be
resolved locally" will make Twinkle always first try to figure out
the destination IP address itself, i.e. based on the request-URI and
Route-headers. Only when that fails the outbound-proxy will be tried,
but only for the options checked above. I.e. if you did not check
the 'in-dialog' option, then an in-dialog request will
never go to the proxy. If its destination cannot be resolved, then
the request will simply fail.

## Registrar

By default a REGISTER will be send to the IP address resolved from
the domain value or to the outbound proxy if specified.

If your service provider has a dedicated registrar which is
different from these IP addresses, then you can specify the
IP or FQDN of the registrar in the registrar-field.

The 'expiry' value is the expiry of your registration. Just before
the registration expires Twinkle will automatically refresh the
registration. The expiry time may be overruled by the registrar.

The 'registrar at startup option' will make Twinkle automatically 
send a REGISTER on startup of the profile.  

## Addressing

When you invite someone to a call you have to enter an address.
A SIP address has the following form:

	sip:<user>@<host-part>

Where 'user' is a user name or a phone number
and 'host-part' is a domain name, FQDN or IP address

The only mandatory part for you to enter is the <user>. Twinkle
will fill in the other parts if you do not provide them.
For the host-part, Twinkle will fill in the value you configured
as your 'domain'.

Currently `sip:` is the only addressing scheme supported by Twinkle.

Michel de Boer [michel@twinklephone.com]

Lubos Dolezel [lubos@dolezel.info]