]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ftmod_zt: B-Channels need to have audio mode disabled upon closing the channel.
authorStefan Knoblich <s.knoblich@axsentis.de>
Sun, 14 Nov 2010 22:38:16 +0000 (23:38 +0100)
committerStefan Knoblich <s.knoblich@axsentis.de>
Sun, 14 Nov 2010 22:38:16 +0000 (23:38 +0100)
Preparation for fixing channel handling for BRI PTMP (Point-To-MultiPoint) setups.

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
libs/freetdm/src/ftmod/ftmod_zt/ftmod_zt.c

index 692b505716aa84e3b1f738a8c01274ee29818341..ddf7b3ffab4fbffdbbda1023d34f012c982c7db8 100644 (file)
@@ -658,6 +658,14 @@ static FIO_OPEN_FUNCTION(zt_open)
  */
 static FIO_CLOSE_FUNCTION(zt_close)
 {
+       if (ftdmchan->type == FTDM_CHAN_TYPE_B) {
+               int value = 0;  /* disable audio mode */
+               if (ioctl(ftdmchan->sockfd, codes.AUDIOMODE, &value)) {
+                       snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "%s", strerror(errno));
+                       ftdm_log(FTDM_LOG_ERROR, "%s\n", ftdmchan->last_error);
+                       return FTDM_FAIL;
+               }
+       }
        return FTDM_SUCCESS;
 }