]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
cleanup
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 30 Mar 2007 16:41:12 +0000 (16:41 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 30 Mar 2007 16:41:12 +0000 (16:41 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4807 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h
src/mod/codecs/mod_g729/mod_g729.c
src/mod/endpoints/mod_dingaling/Makefile
src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/switch_core_io.c

index ce664352d4a85b414e9f3aad822d44cf8a06faa1..2bef321db8b8252a9392f0406e4c390a429554ad 100644 (file)
@@ -180,6 +180,60 @@ switch_mutex_unlock(obj->flag_mutex);
 */
 #define switch_safe_free(it) if (it) {free(it);it=NULL;}
 
+
+/*!
+  \brief Test if one string is inside another with extra case checking
+  \param s the inner string
+  \param q the big string
+  \return SWITCH_TRUE or SWITCH_FALSE
+*/
+static inline switch_bool_t switch_strstr(char *s, char *q)
+{
+       char *p, *S = NULL, *Q = NULL;
+       switch_bool_t tf = SWITCH_FALSE;
+
+       if (strstr(s, q)) {
+               return SWITCH_TRUE;
+       }
+
+       S = strdup(s);
+       
+       assert(S != NULL);
+
+       for (p = S; p && *p; p++) {
+               *p = (char)toupper(*p);
+       }
+
+       if (strstr(S, q)) {
+               tf = SWITCH_TRUE;
+               goto done;
+       }
+
+       Q = strdup(q);
+       assert(Q != NULL);
+
+       for (p = Q; p && *p; p++) {
+               *p = (char)toupper(*p);
+       }
+       
+       if (strstr(s, Q)) {
+               tf = SWITCH_TRUE;
+               goto done;
+       }
+
+       if (strstr(S, Q)) {
+               tf = SWITCH_TRUE;
+               goto done;
+       }
+       
+ done:
+       switch_safe_free(S);
+       switch_safe_free(Q);
+
+       return tf;
+}
+
+
 /*!
   \brief Test for NULL or zero length string
   \param s the string to test
index 4995c3725c7e7f1686ce88fbe3f28a6f57989cb8..52909b43c727c90afdac3189dc8cb3cfd4cde29a 100644 (file)
@@ -154,10 +154,9 @@ static switch_status_t switch_g729_decode(switch_codec_t *codec,
 
        }
 
-
        if (encoded_data_len % 2 == 0) {
-
-               if (encoded_data_len % 12 == 0) {
+               
+               if (encoded_data_len == 2 || encoded_data_len % 12 == 0) {
                        return SWITCH_STATUS_BREAK;
                        //divisor = 12;
                        //plen = 10;
index c71b16c3fbe6a90f174de9d4d96064e8666e9e74..688ddf70c8b65b831a3e0d8171b9bc1cb9935e47 100644 (file)
@@ -1,13 +1,20 @@
 BASE=../../../..
 
-DING_DIR=$(BASE)/libs/libdingaling
-DINGLA=$(DING_DIR)/libdingaling.la
+LOCAL_CFLAGS     = `$(BASE)/libs/apr/apr-1-config --cflags --cppflags --includes`
+LOCAL_CFLAGS    += `$(BASE)/libs/apr-util/apu-1-config --includes`
 
-LOCAL_CFLAGS=-I$(DING_DIR)/src
-LOCAL_LIBADD=$(DINGLA)
+IKS_DIR=$(BASE)/libs/iksemel
+IKS_LA=$(IKS_DIR)/src/libiksemel.la
+DING_DIR=$(BASE)/libs/libdingaling
+LOCAL_CFLAGS += -I$(DING_DIR)/src -I$(BASE)/libs/iksemel/include
+LOCAL_OBJS=$(DING_DIR)/src/libdingaling.o $(IKS_LA)
 
 include $(BASE)/build/modmake.rules
 
-$(DINGLA): $(DING_DIR) $(DING_DIR)/.update
-       cd $(DING_DIR) && $(MAKE)
-       $(TOUCH_TARGET)
+$(IKS_LA): $(IKS_DIR) $(IKS_DIR)/.update
+       @cd $(IKS_DIR) && $(MAKE)
+       @$(TOUCH_TARGET)
+
+
+
+
index 5a80f22f11046e173ab3534f23823e1c15234413..49c2292280aaf8c41d95c4a260204d0a6f133799 100644 (file)
@@ -2167,28 +2167,31 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
                                break;
 
                        case LDL_SIGNAL_SUBSCRIBE:
+                               if (profile->user_flags & LDL_FLAG_COMPONENT && ldl_jid_domcmp(from, to)) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Attempt to add presence from/to our own domain [%s][%s]\n", from, to);
+                               } else {
+                                       if ((sql = switch_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';\n"
+                                                                                         "insert into subscriptions values('%q','%q','%q','%q');\n", from, to, from, to, msg, subject))) {
+                                               execute_sql(profile->dbname, sql, profile->mutex);
+                                               switch_core_db_free(sql);
+                                       }
 
-                               if ((sql = switch_mprintf("delete from subscriptions where sub_from='%q' and sub_to='%q';\n"
-                                                                                 "insert into subscriptions values('%q','%q','%q','%q');\n", from, to, from, to, msg, subject))) {
-                                       execute_sql(profile->dbname, sql, profile->mutex);
-                                       switch_core_db_free(sql);
-                               }
-
-                               if (is_special(to)) {
-                                       ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
-                               }
+                                       if (is_special(to)) {
+                                               ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
+                                       }
 #if 0
-                               if (is_special(to)) {
-                                       if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
-                                               //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
-                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
-                                               switch_event_fire(&event);
+                                       if (is_special(to)) {
+                                               if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+                                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
+                                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+                                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
+                                                       //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+                                                       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
+                                                       switch_event_fire(&event);
+                                               }
                                        }
-                               }
 #endif
+                               }
                                break;
                        case LDL_SIGNAL_ROSTER:
                                if (switch_event_create(&event, SWITCH_EVENT_ROSTER) == SWITCH_STATUS_SUCCESS) {
index e71a21fc2bad1ee62d10ec753fff8db78dcab63d..b42b8e55fbe244a9e794b24d78d6ab69eb3e7ef8 100644 (file)
@@ -133,6 +133,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                        case SWITCH_STATUS_NOOP:
                                status = SWITCH_STATUS_SUCCESS;
                                break;
+                       case SWITCH_STATUS_BREAK:
+                               memset(session->raw_read_frame.data, 255, read_frame->codec->implementation->bytes_per_frame);
+                               session->raw_read_frame.datalen = read_frame->codec->implementation->bytes_per_frame;
+                               session->raw_read_frame.samples = session->raw_read_frame.datalen / sizeof(int16_t);
+                               session->raw_read_frame.timestamp = read_frame->timestamp;
+                               session->raw_read_frame.rate = read_frame->rate;
+                               read_frame = &session->raw_read_frame;
+                               status = SWITCH_STATUS_SUCCESS;
+                               break;
                        default:
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s decoder error!\n", session->read_codec->codec_interface->interface_name);
                                goto done;