dot

packages and services management
Log | Files | Refs | README

commit 6bd9b4026ff950dac1c246e068d79446cab5f17d
parent 2a0c0da54458d828c22cc14c8f8ce0a282c4f3da
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat,  8 Dec 2018 23:22:15 +0100

s6/pjsua: placing a call

Diffstat:
Abin/baresip-client | 5+++++
Mbin/service-bundle | 2++
Mbin/service-enable | 2+-
Mpack/pjsip/build | 4+++-
Apack/pjsip/dependencies/libalsa | 2++
As6/baresip/iptel.org/accounts/josuah@iptel.org | 0
As6/baresip/linphone.org/accounts/josuah@sip.linphone.org | 1+
As6/baresip/x/contacts/echo@creytiv.com | 1+
As6/baresip/x/contacts/sip904@mouselike.org | 1+
Ds6/baresip/x/data/accounts | 33---------------------------------
Ms6/baresip/x/module_tmp/x | 1-
Ms6/baresip/x/setup | 34++++++++++++++++++++++++++++++++--
Ds6/pjsua/client/run | 1-
As6/pjsua/iptel.org/conf/auto-play | 1+
As6/pjsua/iptel.org/conf/cli-telnet-port | 1+
As6/pjsua/iptel.org/conf/id | 1+
As6/pjsua/iptel.org/conf/password | 1+
As6/pjsua/iptel.org/conf/realm | 1+
As6/pjsua/iptel.org/conf/registrar | 1+
As6/pjsua/iptel.org/conf/username | 1+
As6/pjsua/x/conf/no-cli-console | 0
Ms6/pjsua/x/setup | 8+++-----
22 files changed, 58 insertions(+), 44 deletions(-)

diff --git a/bin/baresip-client b/bin/baresip-client @@ -0,0 +1,5 @@ +#!/usr/bin/env execlineb + +ifte { stty sane } { stty sane } +if { stty -echo -icanon } +if { nc localhost 5555 } diff --git a/bin/service-bundle b/bin/service-bundle @@ -10,10 +10,12 @@ importas base x if { rm -rf ${base} } if { mkdir ${base} } + if { redirfd -w 1 ${base}/type echo bundle } + if { redirfd -w 1 ${base}/contents elglob -0s x ${base},* diff --git a/bin/service-enable b/bin/service-enable @@ -3,7 +3,7 @@ elgetpositionals -P 1 cd /var/s6 if { service-build $@ } -if { service-bundle } +#if { service-bundle } backtick -n x { s6-clock } importas time x diff --git a/pack/pjsip/build b/pack/pjsip/build @@ -1,5 +1,8 @@ #!/bin/sh -ex +export CFLAGS="${CFLAGS} -I${libalsa}/include" +export LDFLAGS="${CFLAGS} -L${libalsa}/lib" + ./configure --prefix="$PREFIX" make @@ -8,4 +11,3 @@ make install mkdir -p "$PREFIX/bin" cp pjsip-apps/bin/pjsua-* "$PREFIX/bin/pjsua" cp pjsip-apps/bin/samples/*/* "$PREFIX/bin" - diff --git a/pack/pjsip/dependencies/libalsa b/pack/pjsip/dependencies/libalsa @@ -0,0 +1 @@ +../../libalsa/version+ \ No newline at end of file diff --git a/s6/baresip/iptel.org/accounts/josuah@iptel.org b/s6/baresip/iptel.org/accounts/josuah@iptel.org diff --git a/s6/baresip/linphone.org/accounts/josuah@sip.linphone.org b/s6/baresip/linphone.org/accounts/josuah@sip.linphone.org @@ -0,0 +1 @@ +transport=tls;medianat=ice;stunserver="stun:josuah@stun.linphone.org" diff --git a/s6/baresip/x/contacts/echo@creytiv.com b/s6/baresip/x/contacts/echo@creytiv.com @@ -0,0 +1 @@ +Echo Server diff --git a/s6/baresip/x/contacts/sip904@mouselike.org b/s6/baresip/x/contacts/sip904@mouselike.org @@ -0,0 +1 @@ +Echo and audio quality tests sip:904@mouselike.org or PSTN:+441483604781 – Allows test / connection from anywhere. diff --git a/s6/baresip/x/data/accounts b/s6/baresip/x/data/accounts @@ -1,33 +0,0 @@ -# -# SIP accounts - one account per line -- sample configuration -# -# Displayname <sip:user:password@domain;uri-params>;addr-params -# -# uri-params: -# ;transport={udp,tcp,tls} -# -# addr-params: -# ;answermode={manual,early,auto} -# ;audio_codecs=opus/48000/2,pcma,... -# ;auth_user=username -# ;mediaenc={srtp,srtp-mand,srtp-mandf,dtls_srtp,zrtp} -# ;medianat={stun,turn,ice} -# ;outbound="sip:primary.example.com;transport=tcp" -# ;outbound2=sip:secondary.example.com -# ;ptime={10,20,30,40,...} -# ;regint=3600 -# ;pubint=0 (publishing off) -# ;regq=0.5 -# ;rtpkeep={zero,stun,dyna,rtcp} -# ;sipnat={outbound} -# ;stunserver=stun:[user:pass]@host[:port] -# ;video_codecs=h264,h263,... -# -# Examples: -# -# <sip:user:secret@domain.com;transport=tcp> -# <sip:user:secret@1.2.3.4;transport=tcp> -# <sip:user:secret@[2001:df8:0:16:216:6fff:fe91:614c]:5070;transport=tcp> -# - -<sip:josuah@sip.linphone.org>;transport=tls;medianat=ice;stunserver="stun:josuah@stun.linphone.org" diff --git a/s6/baresip/x/module_tmp/x b/s6/baresip/x/module_tmp/x @@ -1 +0,0 @@ -account.so diff --git a/s6/baresip/x/setup b/s6/baresip/x/setup @@ -2,9 +2,39 @@ if { mkdir -p data } +# contacts +if { + redirfd -w 1 data/contacts + + forbacktickx -n -o 0 x { ls contacts } + importas contact x + + backtick -n x { sed -n "1p" contacts/${contact} } + importas comment x + + backtick -n x { sed -n "2p" contacts/${contact} } + importas value x + + printf "\"%s\" <sip:%s>;%s\n" ${comment} ${contact} ${value} +} + +# accounts +if { + redirfd -w 1 data/accounts + + forbacktickx -n -o 0 x { ls accounts } + importas account x + + redirfd -r 0 accounts/${account} + withstdinas x + importas value x + + printf "<sip:%s>;%s\n" ${account} ${value} +} + redirfd -w 1 data/config -# configuration variables +# configuration if { forbacktickx -n -o 0 x { ls conf } importas var x @@ -16,7 +46,7 @@ if { printf "%-20s %s\n" ${var} ${value} } -# modules to load +# modules if { forx -o 0 x { module module_tmp module_app } importas type x diff --git a/s6/pjsua/client/run b/s6/pjsua/client/run @@ -1 +0,0 @@ -#!/usr/bin/execlineb diff --git a/s6/pjsua/iptel.org/conf/auto-play b/s6/pjsua/iptel.org/conf/auto-play @@ -0,0 +1 @@ + diff --git a/s6/pjsua/iptel.org/conf/cli-telnet-port b/s6/pjsua/iptel.org/conf/cli-telnet-port @@ -0,0 +1 @@ +5555 diff --git a/s6/pjsua/iptel.org/conf/id b/s6/pjsua/iptel.org/conf/id @@ -0,0 +1 @@ +sip:josuah@iptel.org diff --git a/s6/pjsua/iptel.org/conf/password b/s6/pjsua/iptel.org/conf/password @@ -0,0 +1 @@ +7NHkSBZoOtjoNH57JmtUWLRmUPF+bNSjXS9bpSCseJvNlVWv9/wxR6c4e0GjSjpf diff --git a/s6/pjsua/iptel.org/conf/realm b/s6/pjsua/iptel.org/conf/realm @@ -0,0 +1 @@ +asterisk diff --git a/s6/pjsua/iptel.org/conf/registrar b/s6/pjsua/iptel.org/conf/registrar @@ -0,0 +1 @@ +sip:iptel.org diff --git a/s6/pjsua/iptel.org/conf/username b/s6/pjsua/iptel.org/conf/username @@ -0,0 +1 @@ +josuah diff --git a/s6/pjsua/x/conf/no-cli-console b/s6/pjsua/x/conf/no-cli-console diff --git a/s6/pjsua/x/setup b/s6/pjsua/x/setup @@ -1,15 +1,13 @@ #!/usr/bin/env execlineb if { mkdir -p data } -if { mkfifo data/fifo } redirfd -w 1 data/conf -cd conf -forbacktickx x { ls } +forbacktickx -n -o 0 x { ls conf } importas var x -redirfd -r 0 -withstdinas x +redirfd -r 0 conf/${var} +withstdinas -n x importas x x printf "--%s %s\n" $var $x