Discussion:
action on call
Friedemann Schorer
2005-07-06 18:58:58 UTC
Permalink
Hi,
in May, Thorsten Stoelk posted a solution to call a script on an incoming
"Hey, you missed a call from $MSN for $MY_PHONE_NUMBER at $TIME"
Nobody?
os.system("/path_to_script/call.sh "+call_to+" "+call_from+"")
#!/bin/sh
TO=$1
FROM=$2
TIME=`date +%H:%M`
echo "Call from $FROM to $TO at $TIME" | /usr/bin/smbclient -M <machine>
Now that I don't know Python at all, would someone be so kind to help me with
two little things ?

1. Where exactly do I have to put the line in incoming.py?
2. How can I make the script be called only if the call comes from a
predefined phone which calls one defined MSN?


Thanks in advance for your kind help.


Best regards,



F.Schorer
Thorsten Stoelk
2005-07-07 09:13:39 UTC
Permalink
Hi,

1.
about line 28 change:

def callIncoming(call,service,call_from,call_to):
# read config file and search for call_to in the user sections
try:
config=cs_helpers.readConfig()
userlist=config.sections()
userlist.remove('GLOBAL')
curr_user=""

into:

def callIncoming(call,service,call_from,call_to):

os.system("/path_to_script/call.sh "+call_to+" "+call_from+"")

# read config file and search for call_to in the user sections
try:
config=cs_helpers.readConfig()
userlist=config.sections()
userlist.remove('GLOBAL')
curr_user=""

2.
i dont know python that great, you may try something like (UNTESTET!!):

def callIncoming(call,service,call_from,call_to):

if ( call_from=="12345678" ) :
os.system("/path_to_script/call.sh "+call_to+" "+call_from+"")

# read config file and search for call_to in the user sections
try:
config=cs_helpers.readConfig()
userlist=config.sections()
userlist.remove('GLOBAL')
curr_user=""


Hope this helps.

Thorsten Stoelk
--
Post by Friedemann Schorer
Hi,
in May, Thorsten Stoelk posted a solution to call a script on an incoming
"Hey, you missed a call from $MSN for $MY_PHONE_NUMBER at $TIME"
Nobody?
os.system("/path_to_script/call.sh "+call_to+" "+call_from+"")
#!/bin/sh
TO=$1
FROM=$2
TIME=`date +%H:%M`
echo "Call from $FROM to $TO at $TIME" | /usr/bin/smbclient -M <machine>
Now that I don't know Python at all, would someone be so kind to help me
with two little things ?
1. Where exactly do I have to put the line in incoming.py?
2. How can I make the script be called only if the call comes from a
predefined phone which calls one defined MSN?
Thanks in advance for your kind help.
Lesen Sie weiter auf narkive:
Loading...