mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-08 12:34:53 +00:00
Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
48f5724c27
12 files changed
+181
-27
No files matched your search
@@ -1716,26 +1716,36 @@ void sofia_event_callback(nua_event_t event,
|
||||
switch_core_session_t *session;
|
||||
|
||||
if ((session = switch_core_session_locate(sofia_private->uuid))) {
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "detaching session %s\n", sofia_private->uuid);
|
||||
set_call_id(tech_pvt, sip);
|
||||
int end = 0;
|
||||
|
||||
if (!zstr(tech_pvt->call_id)) {
|
||||
tech_pvt->sofia_private = NULL;
|
||||
tech_pvt->nh = NULL;
|
||||
sofia_set_flag(tech_pvt, TFLAG_BYE);
|
||||
switch_mutex_lock(profile->flag_mutex);
|
||||
switch_core_hash_insert(profile->chat_hash, tech_pvt->call_id, strdup(switch_core_session_get_uuid(session)));
|
||||
switch_mutex_unlock(profile->flag_mutex);
|
||||
switch_core_session_rwunlock(session);
|
||||
} else {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND && !switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||
private_object_t *tech_pvt = switch_core_session_get_private(session);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "detaching session %s\n", sofia_private->uuid);
|
||||
|
||||
if (!zstr(tech_pvt->call_id)) {
|
||||
tech_pvt->sofia_private = NULL;
|
||||
tech_pvt->nh = NULL;
|
||||
sofia_set_flag(tech_pvt, TFLAG_BYE);
|
||||
switch_mutex_lock(profile->flag_mutex);
|
||||
switch_core_hash_insert(profile->chat_hash, tech_pvt->call_id, strdup(switch_core_session_get_uuid(session)));
|
||||
switch_mutex_unlock(profile->flag_mutex);
|
||||
} else {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
}
|
||||
|
||||
end++;
|
||||
}
|
||||
|
||||
switch_core_session_rwunlock(session);
|
||||
|
||||
if (end) {
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
goto end;
|
||||
break;
|
||||
case nua_i_invite:
|
||||
case nua_i_register:
|
||||
case nua_i_options:
|
||||
|
||||
@@ -2884,6 +2884,10 @@ void sofia_glue_deactivate_rtp(private_object_t *tech_pvt)
|
||||
switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force)
|
||||
{
|
||||
|
||||
if (!tech_pvt->video_rm_encoding) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (tech_pvt->video_read_codec.implementation && switch_core_codec_ready(&tech_pvt->video_read_codec)) {
|
||||
if (!force) {
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -2902,10 +2906,7 @@ switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int
|
||||
}
|
||||
}
|
||||
|
||||
if (!tech_pvt->video_rm_encoding) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "Can't load codec with no name?\n");
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (switch_core_codec_init(&tech_pvt->video_read_codec,
|
||||
tech_pvt->video_rm_encoding,
|
||||
@@ -3077,6 +3078,7 @@ switch_status_t sofia_glue_tech_set_codec(private_object_t *tech_pvt, int force)
|
||||
switch_core_session_unlock_codec_read(tech_pvt->session);
|
||||
}
|
||||
|
||||
sofia_glue_tech_set_video_codec(tech_pvt, force);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -5307,7 +5309,8 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
|
||||
|
||||
switch_snprintf(tmp, sizeof(tmp), "%d", tech_pvt->video_recv_pt);
|
||||
switch_channel_set_variable(tech_pvt->channel, "sip_video_recv_pt", tmp);
|
||||
|
||||
if (!match && vmatch) match = 1;
|
||||
|
||||
break;
|
||||
} else {
|
||||
vmatch = 0;
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
diff --git src/mod/xml_int/mod_xml_radius/mod_xml_radius.c src/mod/xml_int/mod_xml_radius/mod_xml_radius.c
|
||||
index 0707388..e9e6e2a 100644
|
||||
--- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c
|
||||
+++ src/mod/xml_int/mod_xml_radius/mod_xml_radius.c
|
||||
@@ -367,6 +367,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_time_t time = profile->times->created;
|
||||
switch_time_exp_t tm;
|
||||
|
||||
+ if ( !time ) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
switch_time_exp_lt(&tm, time);
|
||||
av_value = switch_mprintf("%04u-%02u-%02uT%02u:%02u:%02u.%06u%+03d%02d",
|
||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
||||
@@ -381,6 +385,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
|
||||
switch_time_t time = profile->times->answered;
|
||||
switch_time_exp_t tm;
|
||||
+
|
||||
+ if ( !time ) {
|
||||
+ goto err;
|
||||
+ }
|
||||
|
||||
switch_time_exp_lt(&tm, time);
|
||||
|
||||
@@ -397,6 +405,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
|
||||
switch_time_t time = profile->times->hungup;
|
||||
switch_time_exp_t tm;
|
||||
+
|
||||
+ if ( !time ) {
|
||||
+ goto err;
|
||||
+ }
|
||||
|
||||
switch_time_exp_lt(&tm, time);
|
||||
|
||||
diff --git src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml
|
||||
index eb3070c..6349d05 100644
|
||||
--- src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml
|
||||
+++ src/mod/xml_int/mod_xml_radius/xml_radius.conf.xml
|
||||
@@ -22,7 +22,7 @@
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="src-gw-ip=%s"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="sip_from_user" format="src-gw-name=%s"/>
|
||||
<param vendor="Cisco" name="h323-conf-id" variable="Core-UUID" format="%s"/>
|
||||
- <param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="number"/>
|
||||
+ <param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="request-type=number"/>
|
||||
<param name="Called-Station-Id" variable="sip_to_user" format="%s"/>
|
||||
<param name="Calling-Station-Id" variable="sip_from_user" format="%s"/>
|
||||
<param name="User-Name" variable="sip_from_user" format="%s"/>
|
||||
@@ -48,7 +48,7 @@
|
||||
<param name="seqfile" value="/var/run/radius.seq"/>
|
||||
</connection>
|
||||
<fields>
|
||||
- <param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="user"/>
|
||||
+ <param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="request-type=user"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="src-gw-ip=%s"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="sip_from_user" format="src-gw-name=%s"/>
|
||||
<param name="User-Name" variable="sip_from_user" format="%s"/>
|
||||
@@ -367,6 +367,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_time_t time = profile->times->created;
|
||||
switch_time_exp_t tm;
|
||||
|
||||
if ( !time ) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch_time_exp_lt(&tm, time);
|
||||
av_value = switch_mprintf("%04u-%02u-%02uT%02u:%02u:%02u.%06u%+03d%02d",
|
||||
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
|
||||
@@ -381,6 +385,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
|
||||
switch_time_t time = profile->times->answered;
|
||||
switch_time_exp_t tm;
|
||||
|
||||
if ( !time ) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch_time_exp_lt(&tm, time);
|
||||
|
||||
@@ -397,6 +405,10 @@ switch_status_t mod_xml_radius_add_params(switch_core_session_t *session, switch
|
||||
switch_caller_profile_t *profile = switch_channel_get_caller_profile(channel);
|
||||
switch_time_t time = profile->times->hungup;
|
||||
switch_time_exp_t tm;
|
||||
|
||||
if ( !time ) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch_time_exp_lt(&tm, time);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="src-gw-ip=%s"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="sip_from_user" format="src-gw-name=%s"/>
|
||||
<param vendor="Cisco" name="h323-conf-id" variable="Core-UUID" format="%s"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="number"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="request-type=number"/>
|
||||
<param name="Called-Station-Id" variable="sip_to_user" format="%s"/>
|
||||
<param name="Calling-Station-Id" variable="sip_from_user" format="%s"/>
|
||||
<param name="User-Name" variable="sip_from_user" format="%s"/>
|
||||
@@ -48,7 +48,7 @@
|
||||
<param name="seqfile" value="/var/run/radius.seq"/>
|
||||
</connection>
|
||||
<fields>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="user"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="request-type=user"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="ip" format="src-gw-ip=%s"/>
|
||||
<param vendor="Cisco" name="Cisco-AVPair" variable="sip_from_user" format="src-gw-name=%s"/>
|
||||
<param name="User-Name" variable="sip_from_user" format="%s"/>
|
||||
|
||||
Reference in new issue
Block a user