http://tmxxine.com/sip/ps6.tar.gz
NB:
Latest Code in first post
Now updated 26 June to merge with CEL's code and drop the FreeBasic part
CEL's code implemented but not tested. . .
this is an example of how I filled in the details
yours should be similar but not identical . .
If you recieved a voicemail about adding password each time
- don't worry - you just have to do it once and it is saved then just press the PJSAU button to run . . .
Code: Select all
--id sip:crusty_lobster@proxy01.sipphone.com
--registrar sip:proxy01.sipphone.com
--realm *
--username crusty_lobster
--password *******
Code: Select all
#!/bin/bash
# GPL v3 License
# PS v 0.5 June 25 008
# created by Lobster, CEL, HairyWill
###################
export PJCFG='config2.cfg' # config-file
export DIALOG='
<window title="PS" window-position="1">
<vbox>
<hbox>
<text><label>PS5 ~ frontend for PJSUA VOIP ~ Puppy Community June 25 2008</label></text>
</hbox>
<frame>
<pixmap>
<input file>logo.jpg</input>
</pixmap>
<text><label>Fill in details and save config</label></text>
<text><label>Click PJSUA to run - Press return in console for menu options</label></text>
</frame>
<hbox>
<text>
<label>Your SIP URL:</label>
</text>
<entry>
<input>sed -rn /^--id/s/^--id.//p /$PJCFG</input>
<variable>SIP_ID</variable>
</entry>
<text>
<label>ex: sip:yourname@proxy01.sipphone.com</label>
</text>
</hbox>
<hbox>
<text>
<label>Registrar URL:</label>
</text>
<entry>
<input>sed -rn /^--registrar/s/^--registrar.//p /$PJCFG</input>
<variable>SIP_REGISTRAR</variable>
</entry>
<text>
<label>ex: sip:proxy01.sipphone.com</label>
</text>
</hbox>
<hbox>
<text>
<label>Auth Realm:</label>
</text>
<entry>
<input>sed -rn /^--realm/s/^--realm.//p /$PJCFG</input>
<variable>SIP_REALM</variable>
</entry>
<text>
<label>ex: *</label>
</text>
</hbox>
<hbox>
<text>
<label>Username:</label>
</text>
<entry>
<input>sed -rn /^--username/s/^--username.//p /$PJCFG</input>
<variable>SIP_USERNAME</variable>
</entry>
<text>
<label>ex: yourname</label>
</text>
</hbox>
<hbox>
<text>
<label>Password:</label>
</text>
<entry invisible_char="*" visibility="false">
<input>sed -rn /^--password/s/^--password.//p /$PJCFG</input>
<variable>SIP_PASSWORD</variable>
</entry>
</hbox>
<hbox>
<text>
<label>Save config details</label>
</text>
<button ok></button>
<button>
<label>Run PJSAU</label>
<action>rxvt -e ./pjsua --config-file=config2.cfg &</action>
</button>
<button cancel></button>
</hbox>
</vbox>
</window>'
I=$IFS; IFS=""
for STATEMENTS in $(gtkdialog3 --program DIALOG --name PuppySIPConfig); do
eval $STATEMENTS
done
IFS=$I
if [ "$EXIT" = "OK" ]; then
sed -e /^--id/d -e /^--registrar/d -e /^--realm/d -e /^--username/d -e /^--password/d $PJCFG > /tmp/puppysiptmp
mv /tmp/puppysiptmp $PJCFG
echo "
--id $SIP_ID
--registrar $SIP_REGISTRAR
--realm $SIP_REALM
--username $SIP_USERNAME
--password $SIP_PASSWORD" >> $PJCFG
fi