]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Skinny: Initial Windows support
authorMathieu Parent <math.parent@gmail.com>
Thu, 20 May 2010 21:19:10 +0000 (23:19 +0200)
committerMathieu Parent <math.parent@gmail.com>
Thu, 20 May 2010 21:19:10 +0000 (23:19 +0200)
Thanks to Peter Olsson

Closes: MODSKINNY-3
Freeswitch.2008.sln
src/mod/endpoints/mod_skinny/mod_skinny.c
src/mod/endpoints/mod_skinny/skinny_server.c
src/mod/endpoints/mod_skinny/skinny_tables.h

index 506e22769638bbd3b60aae25b982013d6d042c5e..2126cb215286b0ef71c72b0c7304db914b815202 100644 (file)
@@ -947,6 +947,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_opal", "src\mod\endpoin
                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skinny", "src\mod\endpoints\mod_skinny\mod_skinny_2008.vcproj", "{CC1DD008-9406-448d-A0AD-33C3186CFADB}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+       EndProjectSection\r
+EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "libs\spandsp\src\msvc\make_at_dictionary.2008.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"\r
 EndProject\r
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "libs\spandsp\src\msvc\make_modem_filter.2008.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"\r
@@ -2394,6 +2399,13 @@ Global
                {05C9FB27-480E-4D53-B3B7-6338E2526666}.Debug|x64.ActiveCfg = Debug|Win32\r
                {05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|Win32.ActiveCfg = Release|Win32\r
                {05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|x64.ActiveCfg = Release|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.All|Win32.ActiveCfg = Release|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.All|Win32.Build.0 = Release|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.All|x64.ActiveCfg = Release|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.Release|Win32.ActiveCfg = Release|Win32\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB}.Release|x64.ActiveCfg = Release|Win32\r
                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32\r
                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32\r
                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32\r
@@ -2770,6 +2782,7 @@ Global
                {0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}\r
                {B3F424EC-3D8F-417C-B244-3919D5E1A577} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}\r
                {05C9FB27-480E-4D53-B3B7-6338E2526666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}\r
+               {CC1DD008-9406-448d-A0AD-33C3186CFADB} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}\r
                {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}\r
                {30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
                {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
index 4e493b3a3b539e1eaa2c2e92c46023cc398a3947..df0aaddbf2756d8d45489465ac037f715ece24aa 100644 (file)
@@ -145,8 +145,10 @@ skinny_profile_t *skinny_find_profile(const char *profile_name)
 
 switch_status_t skinny_profile_find_listener_by_device_name(skinny_profile_t *profile, const char *device_name, listener_t **listener)
 {
+       listener_t *l;
+
        switch_mutex_lock(profile->listener_mutex);
-       for (listener_t *l = profile->listeners; l; l = l->next) {
+       for (l = profile->listeners; l; l = l->next) {
                if (!strcmp(l->device_name, device_name)) {
                        *listener = l;
                }
@@ -158,8 +160,10 @@ switch_status_t skinny_profile_find_listener_by_device_name(skinny_profile_t *pr
 
 switch_status_t skinny_profile_find_listener_by_device_name_and_instance(skinny_profile_t *profile, const char *device_name, uint32_t device_instance, listener_t **listener)
 {
+       listener_t *l;
+
        switch_mutex_lock(profile->listener_mutex);
-       for (listener_t *l = profile->listeners; l; l = l->next) {
+       for (l = profile->listeners; l; l = l->next) {
                if (!strcmp(l->device_name, device_name) && (l->device_instance == device_instance)) {
                        *listener = l;
                }
@@ -1084,9 +1088,7 @@ switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, swi
 
 switch_status_t channel_receive_event(switch_core_session_t *session, switch_event_t *event)
 {
-       struct private_object *tech_pvt = switch_core_session_get_private(session);
        char *body = switch_event_get_body(event);
-       switch_assert(tech_pvt != NULL);
 
        if (!body) {
                body = "";
index 73a4aab995bb89c51671705a563883601cd4d279..7c3c089e30f9751638deae7b28a1895215ed9d48 100644 (file)
@@ -1324,6 +1324,7 @@ switch_status_t skinny_handle_button_template_request(listener_t *listener, skin
        struct button_template_helper helper = {0};
        skinny_profile_t *profile;
        char *sql;
+       int i;
 
        switch_assert(listener->profile);
        switch_assert(listener->device_name);
@@ -1367,7 +1368,7 @@ switch_status_t skinny_handle_button_template_request(listener_t *listener, skin
        }
 
        /* Fill remaining buttons with Undefined */
-       for(int i = 0; i+1 < helper.max_position; i++) {
+       for(i = 0; i+1 < helper.max_position; i++) {
                if(message->data.button_template.btn[i].button_definition == SKINNY_BUTTON_UNKNOWN) {
                        message->data.button_template.btn[i].instance_number = ++helper.count[SKINNY_BUTTON_UNDEFINED];
                        message->data.button_template.btn[i].button_definition = SKINNY_BUTTON_UNDEFINED;
@@ -1546,7 +1547,11 @@ switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *liste
                                                  tech_pvt->agreed_pt,
                                                  tech_pvt->read_impl.microseconds_per_packet / 1000,
                                                  switch_rtp_ready(tech_pvt->rtp_session) ? "SUCCESS" : err);
+#ifdef WIN32
+               addr.s_addr = inet_addr((uint16_t) tech_pvt->local_sdp_audio_ip);
+#else
                inet_aton(tech_pvt->local_sdp_audio_ip, &addr);
+#endif
                send_start_media_transmission(listener,
                        tech_pvt->call_id, /* uint32_t conference_id, */
                        tech_pvt->party_id, /* uint32_t pass_thru_party_id, */
index 5efd7746488bb50e6966153481c60e0171d49d5f..d3b369bb1448c6ce4b9dc02bdf3ad0efd8111a29 100644 (file)
@@ -44,8 +44,9 @@ struct skinny_table {
 const char *func(uint32_t id) \
 { \
     const char *str = DEFAULT_STR; \
+    uint8_t x; \
     \
-    for (uint8_t x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
+    for (x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
            if (TABLE[x].id == id) {\
                    str = TABLE[x].name;\
                    break;\
@@ -58,12 +59,13 @@ const char *func(uint32_t id) \
 #define SKINNY_DECLARE_STR2ID(func, TABLE, DEFAULT_ID) \
 uint32_t func(const char *str)\
 {\
-    uint32_t id = DEFAULT_ID;\
+    uint32_t id = (uint32_t) DEFAULT_ID;\
     \
     if (*str > 47 && *str < 58) {\
            id = atoi(str);\
     } else {\
-           for (uint8_t x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1 && TABLE[x].name; x++) {\
+           uint8_t x;\
+           for (x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1 && TABLE[x].name; x++) {\
                    if (!strcasecmp(TABLE[x].name, str)) {\
                            id = TABLE[x].id;\
                            break;\
@@ -75,7 +77,8 @@ uint32_t func(const char *str)\
 
 #define SKINNY_DECLARE_PUSH_MATCH(TABLE) \
     switch_console_callback_match_t *my_matches = NULL;\
-    for (uint8_t x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
+    uint8_t x;\
+    for (x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
            switch_console_push_match(&my_matches, TABLE[x].name);\
     }\
     if (my_matches) {\