Applied the Sangoma patch to FS version 1.2 in order to port to FS v1.6+

Sourced from:
http://gitlab.sangoma.com/projects/CORE/repos/freetdm/browse/public_freeswitch/sangoma-FS-1.2.patch
This commit is contained in:
William King 2016-01-26 20:05:47 -08:00
parent 41c73013e9
commit 320d5f2015
10 changed files with 98 additions and 0 deletions

View File

@ -631,6 +631,13 @@ APR_DECLARE(apr_status_t) apr_socket_timeout_set(apr_socket_t *sock,
APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
apr_int32_t opt, apr_int32_t *on);
/**
* Get Socket fd for the socket passed
* @param sock The socket to quesry for the socket fd
*/
APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock);
/**
* Query socket timeout for the specified socket
* @param sock The socket to query

View File

@ -110,6 +110,16 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
}
APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock)
{
if (sock) {
return sock->socketdes;
} else {
return 0;
}
}
APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
{
int oobmark;

View File

@ -344,6 +344,16 @@ apr_status_t apr_socket_opt_get(apr_socket_t *sock,
}
int apr_socket_fd_get(apr_socket_t *sock)
{
if (sock) {
return sock->socketdes;
} else {
return 0;
}
}
apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
{
#ifndef BEOS_R5

View File

@ -244,6 +244,16 @@ APR_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
}
APR_DECLARE(int) apr_socket_fd_get(apr_socket_t *sock)
{
if (sock) {
return sock->socketdes;
} else {
return 0;
}
}
APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
{
u_long oobmark;

View File

@ -1103,6 +1103,12 @@ SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t ** new_sock
*/
SWITCH_DECLARE(switch_status_t) switch_socket_connect(switch_socket_t *sock, switch_sockaddr_t *sa);
/**
* Get socket fd for the switch socket passed
* @param sock The socket we wish to have fd
*/
SWITCH_DECLARE(int) switch_socket_fd_get(switch_socket_t *sock);
SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa);
SWITCH_DECLARE(const char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
SWITCH_DECLARE(switch_status_t) switch_getnameinfo(char **hostname, switch_sockaddr_t *sa, int32_t flags);

View File

@ -2652,6 +2652,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
*/
SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force);
/*!
\brief Get RTP port range start value
\param[in] void
\param[out] RTP port range start value
*/
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port(void);
/*!
\brief Get RTP port range end value
\param[in] void
\param[out] RTP port range end value
*/
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port(void);
SWITCH_DECLARE(char *) switch_say_file_handle_get_variable(switch_say_file_handle_t *sh, const char *var);
SWITCH_DECLARE(char *) switch_say_file_handle_get_path(switch_say_file_handle_t *sh);

View File

@ -1049,6 +1049,7 @@ typedef enum {
SWITCH_MESSAGE_INDICATE_UNBRIDGE,
SWITCH_MESSAGE_INDICATE_TRANSFER,
SWITCH_MESSAGE_INDICATE_RINGING,
SWITCH_MESSAGE_INDICATE_ALERTING,
SWITCH_MESSAGE_INDICATE_MEDIA,
SWITCH_MESSAGE_INDICATE_3P_MEDIA,
SWITCH_MESSAGE_INDICATE_NOMEDIA,

View File

@ -2122,6 +2122,20 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
}
}
break;
case SWITCH_MESSAGE_INDICATE_ALERTING:
{
char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
const char *call_info = switch_channel_get_variable(channel, "presence_call_info_full");
char *cid = generate_pai_str(tech_pvt);
nua_respond(tech_pvt->nh, SIP_180_RINGING,
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
TAG_IF(cid, SIPTAG_HEADER_STR(cid)),
TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
SIPTAG_HEADER_STR("X-FS-Support: " FREESWITCH_SUPPORT)), TAG_END());
}
break;
case SWITCH_MESSAGE_INDICATE_RINGING:
{
switch_ring_ready_t ring_ready_val = msg->numeric_arg;

View File

@ -908,6 +908,11 @@ SWITCH_DECLARE(const char *) switch_get_addr(char *buf, switch_size_t len, switc
return buf;
}
SWITCH_DECLARE(int) switch_socket_fd_get(switch_socket_t *sock)
{
return apr_socket_fd_get(sock);
}
SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa)
{
return sa->port;

View File

@ -3275,6 +3275,28 @@ SWITCH_DECLARE(int) switch_stream_system(const char *cmd, switch_stream_handle_t
}
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port()
{
uint16_t start_port = 0;
/* By default pass rtp port range start value as zero in order to get actual
* RTP port range start value as configured */
start_port = (uint16_t)switch_rtp_set_start_port((switch_port_t)start_port);
return start_port;
}
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port()
{
uint16_t end_port = 0;
/* By default pass rtp port range end value as zero in order to get actual
* RTP port range end value as configured */
end_port = (uint16_t)switch_rtp_set_end_port((switch_port_t)end_port);
return end_port;
}
/* For Emacs:
* Local Variables:
* mode:c