summaryrefslogtreecommitdiffstats
path: root/src/userintf.cpp
Commit message (Collapse)AuthorAgeLines
* Make Readline non-blocking: Use a self-pipe to break the Readline loopFrédéric Brière2019-06-29-0/+31
| | | | | | | | | | Now that we are no longer blocking on Readline calls, we can set up a self-pipe that will let us break out of the Readline loop upon receiving a "quit" command on our local socket, thus (finally) fixing issue #143. (Thanks to https://stackoverflow.com/a/27662212 for the tip!) Fixes #143
* Make Readline non-blocking: Wrap select(2) around Readline callFrédéric Brière2019-06-29-1/+23
| | | | | By only invoking rl_callback_read_char() when there is actual input on stdin, we can now avoid blocking on Readline calls.
* Make Readline non-blocking: Relay SIGWINCH to ReadlineFrédéric Brière2019-06-29-0/+16
| | | | | | | | | | | | | | | | | When using Readline's callback interface, signals are (by default) only captured within the duration of the rl_callback_read_char() call. It is therefore expected of the application to capture SIGWINCH on its own, and notify Readline of the fact. (While it's possible to change this with rl_persistent_signal_handlers, some signals, such as SIGHUP, will still only be *processed* during that call, making it a somewhat unappealing solution. This all could be alleviated by calling rl_check_signals() periodically, but that function was only introduced in Readline 8.0, which is far too recent.) Note that we are using signal(2) and not sigaction(2), depite the various warnings that come with it, mostly because it's what is already present in the codebase.
* Make Readline non-blocking: Use Readline's callback interfaceFrédéric Brière2019-06-29-19/+25
| | | | | | | | | | | | | When Twinkle is running in CLI mode and is sent a "quit" command to its local socket, it will currently not respond immediately, but rather wait until the next line has been read from its standard input (issue #143). This is due to the blocking nature of readline(), which only returns once a complete line has been read. Switching to Readline's "alternate" callback interface is the first step in addressing this issue. (As a bonus, this also fixes a bug where the line pointer returned by readline() was not freed correctly.)
* User-Determined User Busy (UDUB)Alexander Traud2017-11-26-1/+1
| | | | | | | | | | | When you reject a call, either A. the forwarding rule for User-Busy kicks in, like an answering machine or another extension (of a personal secretary or a deputy). Or B. the caller hears normal ringing first, and then the busy tone. To allow case A, a SIP user-agent client (UAC) has to return the status User-Busy (486). The same should happen in case B, because the caller shall hear a busy tone on rejection. 486 is mandated for SIP clients in mobile phones by the GSMA. Furthermore, other SIP-client creators give a 486 in that case as well; I tested Acrobits, Atlinks, Counterpath, Gigaset, Grandstream, RTX, Snom, Yealink, and Vtech. Before this change, twinkle rejected a call with the SIP-Status 603. The class 6xx requires that *all* other registered phones stop to ring. Furthermore, some SIP user-agent servers (UAS) follow RFC 3398 and map a status 603 to the cause-code 21, which is mapped back to status 403 (Forbidden). Cisco and Digium Asterisk do this. For example in Asterisk, after you rejected the call in twinkle, the caller did not get 603 or 486, but 403. However, in case of 403, the original caller is allowed to re-try the call setup. For example, I have a Nokia Symbian/S60 based phone which tries via IPv4 first, then after it received the 403, that phone tries again via IPv6. Consequently, a user of twinkle had to reject the call twice when 603 was returned.
* Replace (old) FSF postal address with URL in header filesFrédéric Brière2016-10-02-2/+1
| | | | | | Wording copied from https://www.gnu.org/licenses/gpl-howto.en.html Fixes #25, fixes #71
* DTMF event type cleanupMichal Kubecek2016-05-20-7/+7
| | | | | | | DTMF event constants handling is a bit messy as three different types are used in different source files, triggering various compiler warnings. Introduce t_dtmf_ev type and use it everywhere, also replace helper macros by inline functions.
* Fix spelling errorPeter Colberg2016-05-13-1/+1
|
* Fix spellingPeter Colberg2015-12-30-1/+1
|
* Move some possibly blocking ops into userintf.cpp event queue (#17)Lubos Dolezel2015-07-07-0/+4
|
* Support function calls on event queues (useful for #17)Lubos Dolezel2015-07-07-0/+3
|
* Further work on G.729A integration (issue #15)Lubos Dolezel2015-06-15-0/+1
|
* Extend copyright till 2015Lubos Dolezel2015-06-04-1/+1
|
* initial checkinMichal Kubecek2015-04-13-0/+3511
Check in contents of upstream 1.4.2 tarball, exclude generated files.