]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 3 May 2006 23:45:07 +0000 (23:45 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 3 May 2006 23:45:07 +0000 (23:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1333 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/mod/endpoints/mod_exosip/mod_exosip.c
src/switch_ivr.c

index 89ebe41b0549293eb1f1fb06331d94b2ec1a9e44..385d015fbb072709a6947ab59fde20502c86df6d 100644 (file)
@@ -141,6 +141,7 @@ struct private_object {
        switch_time_t next_desc;
        switch_time_t next_cand;
        char *stun_ip;
+       char *recip;
        uint16_t stun_port;
 };
 
@@ -709,11 +710,15 @@ static switch_status_t channel_waitfor_write(switch_core_session_t *session, int
 static switch_status_t channel_send_dtmf(switch_core_session_t *session, char *dtmf)
 {
        struct private_object *tech_pvt = NULL;
-       //char *digit;
+       char digits[80] = "";
 
        tech_pvt = switch_core_session_get_private(session);
        assert(tech_pvt != NULL);
 
+       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF [%s]\n", dtmf);
+       snprintf(digits, sizeof(digits), "+%s\n", dtmf);
+       ldl_handle_send_msg(tech_pvt->profile->handle, tech_pvt->recip, NULL, digits);
+       
 
        return SWITCH_STATUS_SUCCESS;
 }
@@ -757,6 +762,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
                }
                payload = tech_pvt->read_frame.payload;
 
+
                /* RFC2833 ... TBD try harder to honor the duration etc.*/
                if (payload == 101) {
                        unsigned char *packet = tech_pvt->read_frame.data;
@@ -778,10 +784,13 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
                                if (++tech_pvt->dc >= 3) {
                                        tech_pvt->last_digit = 0;
                                        tech_pvt->dc = 0;
-                               } else {
-                                       tech_pvt->last_digit = key;
                                }
-                       } 
+
+                               tech_pvt->last_digit = key;
+                       } else {
+                               tech_pvt->last_digit = 0;
+                               tech_pvt->dc = 0;
+                       }
                }
 
                if (switch_test_flag(&tech_pvt->read_frame, SFF_CNG)) {
@@ -1081,7 +1090,8 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session,
                        switch_core_session_destroy(new_session);
                        return SWITCH_STATUS_GENERR;
                }
-
+               
+               
                switch_core_session_add_stream(*new_session, NULL);
                if ((tech_pvt = (struct private_object *) switch_core_session_alloc(*new_session, sizeof(struct private_object))) != 0) {
                        memset(tech_pvt, 0, sizeof(*tech_pvt));
@@ -1092,6 +1102,7 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session,
                        tech_pvt->session = *new_session;
                        tech_pvt->codec_index = -1;
                        tech_pvt->local_port = switch_rtp_request_port();
+                       tech_pvt->recip = switch_core_session_strdup(*new_session, full_id);
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
                        switch_core_session_destroy(new_session);
@@ -1511,7 +1522,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
                                tech_pvt->profile = profile;
                                tech_pvt->local_port = switch_rtp_request_port();
                                switch_set_flag(tech_pvt, TFLAG_ANSWER);
-                               
+                               tech_pvt->recip = switch_core_session_strdup(session, from);
                        } else {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
                                switch_core_session_destroy(&session);
index 8d4690546409162e2c497512b507ac002ccfebbe..5a7a08c6b057c0f92f2995bc08555f4c3bdb53ee 100644 (file)
@@ -627,7 +627,7 @@ static switch_status_t exosip_read_frame(switch_core_session_t *session, switch_
                        }
                        
                        payload = tech_pvt->read_frame.payload;
-                       
+
 
                        elapsed = (unsigned int)((switch_time_now() - started) / 1000);
 
@@ -663,10 +663,13 @@ static switch_status_t exosip_read_frame(switch_core_session_t *session, switch_
                                        if (++tech_pvt->dc >= 3) {
                                                tech_pvt->last_digit = 0;
                                                tech_pvt->dc = 0;
-                                       } else {
-                                               tech_pvt->last_digit = key;
                                        }
-                               } 
+
+                                       tech_pvt->last_digit = key;
+                               } else {
+                                       tech_pvt->last_digit = 0;
+                                       tech_pvt->dc = 0;
+                               }
                        }
 
 
index 2e9971e34575b6c20b3efd62fb3e141796db34e8..f517fcd712bd9f47b34ee893857a9b0e51938b24 100644 (file)
@@ -121,7 +121,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_sess
                if (switch_channel_has_dtmf(channel)) {
                        char dtmf[128];
                        switch_channel_dequeue_dtmf(channel, dtmf, sizeof(dtmf));
-
                        for(i =0 ; i < (unsigned int) strlen(dtmf); i++) {
 
                                if (strchr(terminators, dtmf[i])) {