1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-04-13 07:45:26 +00:00

Merge pull request in FS/freeswitch from freetdm_patch to master

* commit '320d5f2015976fed9ca282dfeeb2bd3e977e6f76':
  Applied the Sangoma patch to FS version 1.2 in order to port to FS v1.6+
This commit is contained in:
Mike Jerris 2016-04-04 13:51:09 -05:00
commit a74fc71b67
10 changed files with 98 additions and 0 deletions

@ -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_DECLARE(apr_status_t) apr_socket_opt_get(apr_socket_t *sock,
apr_int32_t opt, apr_int32_t *on); 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 * Query socket timeout for the specified socket
* @param sock The socket to query * @param sock The socket to query

@ -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) APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
{ {
int oobmark; int oobmark;

@ -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) apr_status_t apr_socket_atmark(apr_socket_t *sock, int *atmark)
{ {
#ifndef BEOS_R5 #ifndef BEOS_R5

@ -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) APR_DECLARE(apr_status_t) apr_socket_atmark(apr_socket_t *sock, int *atmark)
{ {
u_long oobmark; u_long oobmark;

@ -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); 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(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(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); SWITCH_DECLARE(switch_status_t) switch_getnameinfo(char **hostname, switch_sockaddr_t *sa, int32_t flags);

@ -2654,6 +2654,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); 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_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); SWITCH_DECLARE(char *) switch_say_file_handle_get_path(switch_say_file_handle_t *sh);

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

@ -2133,6 +2133,20 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
} }
} }
break; 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: case SWITCH_MESSAGE_INDICATE_RINGING:
{ {
switch_ring_ready_t ring_ready_val = msg->numeric_arg; switch_ring_ready_t ring_ready_val = msg->numeric_arg;

@ -908,6 +908,11 @@ SWITCH_DECLARE(const char *) switch_get_addr(char *buf, switch_size_t len, switc
return buf; 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) SWITCH_DECLARE(uint16_t) switch_sockaddr_get_port(switch_sockaddr_t *sa)
{ {
return sa->port; return sa->port;

@ -3281,6 +3281,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: /* For Emacs:
* Local Variables: * Local Variables:
* mode:c * mode:c