zap_status_t status = ZAP_FAIL;
sangoma_boost_request_id_t r;
sangomabc_event_t event = {0};
- int sanity = 5000;
+ int boost_request_timeout = 5000;
sangoma_boost_request_status_t st;
char ani[128] = "";
char *gr = NULL;
uint32_t count = 0;
int tg=0;
-
if (zap_test_flag(span, ZAP_SPAN_SUSPENDED)) {
zap_log(ZAP_LOG_CRIT, "SPAN is not online.\n");
*zchan = NULL;
while(zap_running() && OUTBOUND_REQUESTS[r].status == BST_WAITING) {
zap_sleep(1);
- if (--sanity <= 0) {
+ if (--boost_request_timeout <= 0) {
status = ZAP_FAIL;
*zchan = NULL;
+ zap_log(ZAP_LOG_CRIT, "Timed out waiting for boost channel request response\n");
goto done;
}
- //printf("WTF %d\n", sanity);
}
if (OUTBOUND_REQUESTS[r].status == BST_READY && OUTBOUND_REQUESTS[r].zchan) {
if (sangoma_boost_data->sigmod->start_span(span) != ZAP_SUCCESS) {
return ZAP_FAIL;
}
+ zap_clear_flag(sangoma_boost_data, ZAP_SANGOMA_BOOST_RESTARTING);
+ zap_clear_flag_locked(span, ZAP_SPAN_SUSPENDED);
+ zap_clear_flag((&sangoma_boost_data->mcon), MSU_FLAG_DOWN);
}
sangoma_boost_data->pcon = sangoma_boost_data->mcon;
}
init_outgoing_array();
-
- sangomabc_exec_commandp(pcon,
- 0,
- 0,
- -1,
- SIGBOOST_EVENT_SYSTEM_RESTART,
- 0);
- zap_set_flag(mcon, MSU_FLAG_DOWN);
+ if (!sangoma_boost_data->sigmod) {
+ sangomabc_exec_commandp(pcon,
+ 0,
+ 0,
+ -1,
+ SIGBOOST_EVENT_SYSTEM_RESTART,
+ 0);
+ zap_set_flag(mcon, MSU_FLAG_DOWN);
+ }
while (zap_test_flag(sangoma_boost_data, ZAP_SANGOMA_BOOST_RUNNING)) {
sangomabc_event_t *event = NULL;
int activity = 0;
if (!zap_running()) {
- sangomabc_exec_commandp(pcon,
- 0,
- 0,
- -1,
- SIGBOOST_EVENT_SYSTEM_RESTART,
- 0);
- zap_set_flag(mcon, MSU_FLAG_DOWN);
+ if (!sangoma_boost_data->sigmod) {
+ sangomabc_exec_commandp(pcon,
+ 0,
+ 0,
+ -1,
+ SIGBOOST_EVENT_SYSTEM_RESTART,
+ 0);
+ zap_set_flag(mcon, MSU_FLAG_DOWN);
+ }
zap_log(ZAP_LOG_DEBUG, "zap is no longer running\n");
break;
}
{
if (event->event_id == SIGBOOST_EVENT_HEARTBEAT)
return;
- zap_log(file, func, line, ZAP_LOG_LEVEL_WARNING, "%s EVENT: %s:(%X) [w%dg%d] CSid=%i Seq=%i Cn=[%s] Cd=[%s] Ci=[%s]\n",
+ zap_log(file, func, line, ZAP_LOG_LEVEL_DEBUG, "%s EVENT: %s:(%X) [w%dg%d] CSid=%i Seq=%i Cn=[%s] Cd=[%s] Ci=[%s]\n",
dir ? "TX":"RX",
sangomabc_event_id_name(event->event_id),
event->event_id,
{
if (event->event_id == SIGBOOST_EVENT_HEARTBEAT)
return;
- zap_log(file, func, line, ZAP_LOG_LEVEL_WARNING, "%s EVENT (%s): %s:(%X) [w%dg%d] Rc=%i CSid=%i Seq=%i \n",
+ zap_log(file, func, line, ZAP_LOG_LEVEL_DEBUG, "%s EVENT (%s): %s:(%X) [w%dg%d] Rc=%i CSid=%i Seq=%i \n",
dir ? "TX":"RX",
priority ? "P":"N",
sangomabc_event_id_name(event->event_id),
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contributors:
+ *
+ * Moises Silva <moy@sangoma.com>
+ * David Yatzin <davidy@sangoma.com>
+ * Nenad Corbic <ncorbic@sangoma.com>
+ *
*/
#ifdef __sun
#define sangoma_create_socket_intr sangoma_open_api_span_chan
#endif
-/*! Starting with libsangoma 3 we can use the new libsangoma waitable API, the poor souls of those using a release were LIBSANGOMA version
+/*! Starting with libsangoma 3 we can use the new libsangoma waitable API, the poor souls of those using a release where LIBSANGOMA version
* is defined but the version is not higher or equal to 3.0.0 will be forced to upgrade
* */
#ifdef LIBSANGOMA_VERSION