From d2e2a3c9c5ebc8d8a6e773cbf4b3fc7dbf5a6f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Poulin?= Date: Mon, 15 Feb 2021 09:11:59 -0500 Subject: [PATCH] [mod_sofia] add a define for custom NUA event 9999 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index e236b09a38..393bb43acc 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1539,7 +1539,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi tech_pvt->proxy_refer_uuid = (char *)msg->string_array_arg[0]; } else { switch_mutex_unlock(tech_pvt->sofia_mutex); - sofia_wait_for_reply(tech_pvt, 9999, 10); + sofia_wait_for_reply(tech_pvt, SOFIA_CUSTOM_NUA_EVENT_REFER, 10); switch_mutex_lock(tech_pvt->sofia_mutex); if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_refer_reply"))) { diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 3249533730..54fee79056 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -107,6 +107,7 @@ typedef struct private_object private_object_t; #define MY_EVENT_BYE_RESPONSE "sofia::bye_response" #define MULTICAST_EVENT "multicast::event" +#define SOFIA_CUSTOM_NUA_EVENT_REFER 9999 #define SOFIA_REPLACES_HEADER "_sofia_replaces_" #define SOFIA_CHAT_PROTO "sip" #define SOFIA_MULTIPART_PREFIX "sip_mp_" diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 7d8b2fe6eb..e3112791b1 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -711,7 +711,7 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status, if (status_val == 200) { switch_channel_hangup(channel, SWITCH_CAUSE_BLIND_TRANSFER); } - if ((int)tech_pvt->want_event == 9999) { + if ((int)tech_pvt->want_event == SOFIA_CUSTOM_NUA_EVENT_REFER) { tech_pvt->want_event = 0; } }