Compare commits

...

3 Commits

Author SHA1 Message Date
Aron Podrigal 2acec6a9a5
Merge 6deca50592 into 3b58ebc5f3 2025-01-21 00:17:28 +00:00
junction1153b 3b58ebc5f3
[mod_sofia] Update Polycom UA to recognize new Poly phones
We observed that the new Poly phones (formerly known as Polycom) were not getting sent a SIP UPDATE in certain circumstances (example: retrieving a parked call, and therefore, Caller ID would not show the parked caller). I renamed Polycom to Poly which will catch all Poly AND Polycom UA's. I also added Acrobits, and Ringotel to extend such functionality to those UA's. There were also other minor compatibility issues with the new Poly phones which have been resolved with tweaking the UA recognition on the code.

Co-authored-by: Joseph <junction1153@gmail.com>
2025-01-21 00:57:25 +03:00
Aron Podrigal 6deca50592 Add "record-wait-mod" flag to control auto recording behavior
Introduced a new conference flag, CFLAG_RECORD_WAIT_MOD, to delay auto recording until a moderator joins. Updated relevant logic to test and clear this flag based on moderator presence and participant count. This enhances flexibility in managing recording settings for moderated conferences.
2025-01-15 14:16:31 -06:00
8 changed files with 19 additions and 7 deletions

View File

@ -903,6 +903,9 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
conference_utils_clear_flag(conference, CFLAG_WAIT_MOD); conference_utils_clear_flag(conference, CFLAG_WAIT_MOD);
} }
if (conference_utils_test_flag(conference, CFLAG_RECORD_WAIT_MOD) && conference_utils_member_test_flag(member, MFLAG_MOD)) {
conference_utils_clear_flag(conference, CFLAG_RECORD_WAIT_MOD);
}
if (conference->count > 1) { if (conference->count > 1) {
if (((conference->moh_sound || conference->tmp_moh_sound) && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) || if (((conference->moh_sound || conference->tmp_moh_sound) && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) ||
(conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) { (conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) {

View File

@ -190,6 +190,8 @@ void conference_utils_set_cflags(const char *flags, conference_flag_t *f)
for (i = 0; i < argc && argv[i]; i++) { for (i = 0; i < argc && argv[i]; i++) {
if (!strcasecmp(argv[i], "wait-mod")) { if (!strcasecmp(argv[i], "wait-mod")) {
f[CFLAG_WAIT_MOD] = 1; f[CFLAG_WAIT_MOD] = 1;
} else if (!strcasecmp(argv[i], "record-wait-mod")) {
f[CFLAG_RECORD_WAIT_MOD] = 1;
} else if (!strcasecmp(argv[i], "video-floor-only")) { } else if (!strcasecmp(argv[i], "video-floor-only")) {
f[CFLAG_VID_FLOOR] = 1; f[CFLAG_VID_FLOOR] = 1;
} else if (!strcasecmp(argv[i], "audio-always")) { } else if (!strcasecmp(argv[i], "audio-always")) {

View File

@ -433,7 +433,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
} }
/* Start auto recording if there's the minimum number of required participants. */ /* Start auto recording if there's the minimum number of required participants. */
if (conference->auto_record && !conference->auto_recording && (conference->count >= conference->min_recording_participants)) { if (conference->auto_record && !conference->auto_recording && (conference->count >= conference->min_recording_participants) && !conference_utils_test_flag(conference, CFLAG_RECORD_WAIT_MOD)) {
conference->auto_recording++; conference->auto_recording++;
conference->record_count++; conference->record_count++;
imember = conference->members; imember = conference->members;
@ -1175,6 +1175,10 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
switch_xml_set_attr_d(x_conference, "wait_mod", "true"); switch_xml_set_attr_d(x_conference, "wait_mod", "true");
} }
if (conference_utils_test_flag(conference, CFLAG_RECORD_WAIT_MOD)) {
switch_xml_set_attr_d(x_conference, "record_wait_mod", "true");
}
if (conference_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) { if (conference_utils_test_flag(conference, CFLAG_AUDIO_ALWAYS)) {
switch_xml_set_attr_d(x_conference, "audio_always", "true"); switch_xml_set_attr_d(x_conference, "audio_always", "true");
} }

View File

@ -258,6 +258,7 @@ typedef enum {
CFLAG_NO_MOH, CFLAG_NO_MOH,
CFLAG_DED_VID_LAYER_AUDIO_FLOOR, CFLAG_DED_VID_LAYER_AUDIO_FLOOR,
CFLAG_BREAKABLE, CFLAG_BREAKABLE,
CFLAG_RECORD_WAIT_MOD,
///////////////////////////////// /////////////////////////////////
CFLAG_MAX CFLAG_MAX
} conference_flag_t; } conference_flag_t;

View File

@ -254,7 +254,7 @@ char *generate_pai_str(private_object_t *tech_pvt)
callee_number = switch_sanitize_number(switch_core_session_strdup(session, callee_number)); callee_number = switch_sanitize_number(switch_core_session_strdup(session, callee_number));
callee_name = switch_sanitize_number(switch_core_session_strdup(session, callee_name)); callee_name = switch_sanitize_number(switch_core_session_strdup(session, callee_name));
if (!zstr(callee_number) && (zstr(ua) || !switch_stristr("polycom", ua))) { if (!zstr(callee_number) && (zstr(ua) || !switch_stristr("poly", ua))) {
callee_number = switch_core_session_sprintf(session, "sip:%s@%s", callee_number, host); callee_number = switch_core_session_sprintf(session, "sip:%s@%s", callee_number, host);
} }
@ -2075,13 +2075,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), SIPTAG_PAYLOAD_STR(message), TAG_END()); TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)), SIPTAG_PAYLOAD_STR(message), TAG_END());
} else if (update_allowed && ua && (switch_channel_var_true(tech_pvt->channel, "update_ignore_ua") || } else if (update_allowed && ua && (switch_channel_var_true(tech_pvt->channel, "update_ignore_ua") ||
switch_stristr("polycom", ua) || switch_stristr("poly", ua) ||
(switch_stristr("aastra", ua) && !switch_stristr("Intelligate", ua)) || (switch_stristr("aastra", ua) && !switch_stristr("Intelligate", ua)) ||
(switch_stristr("cisco/spa50", ua) || (switch_stristr("cisco/spa50", ua) ||
switch_stristr("cisco/spa525", ua)) || switch_stristr("cisco/spa525", ua)) ||
switch_stristr("cisco/spa30", ua) || switch_stristr("cisco/spa30", ua) ||
switch_stristr("Fanvil", ua) || switch_stristr("Fanvil", ua) ||
switch_stristr("Grandstream", ua) || switch_stristr("Grandstream", ua) ||
switch_stristr("Ringotel", ua) ||
switch_stristr("Groundwire", ua) ||
switch_stristr("Yealink", ua) || switch_stristr("Yealink", ua) ||
switch_stristr("Mitel", ua) || switch_stristr("Mitel", ua) ||
switch_stristr("Panasonic", ua))) { switch_stristr("Panasonic", ua))) {
@ -2152,7 +2154,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
SIPTAG_PAYLOAD_STR(message), SIPTAG_PAYLOAD_STR(message),
TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)), TAG_IF(!zstr(session_id_header), SIPTAG_HEADER_STR(session_id_header)),
TAG_END()); TAG_END());
} else if (ua && switch_stristr("polycom", ua)) { } else if (ua && switch_stristr("poly", ua)) {
snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", msg->string_arg, tech_pvt->caller_profile->destination_number); snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", msg->string_arg, tech_pvt->caller_profile->destination_number);
nua_update(tech_pvt->nh, nua_update(tech_pvt->nh,
NUTAG_SESSION_TIMER(tech_pvt->session_timeout), NUTAG_SESSION_TIMER(tech_pvt->session_timeout),

View File

@ -10476,7 +10476,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
(!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) && (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) &&
profile->server_rport_level >= 2 && sip->sip_user_agent && profile->server_rport_level >= 2 && sip->sip_user_agent &&
sip->sip_user_agent->g_string && sip->sip_user_agent->g_string &&
(!strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20))) (!strncasecmp(sip->sip_user_agent->g_string, "Poly", 4) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20)))
) { ) {
if (sip->sip_via) { if (sip->sip_via) {
const char *port = sip->sip_via->v_port; const char *port = sip->sip_via->v_port;

View File

@ -2501,7 +2501,7 @@ static char *gen_pidf(char *user_agent, char *id, char *url, char *open, char *r
{ {
char *ret = NULL; char *ret = NULL;
if (switch_stristr("polycom", user_agent)) { if (switch_stristr("poly", user_agent)) {
*ct = "application/xpidf+xml"; *ct = "application/xpidf+xml";
/* If unknown/none prpid is provided, just show the user as online. */ /* If unknown/none prpid is provided, just show the user as online. */

View File

@ -1661,7 +1661,7 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
if (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) && if (!is_tcp && !is_tls && (zstr(network_ip) || !switch_check_network_list_ip(network_ip, profile->local_network)) &&
profile->server_rport_level >= 2 && sip->sip_user_agent && profile->server_rport_level >= 2 && sip->sip_user_agent &&
sip->sip_user_agent->g_string && sip->sip_user_agent->g_string &&
( !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7) || ( !strncasecmp(sip->sip_user_agent->g_string, "Poly", 4) ||
!strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) || !strncasecmp(sip->sip_user_agent->g_string, "KIRK Wireless Server", 20) ||
!strncasecmp(sip->sip_user_agent->g_string, "ADTRAN_Total_Access", 19) )) { !strncasecmp(sip->sip_user_agent->g_string, "ADTRAN_Total_Access", 19) )) {
if (sip->sip_via) { if (sip->sip_via) {