From 0f726e6d59f037f16ec85ea37d46b45d8c381278 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 7 Aug 2006 12:11:40 +0000 Subject: Added --auto-conf options in pjsua, also enable speex/3200, and set quality 5 to use large resampling filter git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@659 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/pjsua_app.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'pjsip-apps') diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index f76aebdd..4aaa212d 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -52,6 +52,7 @@ static struct app_config pjsua_conf_port_id wav_port; pj_bool_t auto_play; pj_bool_t auto_loop; + pj_bool_t auto_conf; unsigned ptime; unsigned auto_answer; unsigned duration; @@ -122,6 +123,7 @@ static void usage(void) puts (" --play-file=file Play WAV file in conference bridge"); puts (" --auto-play Automatically play the file (to incoming calls only)"); puts (" --auto-loop Automatically loop incoming RTP to outgoing RTP"); + puts (" --auto-conf Automatically put calls in conference with others"); puts (" --rtp-port=N Base port to try for RTP (default=4000)"); puts (" --quality=N Specify media quality (0-10, default=6)"); puts (" --ptime=MSEC Override codec ptime to MSEC (default=specific)"); @@ -580,6 +582,10 @@ static pj_status_t parse_args(int argc, char *argv[], cfg->auto_loop = 1; break; + case OPT_AUTO_CONF: + cfg->auto_conf = 1; + break; + case OPT_PLAY_FILE: cfg->wav_file = pj_str(pj_optarg); break; @@ -922,6 +928,8 @@ static int write_settings(const struct app_config *config, pj_strcat2(&cfg, "--auto-play\n"); if (config->auto_loop) pj_strcat2(&cfg, "--auto-loop\n"); + if (config->auto_conf) + pj_strcat2(&cfg, "--auto-conf\n"); if (config->wav_file.slen) { pj_ansi_sprintf(line, "--play-file %s\n", config->wav_file.ptr); @@ -1248,6 +1256,33 @@ static void on_call_media_state(pjsua_call_id call_id) connect_sound = PJ_FALSE; } + /* Put call in conference with other calls, if desired */ + if (app_config.auto_conf) { + pjsua_call_id call_ids[PJSUA_MAX_CALLS]; + unsigned call_cnt=0; + unsigned i; + + /* Get all calls, and establish media connection between + * this call and other calls. + */ + pjsua_enum_calls(call_ids, &call_cnt); + for (i=0; i