Hook up dummy phone app to commandline.c

This commit is contained in:
Daniel O'Connor 2012-04-23 20:58:28 +09:30
parent 98b614d9b4
commit 2188c807b2
3 changed files with 27 additions and 4 deletions

View File

@ -1110,6 +1110,10 @@ command_line_option command_line_options[]={
"End specified call (use vomp status to get list of calls)"},
{app_vomp_dial,{"vomp","dial","<sid>","<did>","[<callerid>]",NULL},0,
"Attempt to dial the specified sid and did. Optionally supply the calling number"},
#ifdef HAVE_VOIPTEST
{app_pa_phone,{"phone",NULL},0,
"Run phone test application"},
#endif
{NULL,{NULL}}
};

View File

@ -51,10 +51,25 @@ typedef struct {
} PaCtx;
static void freectx(PaCtx *ctx);
static int patestCallback(const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags,
void *userData);
static PaCtx *pa_phone_setup(void);
/* Declarations */
/* Prototypes */
void freectx(PaCtx *ctx);
int
app_pa_phone(int argc, const char *const *argv, struct command_line_option *o) {
PaCtx *ctx;
if ((ctx = pa_phone_setup()) == NULL)
return -1;
freectx(ctx);
return 0;
}
/* This routine will be called by the PortAudio engine when audio is needed.
** It may called at interrupt level on some machines so don't do anything
@ -102,7 +117,7 @@ patestCallback(const void *inputBuffer, void *outputBuffer,
return paContinue;
}
PaCtx *
static PaCtx *
pa_phone_setup(void) {
PaCtx *ctx;
int err, i, srcerr;
@ -211,7 +226,7 @@ pa_phone_setup(void) {
return NULL;
}
void
static void
freectx(PaCtx *ctx) {
/* Destroy mutex */
pthread_mutex_destroy(&ctx->mtx);

View File

@ -1322,3 +1322,7 @@ int app_vomp_dial(int argc, const char *const *argv, struct command_line_option
int app_vomp_pickup(int argc, const char *const *argv, struct command_line_option *o);
int app_vomp_hangup(int argc, const char *const *argv, struct command_line_option *o);
int app_vomp_monitor(int argc, const char *const *argv, struct command_line_option *o);
#ifdef HAVE_VOIPTEST
int app_pa_phone(int argc, const char *const *argv, struct command_line_option *o);
#endif