X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=main.c;fp=main.c;h=07cfb8f235451bb107a129898af39045aa441213;hp=84f357f492664f1081829b4e5a61d682707bb506;hb=863bc6421940efe897dfd6d610e1f86ed9992cf6;hpb=e9c834b844aa57b0af09c702c455d5b558b151d5 diff --git a/main.c b/main.c index 84f357f..07cfb8f 100644 --- a/main.c +++ b/main.c @@ -362,6 +362,12 @@ int main(int argc, char *argv[]) /* generate alaw / ulaw tables */ generate_tables(options.law); +#ifdef WITH_SIP + /* init SIP globals */ + sip_init(); + polling = 1; /* must poll, because of SIP events */ +#endif + #ifdef WITH_SS5 /* init ss5 sine tables */ ss5_sine_generate(); @@ -480,6 +486,10 @@ init is done when interface is up #else if (options.polling) { if (!select_main(1, NULL, NULL, NULL)) { +#ifdef WITH_SIP + /* FIXME: check if work was done */ + sip_handle(); +#endif usleep(10000); } } else @@ -600,6 +610,11 @@ exit is done when interface is down gsm_exit(0); #endif +#ifdef WITH_SIP + /* cleanup SIP globals */ + sip_exit(); +#endif + /* close loopback, if used by GSM or remote */ if (mISDNloop.sock > -1) mISDNloop_close();