Least cost routing

(New page: This page is a work in progress; it documents my efforts to hack up some sort of script-based Least Cost Routing arrangement on my N900. The first step is to get this working for regular...)
(wikify slightly, categorize)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
-
This page is a work in progress; it documents my efforts to hack up some sort of script-based Least Cost Routing arrangement on my N900.  
+
This page is a work in progress; it documents my efforts to hack up some sort of script-based Least Cost Routing arrangement on my [[Nokia N900|N900]].  
 +
 
 +
== Objective 1: pre-dialing ==
The first step is to get this working for regular PSTN access numbers over the GSM channel, so that I can use inclusive minutes rather than get charged through the nose for calling 0845, 0870 and suchlike.
The first step is to get this working for regular PSTN access numbers over the GSM channel, so that I can use inclusive minutes rather than get charged through the nose for calling 0845, 0870 and suchlike.
Line 5: Line 7:
In order to do that, I need to:
In order to do that, I need to:
-
# intercept outgoing call, check dial string and see if we need to intervene
+
# intercept an outgoing GSM call, check dial string and see if we need to intervene
-
# if so, end the call, edit the number to suit and autoredial before I the user know or care about it
+
# if so, end the call, rewrite the number to suit, and autoredial before I the end user know or care about it
 +
 
 +
Looking at D-Bus, when we place a call via GSM we get:
 +
 
 +
=================================
 +
Arg 1: :1.20
 +
Arg 2: null
 +
Arg 3: com.nokia.csd.Call
 +
Arg 4: CreateRequested
 +
Arg 5: +442081802828
 +
=================================
 +
Arg 1: :1.20
 +
Arg 2: null
 +
Arg 3: com.nokia.csd.Call
 +
Arg 4: Created
 +
Arg 5: +442081802828
 +
=================================
 +
 
 +
so, we can hook a script onto that using the following in dbus-scripts-settings
 +
 
 +
#:GSM Call Requested
 +
/opt/usr/bin/lcr * * com.nokia.csd.Call CreateRequested *
 +
 
 +
now, let's test that we can forcibly end the call before it happens:
 +
 
 +
<source lang="bash">
 +
#!/bin/sh
 +
echo "Least Cost Routing script: detected outgoing call to $5";
 +
echo "Ending call to $5"
 +
dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.Release
 +
</source>
 +
 
 +
[[Category:N900]]
 +
[[Category:Connectivity]]

Latest revision as of 07:15, 15 September 2010

This page is a work in progress; it documents my efforts to hack up some sort of script-based Least Cost Routing arrangement on my N900.

[edit] Objective 1: pre-dialing

The first step is to get this working for regular PSTN access numbers over the GSM channel, so that I can use inclusive minutes rather than get charged through the nose for calling 0845, 0870 and suchlike.

In order to do that, I need to:

  1. intercept an outgoing GSM call, check dial string and see if we need to intervene
  2. if so, end the call, rewrite the number to suit, and autoredial before I the end user know or care about it

Looking at D-Bus, when we place a call via GSM we get:

=================================
Arg 1: :1.20
Arg 2: null
Arg 3: com.nokia.csd.Call
Arg 4: CreateRequested
Arg 5: +442081802828
=================================
Arg 1: :1.20
Arg 2: null
Arg 3: com.nokia.csd.Call
Arg 4: Created
Arg 5: +442081802828
=================================

so, we can hook a script onto that using the following in dbus-scripts-settings

#:GSM Call Requested
/opt/usr/bin/lcr * * com.nokia.csd.Call CreateRequested *

now, let's test that we can forcibly end the call before it happens:

 #!/bin/sh
 echo "Least Cost Routing script: detected outgoing call to $5";
 echo "Ending call to $5"
 dbus-send --system --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.Release