[asterisk-users] snom 190 (etc.?) dialscript for * debugging and kaddressbook

Andreas v. Heydwolff listmail at sandpsych.at
Mon Jan 8 14:18:28 MST 2007


Thought I might just as well share these scripts, they may work with 
other phones too:

########################################################################
*1)* Dialing from the KDE 3.5.5 address book works with a script that 
gets triggered from the kaddressbook (Settings - Script Hooks - Phone) 
with my command

  snom_dial_number %N

The script snom_dial_number itself goes like this:
-------------------------
#!/bin/sh
ENCODEDNUMBER=$(echo "$@" | sed 's/\+/00/g' | sed 's/\///g' | sed \
's/-//g' | sed 's/\#/\%23/g' |sed 's/ //g' | sed 's/0043/0/g')

konqueror -geometry 700x30+350-810 \
http://172.16.0.2/command.htm?DIAL=$ENCODEDNUMBER&DIAL
#EOF
------------------------------------
Substitute "172.16.0.2" with your phone's IP number and 0043 with your 
country code. The format of numbers in my address book is +CC AC NUMBER 
which works also for exporting via gnokii to my Nokia mobile. The script 
handles the empty spaces and eventual hyphens.

(BTW, for SMS sending via bluetooth I added to the "script hooks"
cat %F | gnokii --sendsms %N)

########################################################################
*2)* When working on the dialplan on the office asterisk server via ssh 
from home I needed to test outgoing calls - but nobody was physically 
there. What to do?

Being logged in on a shell on my remote asterisk machine I used the 
following script to trigger outgoing calls from an office snom 190 phone 
to my phone beside me on the desk. A timeout of 3 secs for POTS or 15 
secs for my mobile guaranteed that no voicebox would take over but I 
heard a short ring when calls got through, to add a real life ringtone 
to remote visual feedback from asterisk -rvvvvv.

httpsnom-dialtest
-------------------------
#!/bin/bash
# Created 070107 by AvH

# $1 is the extension to dial
if [ "$1" = "" ]
   then echo enter number please ; exit
fi

# command for snom 190 phone, taken from
# http://80.237.155.31/kb/index.php?View=entry&CategoryID=21&EntryID=40

SOURCE="command.htm?number=$1"

# origin
EXT=2 # IP number of phone
echo "Dialing from $EXT"

# the actual command, -w is a timeout
echo -e "GET $SOURCE HTTP/1.0\n\n" | nc -w 1 $EXT 80 &>/dev/null
#EOF


I guess the second script can be put into use for KDE as well.

Any ideas for improvements?

Cheers,

--AvH


More information about the asterisk-users mailing list