Skip to content
Snippets Groups Projects
channel.c 27 KiB
Newer Older
  • Learn to ignore specific revisions
  • Mark Spencer's avatar
    Mark Spencer committed
    						res =  0;
    						break;
    					} else
    						goto tackygoto;
    
    Mark Spencer's avatar
    Mark Spencer committed
    				}
    			} else {
    #if 0
    				ast_log(LOG_DEBUG, "Read from %s\n", who->name);
    				if (who == last) 
    					ast_log(LOG_DEBUG, "Servicing channel %s twice in a row?\n", last->name);
    				last = who;
    #endif
    
    Mark Spencer's avatar
    Mark Spencer committed
    tackygoto:
    
    Mark Spencer's avatar
    Mark Spencer committed
    				if (who == c0) 
    					ast_write(c1, f);
    				else 
    					ast_write(c0, f);
    			}
    			ast_frfree(f);
    		} else
    			ast_frfree(f);
    		/* Swap who gets priority */
    		cs[2] = cs[0];
    		cs[0] = cs[1];
    		cs[1] = cs[2];
    	}
    
    Mark Spencer's avatar
    Mark Spencer committed
    	c0->bridge = NULL;
    	c1->bridge = NULL;
    	return res;
    }
    
    int ast_channel_setoption(struct ast_channel *chan, int option, void *data, int datalen, int block)
    {
    	int res;
    	if (chan->pvt->setoption) {
    		res = chan->pvt->setoption(chan, option, data, datalen);
    		if (res < 0)
    			return res;
    	} else {
    		errno = ENOSYS;
    		return -1;
    	}
    	if (block) {
    		/* XXX Implement blocking -- just wait for our option frame reply, discarding
    		   intermediate packets. XXX */
    		ast_log(LOG_ERROR, "XXX Blocking not implemented yet XXX\n");
    		return -1;
    	}
    
    Mark Spencer's avatar
    Mark Spencer committed
    	return 0;
    }