diff --git a/libs/openzap/src/include/openzap.h b/libs/openzap/src/include/openzap.h index cfbf065b06..d773970fb5 100644 --- a/libs/openzap/src/include/openzap.h +++ b/libs/openzap/src/include/openzap.h @@ -269,6 +269,18 @@ #pragma warning(disable:4127) #endif +#define zap_set_state_locked_wait(obj, s) \ + do { \ + int __safety = 100; \ + zap_set_state_locked(obj, s); \ + while(__safety-- && zap_test_flag(obj, ZAP_CHANNEL_STATE_CHANGE)) { \ + zap_sleep(10); \ + } \ + if(!__safety) { \ + zap_log(ZAP_LOG_CRIT, "State change not completed\n"); \ + } \ + } while(0); + #define zap_wait_for_flag_cleared(obj, flag, time) \ do { \ int __safety = time; \ @@ -288,19 +300,6 @@ zap_wait_for_flag_cleared(obj, ZAP_CHANNEL_STATE_CHANGE, 100); \ } while(0); -#define zap_set_state_locked_wait(obj, s) \ - do { \ - int __safety = 100; \ - zap_set_state_locked(obj, s); \ - while(__safety-- && zap_test_flag(obj, ZAP_CHANNEL_STATE_CHANGE)) { \ - zap_sleep(10); \ - } \ - if(!__safety) { \ - zap_log(ZAP_LOG_CRIT, "State change not completed\n"); \ - } \ - } while(0); - - typedef enum { ZAP_STATE_CHANGE_FAIL, diff --git a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c index 4c4caffb9b..98e00f809b 100644 --- a/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c +++ b/libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c @@ -626,7 +626,7 @@ static void handle_call_start_nack(zap_span_t *span, sangomabc_connection_t *mco int r = 0; assert(!zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND)); - zchan->call_data = (void*)event->event_id; + zchan->call_data = (void*)(intptr_t)event->event_id; zap_mutex_lock(zchan->mutex); zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); @@ -992,7 +992,7 @@ static __inline__ void state_advance(zap_channel_t *zchan) if (!zap_test_sflag(zchan, SFLAG_SENT_FINAL_MSG)) { zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); - if (zchan->call_data && ((uint32_t)zchan->call_data == SIGBOOST_EVENT_CALL_START_NACK)) { + if (zchan->call_data && ((uint32_t)(intptr_t)zchan->call_data == SIGBOOST_EVENT_CALL_START_NACK)) { sangomabc_exec_command(mcon, zchan->physical_span_id-1, zchan->physical_chan_id-1,