]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Applied the Sangoma patch to FS version 1.2 in order to port to FS v1.6+
authorWilliam King <william.king@quentustech.com>
Wed, 27 Jan 2016 04:05:47 +0000 (20:05 -0800)
committerWilliam King <william.king@quentustech.com>
Wed, 27 Jan 2016 04:20:34 +0000 (20:20 -0800)
Sourced from:
http://gitlab.sangoma.com/projects/CORE/repos/freetdm/browse/public_freeswitch/sangoma-FS-1.2.patch

libs/apr/include/apr_network_io.h
libs/apr/network_io/os2/sockopt.c
libs/apr/network_io/unix/sockopt.c
libs/apr/network_io/win32/sockopt.c
src/include/switch_apr.h
src/include/switch_core.h
src/include/switch_types.h
src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_apr.c
src/switch_core.c

index 24708c55ae627a99471efd0e4c16538069f89cab..1d65f1cb092ab8214e44503cb48bf9eccbe88527 100644 (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
index 101a952d9800586690c8c84716b480ce33c3abd1..85ff35331a1b73e506eb2269efde4b9ae0260d02 100644 (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;
index 3fc932f42f5e57a714537a9b76508dc68c4c5948..344b0484b4de6d82560661701dc43d8e4e78d7f7 100644 (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
index c8e670fa79e1ff1dea01a57b74d42999ac5c92ae..05ba19c9b88d2d56b25e02cb5bfe9d230bf83144 100644 (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;
index 5ab5d35e7e9318be40bac0481d8a45be102fccb8..82a25f3b00882ca53bd7661f8da65d26d291af18 100644 (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);
index 16669672e8f8faea579fad9c5f3cfcebf19e2f71..59430a1c6ad37de4464c400b2ef6d61e72609397 100644 (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);
index 1f2005dba9bd37f06cc37509f686d8f496138118..eab47a69dd49a9edcc19ffd6b32ecd64d1f86863 100644 (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,
index 2434b443e501c25a76fa817fa6009a4473a5076b..bb5d44b50a92ef1d0f21a2b4bde72a591c623453 100644 (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;
index 8407d42713af53a0d34dcce22cb5a506d65441c1..51db39727dbfd531fdaeaf8eff551cd9db5ed4af 100644 (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;
index 2d342fb33b026ea0b98e32ccb03c9e5fd900f2da..7ab24c7b8a73a7183b610d55982a0ab7fc9d294a 100644 (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