siproc

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

commit 50c36d24da7e233ea641a888a58c86ad57f2cfd3
parent ca6a0833c2817ac4fcccd41edbb886a2b756d7aa
Author: Dominik Schmidt <dominik@schm1dt.ch>
Date:   Sun, 21 Jul 2019 23:25:11 +0200

Initialize the accountconfig after endpoint initialization

Otherwise, things seem to break down with the error:

```
pjsip_timer_init_session: Assertion `setting->min_se >= 90' failed.
```

But only when called, not earlier. Very strange, in deed.

Diffstat:
src/siproc.cpp | 17++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/siproc.cpp b/src/siproc.cpp @@ -350,9 +350,8 @@ void usage(){ int main(int argc, char **argv){ - AccountConfig acfg; - char *user,*password; + char *user,*password,*idUri,*reguri; if(!(user = getenv("SIPROC_USERNAME"))){ fprintf(stderr, "SIPROC_USERNAME not in environment variables\n\n"); @@ -365,20 +364,13 @@ int main(int argc, char **argv){ return 1; } - if(char *reguri = getenv("SIPROC_REGISTRAR_URI")){ - acfg.regConfig.registrarUri = reguri; - } - else{ + if(!(reguri = getenv("SIPROC_REGISTRAR_URI"))){ fprintf(stderr, "SIPROC_REGISTRAR_URI not in environment variables\n\n"); usage(); return 1; } - if(char *idUri = getenv("SIPROC_ID_URI")){ - //acfg.idUri = "\"Testphone\" <sip:Dominik9@fritz.box>"; - acfg.idUri = idUri; - } - else{ + if(!(idUri = getenv("SIPROC_ID_URI"))){ fprintf(stderr, "SIPROC_ID_URI not in environment variables\n\n"); usage(); return 1; @@ -404,6 +396,9 @@ int main(int argc, char **argv){ ep.libStart(); + AccountConfig acfg; + acfg.idUri = idUri; + acfg.regConfig.registrarUri = reguri; //acfg.regConfig.registrarUri = "sip:fritz.box"; //AuthCredInfo cred("digest", "*", "Dominik9", 0, "12345678"); AuthCredInfo cred("digest", "*", user, 0, password);