summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2bdb513)
It is only done when enabled by config or when any SIP interface is
created.
Thanx to Wimpy for catching this bug.
#endif
char tracetext[256], lock[128];
char options_error[256];
#endif
char tracetext[256], lock[128];
char options_error[256];
PERROR("%s", options_error);
goto free;
}
PERROR("%s", options_error);
goto free;
}
- polling = options.polling;
#ifdef WITH_MISDN
/* init mISDN */
#ifdef WITH_MISDN
/* init mISDN */
#ifdef WITH_SIP
/* init SIP globals */
sip_init();
#ifdef WITH_SIP
/* init SIP globals */
sip_init();
- polling = 1; /* must poll, because of SIP events */
+#ifdef WITH_SIP
+ if (options.polling || any_sip_interface) {
+#else
if (!select_main(1, NULL, NULL, NULL)) {
#ifdef WITH_SIP
/* FIXME: check if work was done */
if (!select_main(1, NULL, NULL, NULL)) {
#ifdef WITH_SIP
/* FIXME: check if work was done */
+int any_sip_interface = 0;
+
//pthread_mutex_t mutex_msg;
su_home_t sip_home[1];
//pthread_mutex_t mutex_msg;
su_home_t sip_home[1];
PDEBUG(DEBUG_SIP, "SIP interface created (inst=%p)\n", inst);
PDEBUG(DEBUG_SIP, "SIP interface created (inst=%p)\n", inst);
+ any_sip_interface = 1;
+
interface->sip_inst = NULL;
PDEBUG(DEBUG_SIP, "SIP interface removed\n");
interface->sip_inst = NULL;
PDEBUG(DEBUG_SIP, "SIP interface removed\n");
+
+ /* check if there is any other SIP interface left */
+ interface = interface_first;
+ while (interface) {
+ if (interface->sip_inst)
+ break;
+ interface = interface->next;
+ }
+ if (!interface)
+ any_sip_interface = 0;
}
extern su_log_t su_log_default[];
}
extern su_log_t su_log_default[];
#include <sofia-sip/nua.h>
#include <sofia-sip/nua.h>
+extern int any_sip_interface;
+
/* SIP port class */
class Psip : public Port
{
/* SIP port class */
class Psip : public Port
{