]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
NC:
authorDavid Yat Sin <dyatsin@sangoma.com>
Fri, 5 Mar 2010 23:05:59 +0000 (23:05 +0000)
committerDavid Yat Sin <dyatsin@sangoma.com>
Fri, 5 Mar 2010 23:05:59 +0000 (23:05 +0000)
Added a sanity check on call start.
In case of know sangoma_isupd boost errors

Added Loop command to enable channel looping
on CCR tests in ss7.

Added hwec enable disable commands that are
available in CLI

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@1053 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
libs/openzap/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c

index ae79918b425358c53c0ad7e40c7b06fefb9649c0..a8609a0652be4348049652e7f355082b9f87e007 100644 (file)
@@ -728,6 +728,21 @@ static void handle_call_start(zap_span_t *span, sangomabc_connection_t *mcon, sa
        zap_channel_t *zchan;
 
        if (!(zchan = find_zchan(span, (sangomabc_short_event_t*)event, 0))) {
+               if ((zchan = find_zchan(span, (sangomabc_short_event_t*)event, 1))) {
+                       int r;
+                       if (zchan->state == ZAP_CHANNEL_STATE_UP) {
+                               zap_log(ZAP_LOG_CRIT, "ZCHAN STATE UP -> Changed to TERMINATING %d:%d\n", event->span+1,event->chan+1);
+                               zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r);
+                       } else if (zap_test_sflag(zchan, SFLAG_HANGUP)) { 
+                               zap_log(ZAP_LOG_CRIT, "ZCHAN STATE HANGUP -> Changed to HANGUP COMPLETE %d:%d\n", event->span+1,event->chan+1);
+                               zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE, 0, r);
+                       } else {
+                               zap_log(ZAP_LOG_CRIT, "ZCHAN STATE INVALID %s on IN CALL %d:%d\n", zap_channel_state2str(zchan->state),event->span+1,event->chan+1);
+
+                       }
+                       zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG);
+                       zchan=NULL;
+               }
                zap_log(ZAP_LOG_CRIT, "START CANT FIND CHAN %d:%d\n", event->span+1,event->chan+1);
                goto error;
        }
index fafa7a447cd65b2aea6ed3c4e6ad4f06930f3b91..58dfb86a8e07666c6f42e2022308f13f67f79dcd 100644 (file)
@@ -585,21 +585,41 @@ static ZIO_COMMAND_FUNCTION(wanpipe_command)
                break;
        case ZAP_COMMAND_ENABLE_ECHOCANCEL:
                {
-                       //code me
+                       err=sangoma_tdm_enable_hwec(zchan->sockfd, &tdm_api);
+                       if (err) {
+               snprintf(zchan->last_error, sizeof(zchan->last_error), "HWEC Enable Failed");
+                               return ZAP_FAIL;
+                       }
                }
                break;
        case ZAP_COMMAND_DISABLE_ECHOCANCEL:
                {
-                       //code me
+                       err=sangoma_tdm_disable_hwec(zchan->sockfd, &tdm_api);
+                       if (err) {
+               snprintf(zchan->last_error, sizeof(zchan->last_error), "HWEC Disable Failed");
+                               return ZAP_FAIL;
+                       }
                }
                break;
        case ZAP_COMMAND_ENABLE_LOOP:
                {
-                       // code me
+#ifdef WP_API_FEATURE_LOOP
+               err=sangoma_tdm_enable_loop(zchan->sockfd, &tdm_api);
+                       if (err) {
+                               snprintf(zchan->last_error, sizeof(zchan->last_error), "Loop Enable Failed");
+                               return ZAP_FAIL;
+                       }
+#endif         
                }
        case ZAP_COMMAND_DISABLE_LOOP:
                {
-                       // code me
+#ifdef WP_API_FEATURE_LOOP
+               err=sangoma_tdm_disable_loop(zchan->sockfd, &tdm_api);
+                       if (err) {
+                               snprintf(zchan->last_error, sizeof(zchan->last_error), "Loop Disable Failed");
+                               return ZAP_FAIL;
+                       }
+#endif  
                }
        case ZAP_COMMAND_SET_INTERVAL: 
                {