aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-07 15:15:59 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-07 15:15:59 +0000
commit9808717891a64f730a8364d9bb8901834975f225 (patch)
tree02cf82c9e5a4b2ce9837512cb7aee25f282e8bcb /apps
parent1097bad288a79e591b1e3b8bbe2265bcb387bbe0 (diff)
ensure buffer policy is restored after RAS is done with a channel (bug #4648)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/v1-0@6043 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_zapras.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/apps/app_zapras.c b/apps/app_zapras.c
index d835e12f8..09c93bdb1 100755
--- a/apps/app_zapras.c
+++ b/apps/app_zapras.c
@@ -125,8 +125,14 @@ static void run_ras(struct ast_channel *chan, char *args)
int status;
int res;
int signalled = 0;
- struct zt_bufferinfo bi;
+ struct zt_bufferinfo savebi;
int x;
+
+ res = ioctl(chan->fds[0], ZT_GET_BUFINFO, &savebi);
+ if(res) {
+ ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
+ return;
+ }
pid = spawn_ras(chan, args);
if (pid < 0) {
@@ -162,20 +168,11 @@ static void run_ras(struct ast_channel *chan, char *args)
x = 1;
ioctl(chan->fds[0], ZT_AUDIOMODE, &x);
- /* Double check buffering too */
- res = ioctl(chan->fds[0], ZT_GET_BUFINFO, &bi);
- if (!res) {
- /* XXX This is ZAP_BLOCKSIZE XXX */
- bi.bufsize = 204;
- bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
- bi.numbufs = 4;
- res = ioctl(chan->fds[0], ZT_SET_BUFINFO, &bi);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
- }
- } else
- ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
+ /* Restore saved values */
+ res = ioctl(chan->fds[0], ZT_SET_BUFINFO, &savebi);
+ if (res < 0) {
+ ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
+ }
break;
}
}