mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-03-10 22:43:54 +00:00
Hook up dummy phone app to commandline.c
This commit is contained in:
parent
98b614d9b4
commit
2188c807b2
@ -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}}
|
||||
};
|
||||
|
||||
|
23
pa_phone.c
23
pa_phone.c
@ -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);
|
||||
|
4
serval.h
4
serval.h
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user