Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
A utility for reading from a raw TCP stream. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
A utility for reading from a raw TCP stream.
This application is intended for use when a raw TCP stream is desired to be used as a music on hold source for Asterisk. Some devices are capable of taking some kind of audio input and provide it as a raw TCP stream over the network, which is what inspired someone to fund this to be written. However, it would certainly be possible to write your own server application to provide music over a TCP stream from a centralized location.
This application is quite simple. It just reads the data from the TCP stream and dumps it straight to stdout. Due to the way Asterisk handles music on hold sources, this application checks to make sure writing to stdout will not be a blocking operation before doing so. If so, the data is just thrown away. This ensures that the stream will continue to be serviced, even if Asterisk is not currently using the source.
Definition in file streamplayer.c.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 62 of file streamplayer.c.
References buf, FD_SET, FD_ZERO, gethostbyname, and NULL.