siproc

A primitive SIP client that spawns processes for each call
git clone git://xatko.vsos.ethz.ch/siproc.git
Log | Files | Refs | README | LICENSE

commit 45a481a9dbb03eb71181cb37a688eeddc46c218c
parent 26d40a942400fbc654934094e8bda4df9a4ffb1f
Author: Dominik Schmidt <dominik@schm1dt.ch>
Date:   Sat, 16 Nov 2019 21:52:53 +0100

Check for certain commands whether we are connected or not

PJSIP does not react kindly to out of place actions,
and segfaults if we e.g. connect an AudioMedia to the conference
bridge of an unconnected call.

Diffstat:
MREADME.md | 1-
Msrc/siproc.cpp | 9++++++---
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -47,7 +47,6 @@ To-Do in a call to `snd_device_name_hint(-1, "pcm", ...)`, and calling `pjmedia_aud_dev_refresh()`, after which the file should become available via `AudioDevManager` * Make siproc report errors to the child processes -* Catch the child processes being stupid (e.g. calling "PLAY file.wav" before "ANSWER") Contributing ------------ diff --git a/src/siproc.cpp b/src/siproc.cpp @@ -373,6 +373,12 @@ class MyCall: public Call{ else if(strcmp(command, "ANSWER") == 0){ cmd_answer(); } + else if(strcmp(command, "RINGING") == 0){ + cmd_ringing(); + } + else if(!connected()){ + PJ_LOG(2, ("MyCall", "Command %s coming at an inopportune time...", command)); + } else if(strcmp(command, "DTMF") == 0){ cmd_dtmf(args); } @@ -388,9 +394,6 @@ class MyCall: public Call{ else if(strcmp(command, "RECORD") == 0){ cmd_record(args); } - else if(strcmp(command, "RINGING") == 0){ - cmd_ringing(); - } else if(strcmp(command, "TRANSFER") == 0){ cmd_transfer(args); }