SearchWiki:

TheMilkfish

MilkfishServices

Boozy Milkfish

Milkfish-dd

Doozy Milkfish

Woozy Milkfish


Main.SideBar (edit)


Legal Information

Recent Changes Printable View Page History Edit Page

Milkfish Console Services - Overview

Note: The Milkfish Console Services Package is the only package of the Boozy 3.0 packages that is compatible with Whiterussian RC4 firmware images. All other Boozy 3.0 packages depend on a Openwrt Whiterussian RC5 (or later) firmware image.

As always, one screenshot says more than a thousand words...

 . root@Openwrt:~# milkfish_services help
 . 
 . The Milkfish Router Services
 . Usage: milkfish_services <service> [<action> [ <argument1> [ <argument2> ] ] ]
 . Valid <service> options are:
 .
 . audit          : Auditing service for measuring the availability and uptime
 . fwtest         : Firewall test utility performing a quick portscan
 . echotest       : Signaling test utility responding with the outgoing INVITEs SIP/SDP
 . homesip        : Dynamic SIP service routing personal FQDN calls to the WAN IP address
 . simple         : Send an instant SIP/SIMPLE message - arguments: destination-sip:uri:port message
 . phonebook      : Print short and detailed locally handled user list phonebook
 . sipdb          : Local SIP user database management services
 . pppoe-reconnect: Checks whether a PPPoE reconnect is necessary and performs one if so
 . check          : Check for registration status and service activation at milkfish.org
 . status         : Check the local Router Status (IP addresses, SER Stats, RTPproxy, ...)
 . sipstart       : Initialises the Milkfish Environment Processes (Openser and RTPproxy)
 . sipstop        : Stops the Milkfish Environment Processes (Openser and RTPproxy)
 . siprestart     : Restarts the Milkfish Environment Processes (Openser and RTPproxy)
 . start          : Activates the Milkfish Services (starts a background process)
 .                  All enabled services will be updated automatically
 . stop           : Stop the Milkfish Services (ends all background processes)
 .                  All enabled services will NOT be updated automatically
 . help           : Show this manual
 . 
 . Valid <action> options for the audit service are:
 . 
 . router         : Manually updates the router audit once
 . openser        : Manually updates the OpenSER audit once (if OpenSER is running)
 . results        : Download and display the actual audit results for this router
 . activate       : Activate the Audit Service at milkfish.org
 . deactivate     : Deactivate the Audit Service at milkfish.org
 . 
 . Valid <action> options for the sipdb service are:
 . 
 . store          : Stores the volatile SIP user database to flash memory
 . restore        : Restores SIP user database from flash memory
 . flush          : Flushes the volatile SIP user database (not the persistent one)
 . adduser        : Adds a user to the volatile SIP user database - arguments: username password
 . rmuser         : Removes a user from the volatile SIP user database - argument: username
 . addalias       : Adds an alias to the volatile SIP user database - arguments: alias uri
 . rmalias        : Removes an alias from the volatile SIP user database - argument: alias
 . rmlocation     : Removes an active location from the volatile SIP user database - argument: location
 .                  Locations are associated to every active account, this means
 .                  also to UAs only using the Outbound Proxy feature.
 . 
 . Security Note  : Install the curl packages to enable SSL secured services


Milkfish PPPoE Reconnect-Echo Avoidance

What is a Reconnect-Echo?

A Reconnect-Echo is encountered during an internet telephone conversation while an internet dialup reconnect happens again. This reconnect may terminate the conversation silently without any of the participants becoming aware of it. It is due to a common internet connection mechanism used by internet service providers which terminates the internet connection after a maximum up-time (normally 24 hours). With internet flatrates the internet connections would not be reset without this mechanism. The actual "echo" occurs when people (re-)install their equipment - e.g. during the evening hours - and encounter a Reconnect-Echo the next day at the same time, often in the middle of a phone conversation about how nice the new installation works. Since the connection terminates silently, the call has to be set up again after noticing it has been down. Since some User Agent Clients may be unaware of the "change", the phone may not even allow a new call setup attempt by the opposite party since an active call is assumed by the equipment. Extensive parts of technical explanations within late-night conversations may have to be repeated after recognising a reconnect echo has happened. To avoid this issue systematically, we introduce an avoidance mechanism which is doing an active reconnect at a time of day where there is little probability of causing unwanted disconnections.

The Milkfish PPPoE Reconnect Timer schedules a reconnect at a specific hour of day. To disable the service, just set the according variable to "off" - like this:

 root@Openwrt:/bin# nvram set milkfish_ppptime=off

If a time is specified in the a two-digit hour-only time format, this means just the hour including leading zero for a one digit only hour, then the milkfish_services script in the background will check every hour if the specified hour has come. If the specified hour is reached, then another check is performed finding out if the last reconnect was happening in the same hour of day. This is actualy done by reading the last line from the file /var/log/ip-up.log which is introduced by milkfish_services package and a patch section in the file /etc/ppp/ip-up. If, however, the last reconnect occured in the same hour, maybe 24 hours ago, this means the common 24 hour reconnect will occur "synchronised" to the setting anyway and no further action is taken. If, on the other hand side, the last reconnect was in another hour than specified, a new reconnect is initiated by the milkfish_services backgroud process.

The following example shows:

  1. Checking the status of the reconnect time configuration
  2. Checking the momentary system time (in UTC which is recommended to be left as time zone for future features)
  3. Changing the settings for the service to a hour with leading zero and thereby activating it
  4. Storing the changes to non-volatile memory
  5. Listing the service log

Example:

 root@Openwrt:/bin# nvram show | grep ppptime
 milkfish_ppptime=off
 root@Openwrt:/bin# date
 Thu Oct  5 21:35:37 UTC 2006
 root@Openwrt:/bin# nvram set milkfish_ppptime=04
 root@Openwrt:/bin# nvram commit
 root@Openwrt:/bin# cat /var/log/ip-up.log
 00:00:42 00-01-01 - ip-up
 root@Openwrt:/bin#

Later, the service log file may look like this:

 root@Openwrt:/bin# cat /var/log/ip-up.log
 00:00:42 00-01-01 - ip-up
 04:08:27 06-10-06 - commencing reconnect
 04:08:42 06-10-06 - ip-up
 root@Openwrt:/bin#

Note: On DD-WRT Firmwares this feature is not functional. We therefore recommend to set milkfish_ppptime=off


Milkfish Signaling Test

This sections describes a procedure for analysing your outgoing signaling, i.e. your SIP message content including SDP. Implicitely, an example is given for how to enable numeric-only dialling phones within your setup by using a local SIP alias.

The user agent used below is registered locally at the Milkfish Router's integrated registrar. This is not a necessary precondition, though.

If your User Agent can call alphanumeric addresses, here "echo@milkfish.org", you can skip steps 1 through 5 !

For this example, we have the following network setup:
User Agent 192.168.3.213 ---LAN--- 192.168.3.21 Milkfish Router 84.160.21.251 ---WAN--- 81.209.167.98 Milkfish.org Server

Please note: The following examples include features not available for Boozy 3.0.0 and earlier !

Here's a short summary of what we will do in this section:

  1. Checking the current network settings for the Milkfish Router
  2. Create a numeric alias for an alphanumeric SIP destination URI
  3. Validate the contents of the temporary aliases file
  4. Storing the validated aliases file in persistent memory
  5. Storing the validated aliases file in NVRAM and committing the changes
  6. Calling the always BUSY (!) Signaling Test Service "echo@milkfish.org" from a local SIP user agent by dialling "501" (not shown here)
  7. Checking if the Milkfish Router changed the original user agents SIP request correctly for successful NAT traversal
  8. Comparing the Signaling Test Results with the Request the User Agent originally sent

Now, let's go:

First, login to your router's shell console using telnet or ssh (putty on Windos) to get a prompt where you can enter the following commands:

 root@OpenWrt:~# milkfish_services status
 The Milkfish Router Services
 Checking the local Router Status...

 SIP Transaction Statistics:
 Current: 0 (0 waiting) Total: 0 (0 local)       
 Replied localy: 0      
 Completion status 6xx: 0, 5xx: 0, 4xx: 0, 3xx: 0,2xx: 0      

 NVRAM:
 SIP_DOMAIN: 192.168.1.1
 OPENSER_CFG: /var/openser/milkfish_openser.cfg

 Processes (first receiver process per IP:port):
 2       10889   receiver child=0 sock= 192.168.3.21:5060
 3       10890   receiver child=0 sock= 84.160.21.251:5060

 RTPproxy:
 192.168.3.21  84.160.21.251

 IP addresses:
 LAN: 192.168.3.21
 WAN: 84.160.21.251

 SER Uptime:
 Now: Sat May  5 15:57:57 2007
 Up Since: Sat May  5 15:56:37 2007
 Up time: 80 [sec]

 root@OpenWrt:~# milkfish_services sipdb addalias 501 echo@milkfish.org
 The Milkfish Router Services
 Trying to add alias 501 for the uri echo@milkfish.org to user database...
 The Milkfish Router Services
 Updating OpenSER audit (http)...
 200 OK - Next update is welcome in 20 minutes
 Stopping OpenSER : stopped

 Starting OpenSER : started pid(13093)
 root@OpenWrt:~# cat /var/openser/dbtext/aliases
 username(str) domain(str,null) contact(str,null) received(str,null) expires(int,null)
 q(double,null) callid(str,null) cseq(int,null) last_modified(int,null) replicate(int,null)
 state(int,null) flags(int) user_agent(str) socket(str,null)
 501::sip\:echo@milkfish.org::0:1.00:Milkfish-Alias:42::0:0:128:Milkfish-Router:
 root@OpenWrt:~# milkfish_services sipdb store
 The Milkfish Router Services
 Storing volatile SIP DB to Flash...
 root@OpenWrt:~# milkfish_services sipdb storenv
 The Milkfish Router Services
 Storing volatile SIP DB subscribers to NVRAM...
 Done.
 The Milkfish Router Services
 Storing volatile SIP DB aliases to NVRAM...
 Done.
 root@OpenWrt:~# nvram commit
 root@OpenWrt:~# milkfish_services echotest
 The Milkfish Router Services
 Starting Signaling Test Utility (http)...
 Looking for your result...

 Checking Echotest...
 Starting Echotest...

  Source: 84.160.21.251:5060
  Received: 81.209.167.98:5060 - Sat May  5 15:58:57 2007
  INVITE echo sip:echo@milkfish.org:5060
  From: sip:user@84.160.21.251;tag=8jsmtzjvuz
  To: 501 sip:501@192.168.3.21;user=phone;tag= null
  Call-Id: 3c267f475a55-rznyybh037fc@192-168-3-13
  CSeq: 1
  Contact:  sip:user@192.168.3.213:5060;line=r74nz6cz
  User-Agent: snom190-3.52e
  Content-Type: application/sdp
  Content Length: 307
  v=0
  o=root 1434363001 1434363001 IN IP4 192.168.3.213
  s=call
  c=IN IP4 84.160.21.251
  t=0 0
  m=audio 35000 RTP/AVP 0 8 18 4 9 101
  a=rtpmap:0 pcmu/8000
  a=rtpmap:8 pcma/8000
  a=rtpmap:18 g729/8000
  a=rtpmap:4 g723/8000
  a=rtpmap:9 g722/16000
  a=rtpmap:101 telephone-event/8000
  a=fmtp:101 0-15
  a=sendrecv


 Checking the From:-Header validity with a UAC Reverse-Lookup...
 User-Agent: snom190-3.52e


 Finished.
 Saturday, 05th of May 2007, 15:59:11 CEST
 rev070414 - powered by sipwerk

 If your results were found, you can now confirm if the following lines are correct:

 Source: external.wan.ip.address:5060
 This is the source ip address the echotest sees. It needs to be the same as your milkfish routers wan ip address.

 From: yourphone sip:yourphone@external.wan.ip.address
 The From-Header needs to have the milkfish wan ip or the milkfish fromdomain as its domain part.

 Contact:  sip:yourphone@internal.lan.ip.address
 The Contact-Header needs to have the phones internal lan ip address in its domain part.

 c=IN IP4 external.wan.ip.address
 The c entry in the SDP body carries the external wan ip address for directing media to your milkfish router.

 m=audio wanport RTP/AVP codecs
 The m entry in the SDP body carries the external wan port where your milkfish RTPproxy is expecting the media.
 root@OpenWrt:~#

Here's what we find in the built-in SIP Trace Log of the User Agent Client Hardware:

 Sent to udp:192.168.3.21:5060 at 5/5/2007 15:59:27:890 (999 bytes):

 INVITE sip:501@192.168.3.21;user=phone SIP/2.0
 Via: SIP/2.0/UDP 192.168.3.213:5060;branch=z9hG4bK-lziqux0fbbzy;rport
 From: "User@Fromdomain.Com" <sip:user@192.168.3.21>;tag=8jsmtzjvuz
 To: <sip:501@192.168.3.21;user=phone>
 Call-ID: 3c267f475a55-rznyybh037fc@192-168-3-213
 CSeq: 1 INVITE
 Max-Forwards: 70
 Contact: <sip:user@192.168.3.213:5060;line=r74nz6cz>
 P-Key-Flags: keys="3"
 User-Agent: snom190-3.52e
 Accept-Language: en
 Accept: application/sdp
 Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFO
 Allow-Events: talk, hold, refer
 Supported: timer, 100rel, replaces
 Session-Expires: 3600
 Content-Type: application/sdp
 Content-Length: 307

 v=0
 o=root 1434363001 1434363001 IN IP4 192.168.3.213
 s=call
 c=IN IP4 192.168.3.213
 t=0 0
 m=audio 10002 RTP/AVP 0 8 18 4 9 101
 a=rtpmap:0 pcmu/8000
 a=rtpmap:8 pcma/8000
 a=rtpmap:18 g729/8000
 a=rtpmap:4 g723/8000
 a=rtpmap:9 g722/16000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-15
 a=sendrecv

Please note that this software is under development and comes with no warranty.


Using the Milkfish Services to enable people to give support

The best way to get support is to provide a short description of your problem plus details of your setup and some 'live' information of your router. Please consider to change actual addresses for anonymity reasons. We are not interested in your real IP addresses, as well as...
IMPORTANT: Whatever you send us, NEVER EVER post/publish/send passwords - we do not want to know them and also will never ask for them!

Here's a very good example of mutual support.

First, tell us what's wrong:

 "I want to call my friend at his IP phone but do not hear any voice after he picks up the receiver."

The second step is done by describing or sketching your setup with a simple ASCII graph as done here:

 User Agent 192.168.3.213 ---LAN--- 192.168.3.21 Milkfish Router 84.160.21.251 ---WAN...
 ...WAN--- 84.160.21.252 Other Milkfish Router 192.168.1.22 ---LAN--- 192.168.1.212 User Agent

Then, thirdly, gather and provide some information on how your router is working at the moment of failure. Most appreciated is information in text form from the router's shell where you get by connecting through telnet (windows and linux) or ssh (i.e. putty for windows). After logging into your router you can execute the following:

 root@OpenWrt:~# milkfish_services status
 The Milkfish Router Services
 Checking the local Router Status...

 SIP Transaction Statistics:
 Current: 0 (0 waiting) Total: 0 (0 local)       
 Replied localy: 0      
 Completion status 6xx: 0, 5xx: 0, 4xx: 0, 3xx: 0,2xx: 0      

 NVRAM:
 SIP_DOMAIN: 192.168.1.1
 OPENSER_CFG: /var/openser/milkfish_openser.cfg

 Processes (first receiver process per IP:port):
 2       10889   receiver child=0 sock= 192.168.3.21:5060
 3       10890   receiver child=0 sock= 84.160.21.251:5060

 RTPproxy:
 192.168.3.21  84.160.21.251

 IP addresses:
 LAN: 192.168.3.21
 WAN: 84.160.21.251

 SER Uptime:
 Now: Sat May  5 15:57:57 2007
 Up Since: Sat May  5 15:56:37 2007
 Up time: 80 [sec]

 root@OpenWrt:~# nvram get openser_cfg
 /var/openser/milkfish_openser.cfg
 root@OpenWrt:~# nvram get sip_domain
 192.168.1.1
 root@OpenWrt:~# ps
 ...
 (COPY AND PASTE EVERYTHING PRINTED HERE INTO YOUR SUPPORT REQUEST)
 ...
 root@OpenWrt:~# milkfish_services phonebook
 ...
 (COPY AND PASTE EVERYTHING PRINTED HERE INTO YOUR SUPPORT REQUEST)
 ...

Everything you type and get, you can copy-paste into your support request to the forum and thereby help the people who want to help you, so after all, you help yourself this way.

For the hard cases where everything looks ok (but still nothing works) it may be necessary to copy and paste the results of the echotest described here. Please do not forget to place the test call, before performing the echotest itself. For details, see here. Maybe you enable help by sending even the contents of the following file by opening it in the firmware-integrated text editor vi this way on the shell:

 root@OpenWrt:~# vi /var/openser/milkfish_openser.cfg

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on September 07, 2009, at 01:55 PM