[Q] sipdroid - Android Q&A, Help & Troubleshooting

i have setup a sipdroid, ipkall, pbexes, and sipsorcery account. however when i try and make a call it keeps asking for a password...?
i am not sure what i have done wrong and have followed the guide on this site and was wondering if someone could help?
also not sure how i need to configure gv or if that may have anything to do with it?? cause when you call my gv number it goes directly to gv and does not ring my mobile
Ok I have just told gv to use every time I make a call. Wasn't sure if that was something I should do or not? Also the password I entered for all my accounts this time worked, yet it said the call could not be completed?
***Edit***
Ok I think I have gotten alot further... It is no longer asking me for a password and is just now saying the call cant be completed as dialed. I have checked my sipsorcery account and it appears that im having an error loading my dial plan??? here is a copy of the plan i have below. also how can i get google to verify my sip number to forward my gv calls to the correct number?
appreciate all the help as i was just transferred to amsterdam and was looking for a low cost way to keep in touch with family and friends.
PHP:
# Copyright(c) 2010 Mike Telis
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# Click "View raw file" in the lower right for the best copy/paste view
AREA_CODE = '843' # my area code
GV_USER = '*********' # my GV e-mail address ([email protected])
GV_PASS = '*********' # my GV password
CB_NUMBER = '12064247339' # my 11-digit SIP number (only one)
SPEED_DIAL = { # my speed dial numbers
'1' => '19879879876', # Mom
'123' => '12345678901', # Work
'45' => '17479876543', # Gizmo BFF
'411' => '8004664411', # Google 411
'266' => '[email protected]', # CNN Headlines
}
begin
sys.Log "** Call from #{req.Header.From} to #{req.URI.User} **"
if sys.Out # if outbound call
num = req.URI.User.to_s # Get a string copy of the number to dial
num = SPEED_DIAL[num] || num # Substitute with speed dial entry, if any
case num
when /@/ then sys.Dial num # URI dialing
when /^[2-9]\d{6}$/ # Local call, 7-digit number
num = '1'+ AREA_CODE + num # prefix it with country and area code
when /^[01]?([2-9]\d{9})/ # US number with or without country code
num = '1' + $1 # add country code and truncate number to 10-digit
when /^(011|00|\+)(\d{9,})/ # international number
num = '+' + $2 # GoogleVoiceCall works with '+' prefix only
else sys.Respond 603, 'Wrong number, check & dial again'
end
sys.Log "Calling #{num} via Google Voice"
sys.GoogleVoiceCall GV_USER, GV_PASS, CB_NUMBER, num, '.*', CB_NUMBER =~ /^1747/ ? 7 : 1, 30
else # sys.Out
sys.Dial "#{sys.Username}@local"
end
rescue
sys.Log("** Error: " + $!) unless $!.to_s =~ /Thread was being aborted./
end

Related

[custom-conf] -> in-deep-gps.conf <-

HI TO ALL !!!
putting togheter some material available on the net plus some from my mind, I'm posting below the "code" for a self-explaining content of a gps.conf file with the possibility to fully customize every parameter/feature that the agps standard offers.
to use that --> copy the content into a blank text file, save it, and then rename it "gps.conf" (without quotes). Backup your original gps.gonf in /etc folder if you want, then put the fresh gps.conf there (/etc folder). To modify it, just edit it as you want using a text editor (es. from within root explorer app). Reboot.
Try differen't configz till reach the best fit for your personal needs.
Code:
# WELCOME ALL!!!
# enable-disable any parameter/feature by adding or removing (#) symbol
# change values as you want
# connect to http://www.pool.ntp.org to find out the ntp server nearest to you
# change following NTP_SERVER to nearest address (country or zone)
NTP_SERVER=0.europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
# 4 - Debug, 5 - Verbose
DEBUG_LEVEL = 3
# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0
# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
# use only increment/decrement of 10 and DON'T go below 30
ACCURACY_THRES=5000
################################
##### AGPS server settings #####
################################
# FOR SUPL SUPPORT, set the following
#SUPL_HOST=supl.sonyericsson.com
#SUPL_PORT=7275
SUPL_HOST=supl.google.com
SUPL_PORT=7276
# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234
################################
# EXTRA SETTINGS ###############
################################
# Report supl ref location as position, 1=enable, 0=disable
REPORT_POSITION_USE_SUPL_REFLOC=0
# Wiper (wifi positioning), 1=enable, 0=disable
ENABLE_WIPER=0
#################################
##### AGPS Carrier settings #####
#################################
CURRENT_CARRIER=common
DEFAULT_AGPS_ENABLE=TRUE
DEFAULT_SSL_ENABLE=FALSE
# TRUE for "User Plane", FALSE for "Control Plane"
DEFAULT_USER_PLANE=TRUE
Hoping the above "code" could help someone somewhere !!!
best regards,
respect!

How to assign Telephone Device ID?

Would anyone know how I can assign a deviceID for the GTablet? I need to use my tablet to do some testing of my companies app. They require the device ID to exist to generate a unique ID for the user. It is currently not returning any sort of ID.
Here's code we are using to get the device ID:
Code:
TelephonyManager tMgr = (TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
mDeviceId = tMgr.getDeviceId();
Edit: So i downloaded Android ID Changer and it shows the device has an ID in it but that # does not get returned to our app. The issue is not in our since we have other tablet and phones that work.
Thanks

If anyone is having problem with sending sms and/or mms.

Visit http://twit88.com/home/utility/sms-pdu-encode-decode, scroll at the bottom to String sms message. Only SMSC matters.
Enter your SMSC number and click calculate.
Enter * # * # 4636 # * # * and go down to SMSC. Click the RIGHT Refresh and the current numbers shows up. Could be an idea to back this up.
Remove all other numbers / letters and replace with the first 16 digits / letters from Hexadecimal PDU Message in the link above and click the left Update. This key is implementing the change.
Go to bake with the Back button and restart the phone.

[script] reliable interface stats

[script] reliable interface stats
pro: reliable, works on any Linux; low battery consumption; runs only when necessary
contra: no GUI
prerequisites: script manager able to trigger on network changes
root is not needed, because the script uses the readable-for-all /proc/net/dev interface to gather statistics.
My problem was that I could not find any app that would give me the megabytes sent from/to the device. They would either ignore GPRS, WiFi or count from reboot to reboot, display stupid ads or cost even money without delivering. I'm on a data flatrate with throttling from 200MB up, and I only want to know how much I already "spent".
The following script should run on network changes, but it can be run at any time. You get more data entries in the log files for the various active interfaces when running it more often.
EDIT: it turns out the "network change" event works perfectly for interface wlan0, but not for pdp0, which happens to be the GPRS/G2/G3/G4 packet interface. Maybe "Tasker" does better than "Script Manager" with this, try and find out. What will always work is manual mode: after using an interface, run the script. This will enter the numbers from any interface that traffic into the respective log.
The script is run with zero or one argument. If given, it can be the name of an interface or the string "all" to get just a readout of the current counters of all interfaces that had traffic without logging anything.
The output is lines with bytes, data packets, errornous and dropped packets for "rx" (received) and "tx" (transmitted) for all or the selected interfaces. Without arguments all active interfaces are logged to separate files in /sdcard/. If you want to change this directory or the names or the date format, well, it should be easy to adapt.
Note that this first script does only data gathering as to the byte counts and it must run on network events. See below for the script(s) that do evaluation according to date to find out how much to go until throttling.
Code:
#!/system/bin/sh
want_if="${1:-*}"
all=""
case "-${want_if}" in
-all)
want_if="*"; all=all;
;;
esac
log_prefix="/mnt/sdcard/interface-stats"
now="$(date '+%d.%m.%y-%H:%M:%S')"
# rx: bytes packets errs drop fifo frame compressed multicast
# tx: bytes packets errs drop fifo colls carrier compressed
# lo: 4944 74 0 0 0 0 0 0 4944 74 0 0 0 0 0 0
# wlan0: 42447725 41554 302 0 0 0 0 0 3280981 33753 0 0 0 0 0 0
while read intf rb rp re rd x x x x tb tp te td rest
do
case "-${intf}" in
-${want_if:-*}:)
case "${rb}--${tb}" in
0--0) continue;;
esac
stats="rx: $rb $rp $re $rd tx: $tb $tp $te $td"
intf_="${intf%:}"
echo "${intf} ${stats}"
[ -z "${all}" ] &&
echo "${now} ${stats}" >> "${log_prefix}-${intf_}.txt"
;;
esac
done < /proc/net/dev
exit 0
Here's the script to output the megabytes. It gets zero, one or two arguments, the first being a date pattern that needs to match the dates in the log file, the second the name of said logg.
An optional third argument, if given, gives debug output. Use only if the number doesn't look plausible.
It doesn't need any special privileges and can be run anytime.
If less than one megabyte has been hit so far, then the output is the number of bytes. Due to limitations of "awk" there can still be decimals in the output!
Code:
# /home/ino/interface-stats.sh _date: 20120225-2103_
# vim: set filetype=sh ts=4:
# -*- mode: sh; -*-
#
# <url:man:1 awk>
# sample:
#
# 25.02.12-02:28:28 rx: 182909647 374371 462 0 tx: 681742703 542899 0 0
# 25.02.12-12:15:00 rx: 3 374464 494 0 tx: 5 542974 0 0
#
# at around noon the device was rebooted, so the stats start at low
# values.
#
# algorithm:
#
# initialize old-accumulator and offset to zero.
#
# since received and transmitted bytes are accumulated by the kernel,
# the script has to just store the sum of the received and transmitted
# bytes into an accumulator, unless the current value is less than the
# running count. this happens after a reboot. so store this first low
# value into $offset, store the old accumulator and keep the running game
# until either the next reboot or EOF. now
# accumulator = old-accumulator + accumulator - offset.
awk_prog='
BEGIN {
debug = debug > 0
accu=0
accu_old=0
offset=0
accu_sum=0
# megabytes
mb_scaler=1024*1024
# field definitions
rx_bytes=3
rx_packets=4
rx_errors=5
rx_dropped=6
tx_bytes=8
tx_packets=9
tx_errors=10
tx_dropped=11
# date pattern
# 25.02.12-12:15:00 rx: 3 374464 494 0 tx: 5 542974 0 0
pat_date_dflt = "[0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]-[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"
pat_date = length(pat_date) == 0 ? pat_date_dflt : pat_date
}
function dbg(x) {
if (debug > 0) print("debug: " x);
}
# no particular validity check: if there are 11 fields and the first one
# matches the date the user is after, we will use the record.
(NF == 11) && ($1 ~ pat_date) {
dbg("select line: " $0)
accu_sum = $rx_bytes + $tx_bytes
if (accu_sum < accu) {
dbg("break: accu_sum=" accu_sum "; accu_old=" accu_old "; accu=" accu "; offset=" offset);
accu = accu_old + accu - offset
accu_old = accu
offset = accu_sum
accu = accu_sum
} else {
accu = accu_sum
}
}
END {
dbg("eof: accu_sum=" accu_sum "; accu_old=" accu_old "; accu=" accu "; offset=" offset);
accu = accu_old + accu - offset
if (accu > mb_scaler) accu = (accu / mb_scaler) "MB"
print(accu)
}
'
debug=0
log_prefix="/mnt/sdcard/interface-stats"
dates="${1:-.}"
want_if="${2:-wlan0}"
debug="${3+1}"
input="${log_prefix}-${want_if}.txt"
awk -v pat_date="${dates}" -v debug="${debug}" "${awk_prog}" "${input}"
And finally this one is for quick inspection of a logg. Gets the name of an interface as argument if needed. Again it needs no privileges and is appropriate for use as a SMwidget.
Code:
#!/system/bin/sh
want_if="${1:-wlan0}"
log_prefix="/mnt/sdcard/interface-stats"
logg="${log_prefix}-${want_if}.txt"
[ -r "${logg}" ] &&
while read tim rx rb rp re rd tx tb tp te td rest
do
case "${rb}--${tb}" in
0--0) continue;;
esac
stats="rx: $rb $rp $re $rd tx: $tb $tp $te $td"
echo "${tim} ${stats}"
done < "${logg}"
exit 0
Does somebody know what tags to brace code with in order to keep formatting intact? To me all my stuff has no indentation and lines seem to break at other points than just and only newlines!
EDIT: just found out that there's no problem in the web view, it's just the "forum runner" that can't render what the "\[ code \]" tag generates.
Well, as an alternative, what's the least-hassle file dump?

[Q] Send a file simultaneously to multiple bluetooth devices

Hi to all
I am working in a project that detect all bluetooth nearby devices and simultaneously send a text file to them.
I want to add this feature to the following code
Code:
Code:
import bluetooth
import os
print "performing inquiry..."
nearby_devices = bluetooth.discover_devices(lookup_names = True)
print "found %d devices" % len(nearby_devices)
for name, addr in nearby_devices:
print " %s - %s" % (addr, name)
for name, addr in nearby_devices:
os.system('obexftp -b -p a.txt')
As you can see I have tried with obexftp but it's only send to one defined bluetooth device and I want to send to all bluetooth devices
Any idea to implement that
Thank you very much

Categories

Resources