static int core_config_template(struct re_printf *pf, const struct config *cfg) { int err = 0; if (!cfg) return 0; err |= re_hprintf(pf, "\n# Core\n" "poll_method\t\t%s\t\t# poll, select" #ifdef HAVE_EPOLL ", epoll .." #endif #ifdef HAVE_KQUEUE ", kqueue .." #endif "\n" "\n# SIP\n" "sip_trans_bsize\t\t128\n" "#sip_listen\t\t0.0.0.0:5060\n" "#sip_certificate\tcert.pem\n" "\n" "# Call\n" "call_local_timeout\t%u\n" "\n" "# Audio\n" "#audio_path\t\t/usr/share/baresip\n" "audio_player\t\t%s\n" "audio_source\t\t%s\n" "audio_alert\t\t%s\n" "audio_srate\t\t%u-%u\n" "audio_channels\t\t%u-%u\n" "#ausrc_srate\t\t48000\n" "#auplay_srate\t\t48000\n" "#ausrc_channels\t\t0\n" "#auplay_channels\t\t0\n" , poll_method_name(poll_method_best()), cfg->call.local_timeout, default_audio_device(), default_audio_device(), default_audio_device(), cfg->audio.srate.min, cfg->audio.srate.max, cfg->audio.channels.min, cfg->audio.channels.max); #ifdef USE_VIDEO err |= re_hprintf(pf, "\n# Video\n" "#video_source\t\t%s\n" "#video_display\t\t%s\n" "video_size\t\t%dx%d\n" "video_bitrate\t\t%u\n" "video_fps\t\t%u\n", default_video_device(), default_video_display(), cfg->video.width, cfg->video.height, cfg->video.bitrate, cfg->video.fps); #endif err |= re_hprintf(pf, "\n# AVT - Audio/Video Transport\n" "rtp_tos\t\t\t184\n" "#rtp_ports\t\t10000-20000\n" "#rtp_bandwidth\t\t512-1024 # [kbit/s]\n" "rtcp_enable\t\tyes\n" "rtcp_mux\t\tno\n" "jitter_buffer_delay\t%u-%u\t\t# frames\n" "rtp_stats\t\tno\n" "\n# Network\n" "#dns_server\t\t10.0.0.1:53\n" "#net_interface\t\t%H\n", cfg->avt.jbuf_del.min, cfg->avt.jbuf_del.max, default_interface_print, NULL); #ifdef USE_VIDEO err |= re_hprintf(pf, "\n# BFCP\n" "#bfcp_proto\t\tudp\n"); #endif return err; }
static int core_config_template(struct re_printf *pf, const struct config *cfg) { int err = 0; if (!cfg) return 0; err |= re_hprintf(pf, "\n# Core\n" "poll_method\t\t%s\t\t# poll, select" #ifdef HAVE_EPOLL ", epoll .." #endif #ifdef HAVE_KQUEUE ", kqueue .." #endif "\n" "\n# SIP\n" "#sip_listen\t\t0.0.0.0:5060\n" "#sip_certificate\tcert.pem\n" "#sip_cafile\t\t%s\n" "\n" "# Call\n" "call_local_timeout\t%u\n" "call_max_calls\t\t%u\n" "\n" "# Audio\n" #if defined (SHARE_PATH) "#audio_path\t\t" SHARE_PATH "\n" #elif defined (PREFIX) "#audio_path\t\t" PREFIX "/share/baresip\n" #else "#audio_path\t\t/usr/share/baresip\n" #endif "audio_player\t\t%s\n" "audio_source\t\t%s\n" "audio_alert\t\t%s\n" "#ausrc_srate\t\t48000\n" "#auplay_srate\t\t48000\n" "#ausrc_channels\t\t0\n" "#auplay_channels\t0\n" "#audio_txmode\t\tpoll\t\t# poll, thread\n" "audio_level\t\tno\n" "ausrc_format\t\ts16\t\t# s16, float, ..\n" "auplay_format\t\ts16\t\t# s16, float, ..\n" "auenc_format\t\ts16\t\t# s16, float, ..\n" "audec_format\t\ts16\t\t# s16, float, ..\n" , poll_method_name(poll_method_best()), default_cafile(), cfg->call.local_timeout, cfg->call.max_calls, default_audio_device(), default_audio_device(), default_audio_device()); err |= re_hprintf(pf, "\n# Video\n" "#video_source\t\t%s\n" "#video_display\t\t%s\n" "video_size\t\t%dx%d\n" "video_bitrate\t\t%u\n" "video_fps\t\t%.2f\n" "video_fullscreen\tyes\n" "videnc_format\t\t%s\n" , default_video_device(), default_video_display(), cfg->video.width, cfg->video.height, cfg->video.bitrate, cfg->video.fps, vidfmt_name(cfg->video.enc_fmt)); err |= re_hprintf(pf, "\n# AVT - Audio/Video Transport\n" "rtp_tos\t\t\t184\n" "#rtp_ports\t\t10000-20000\n" "#rtp_bandwidth\t\t512-1024 # [kbit/s]\n" "rtcp_mux\t\tno\n" "jitter_buffer_delay\t%u-%u\t\t# frames\n" "rtp_stats\t\tno\n" "#rtp_timeout\t\t60\n" "\n# Network\n" "prefer_ipv6\t\tno\n" "#dns_server\t\t10.0.0.1:53\n" "#net_interface\t\t%H\n", cfg->avt.jbuf_del.min, cfg->avt.jbuf_del.max, default_interface_print, NULL); err |= re_hprintf(pf, "\n# BFCP\n" "#bfcp_proto\t\tudp\n"); return err; }