MikroTik RouterOS IP Telephony

Document revision 28-Apr-2002
This document applies to the MikroTik RouterOS V2.5

The MikroTik RouterOS IP Telephony feature enables Voice over IP (VoIP) communications using routers equipped with the following voice port hardware:

Topics covered in this manual:

What's new in V2.5?

The following feature descriptions of V2.5 have been added to the Manual for V2.4:

IP Telephony Specifications

Supported Hardware

The MikroTik RouterOS V2.4 supports following telephony cards from Quicknet Technologies, Inc. (www.quicknet.net): For supported ISDN cards please see the ISDN Interface Manual.

The MikroTik RouterOS V2.5 supports the Voicetronix V4PCI card for connecting four (4) analog telephone lines following telephony cards from Voicetronix, Inc. (www.voicetronix.com.au):

Supported Standards

Implementation Options

The MikroTik IP Telephones and IP Telephony Gateways are interoperable with the following H.323 terminals:

IP Telephony Hardware and Software Installation

Software Packages

The MikroTik Router should have the telephony package installed. To install the package, please upload it to the router and reboot. The package can be downloaded from MikroTik’s web page www.mikrotik.com

The software package size is 1.2MB, after installation it requires 9.1MB of additional HDD space and 8.8MB of additional RAM. Please make sure you have the required capacity. Use /system resource print command to see the amount of available resources:

[MikroTik] > system resource print                                             
           uptime: 7m17s
     total-memory: 61240
      free-memory: 32756
         cpu-type: AMD-K6(tm)
    cpu-frequency: 300
        hdd-total: 46474
         hdd-free: 20900
[MikroTik] > 

You may want to increase the amount of RAM from 32MB to 48/64MB if you use telephony. Use the /system package print command to see the list of installed packages:

[MikroTik] > system package print
  # NAME                   VERSION               BUILD-TIME           UNINSTALL
  0 ppp                    2.4.1                 oct/12/2001 10:09:35 no
  1 pptp                   2.4.1                 oct/12/2001 10:10:17 no
  2 pppoe                  2.4.1                 oct/12/2001 10:11:17 no
  3 ssh                    2.4.1                 oct/12/2001 10:16:38 no
  4 isdn                   2.4.1                 oct/12/2001 10:19:04 no
  5 telephony              2.4.1                 oct/12/2001 10:35:03 no
  6 wavelan                2.4.1                 oct/12/2001 10:15:18 no
  7 system                 2.4.1                 oct/12/2001 10:05:27 no
  8 routing                2.4.1                 oct/12/2001 10:07:32 no
  9 snmp                   2.4.1                 oct/12/2001 10:07:58 no
[MikroTik] >

Software License

The telephony does not require any additional Software License. It works with the Basic License.

Hardware Installation

Please install the telephony hardware into the PC accordingly the instructions provided by card manufacturer. Each installed Quicknet card requires IO memory range in the following sequence: the first card occupies addresses 0x300-0x31f, the second card 0x320-0x33f, the third 0x340-0x35f, and so on. Make sure there is no conflict in these ranges with other devices, e.g., network interface cards, etc.

If the MikroTik router will be used as

Please consult the ISDN Manual for more information about installing the ISDN adapters.

IP Telephony Configuration

The IP Telephony requires IP network connection and configuration. The basic IP configuration can be done under the /ip address and /ip route menus.

Configuration of the IP telephony can be accessed under the /ip telephony menu:

[MikroTik] ip telephony> ?
       codec  Audio compression capability management
      export  Export IP Telephony settings
     numbers  Telephone numbers management
      region  Telephony voice port regional setting management
  voice-port  Telephony voice port management
[MikroTik] ip telephony>

Telephony Voice Ports

The management of all IP telephony voice ports (linejack, phonejack, isdn, voip) can be accessed under the /ip telephony voice-port menu. Use the print command to view the list of available telephony voice ports and their configuration.

[MikroTik] ip telephony voice-port> print
Flags: X - disabled
  #   NAME                          AUTODIAL                     TYPE
  0   PBX_Line                                                   linejack
  1   ISDN_GW                                                    isdn
  2   VoIP_GW                                                    voip
[MikroTik] ip telephony voice-port>

Description of arguments:

name - name assigned to the voice port by user.
type - ( phonejack / linejack / isdn / voip ) type of the installed telephony voice port, i.e., PhoneJack or LineJack.
autodial-number - number to be dialed automatically, if the voice port is to be used. The number should be present under the /ip telephony numbers list

Monitoring the Voice Ports

Monitoring of the voice ports is available for phonejack, linejack, and isdn voice ports. Use the monitor command under the corresponding menu to view the current state of the port, for example:

[MikroTik] ip telephony voice-port linejack> monitor PBX_Line
               status: connection
                 port: phone
            direction: port-to-ip
          line-status: unplugged
         phone-number: 26
    remote-party-name: pbx_20 [10.5.8.12]
                codec: G.723.1-6.4k/hw
             duration: 14s
			 
[MikroTik] ip telephony voice-port linejack>

Argument description:

status - current state of the port
'on-hook' - the handset is on-hook, no activity
'off-hook' - the handset is off-hook, the number is being dialed
'ring' - call in progress, direction of the call is shown by the argument 'direction'
'connection' - the connection has been established
'busy' - the connection has been terminated, the handset is still 'off-hook'
port - (only for linejack) the active port of the card
'phone' - telephone connected to the card (POTS)
'line' - line connected to the linejack card (PSTN)
direction - direction of the call
'ip-to-port' - call from the IP network to the voice card
'port-to-ip' - call from the voice card to an IP address
line-status - (only for linejack) state of the PSTN line
'plugged' - the telephone line is connected to the PSTN port of the linejack card
'unplugged' - ther is no working line connected to the PSTN port of the linejack card
phone-number - the number which is being dialed
remote-party-name - name and IP address of the remote party
codec - CODEC used for the audio connection
duration - duration of the audio call

Voice-Port Statistics

Voice-port statistics are available for phonejack, linejack, and isdn voice ports. Use the show-stats command under the corresponding menu to view the statistics of current audio connection. If there is no audio connection, all values are zero. For example:

[MikroTik] ip telephony voice-port linejack> show-stats PBX_Line
        round-trip-delay: 5ms
            packets-sent: 617
              bytes-sent: 148080
           max-send-time: 31ms
           avg-send-time: 30ms
           min-send-time: 29ms
        packets-received: 589
          bytes-received: 141360
        max-receive-time: 41ms 
        avg-receive-time: 30ms
        min-receive-time: 19ms
    average-jitter-delay: 59ms
            packets-lost: 0
    packets-out-of-order: 0
        packets-too-late: 2
		
[MikroTik] ip telephony voice-port linejack>

The average-jitter-delay shows the approximate delay time till the received voice packet is forwarded to the driver for playback. The value shown is never less than 30ms, although the actual delay time could be less. If the shown value is >40ms, then it is close (+/-1ms) to the real delay time.

The jitter buffer preserves quality of the voice signal against the loss or delay of packets while traveling over the network. The larger the jitter buffer, the larger the total delay, but fewer packets lost due to timeout. If the jitter-buffer=0, then it is adjusted automatically during the conversation to minimize the number of lost packets. The 'average-jitter-delay' is the approximate average time from the moment of receiving an audio packet from the IP network till it is played back over the telephony voice port.

The total delay from the moment of recording the voice signal till its playback is the sum of following three delay times:

A voice call can be terminated using the clear-call command in phonejack, linejack or isdn submenus. If the voiceport has an active connection, the command clear-call voiceport terminates it. The command is useful in the cases, when the termination of connection has not been detected by one of the parties, and there is an "infinite call". It can also be used to terminate someone's call, if it is using up the required line for another call.

Voice Port PhoneJack (phonejack) and LineJack (linejack)

All commands relating the PhoneJacks and LineJacks are listed under the /ip telephony voice-port phonejack and /ip telephony voice-port linejack menus respectively. For example:

[MikroTik] ip telephony voice-port linejack> print                                
Flags: X - disabled 
  0   name=linejack autodial="" playback-volume=-2 record-volume=-2 
      ring-cadence=++-++--- ++-++--- region=us echo-cancellation=yes 
      aec-tail-length=short aec-nlp-threshold=low aec-atten-scaling=4 
      aec-atten-boost=0 

  1   name=linejack_1 autodial="" playback-volume=-2 record-volume=-2 
      ring-cadence=++-++--- ++-++--- region=us echo-cancellation=yes 
      aec-tail-length=short aec-nlp-threshold=low aec-atten-scaling=4 
      aec-atten-boost=0 

[MikroTik] ip telephony voice-port linejack>                                   

Argument descriptions:

name - name given by the user or the default one (phonejack or phonejack_x)
type - (only for phonejack) type of the card (phonejack, phonejack-lite or phonejack-pci), cannot be changed
autodial - phone number which will be dialed immediately after the handset has been lifted. If this number is incomplete, then the remaining part has to be dialed on the dial-pad. If the number is incorrect, busy tone is played. If the number is correct, then the appropriate number is dialed. If it is an incoming call from the PSTN line (linejack), then the 'directcall' mode is used - the line is picked up only after the remote party answers the call.
playback-volume - playback volume in dB, 0dB means no change, possible values are -24...24dB.
record-volume - recording volume in dB, 0dB means no change, possible values are -24...24dB.
ring-cadence - a 16-symbol ring cadence for the phone, each symbol is 0.5 seconds, '+' means ringing, '-' means no ringing.
region - regional setting for the voice port. For phonejack, this setting is used for generating the tones. For linejacks, this setting is used for detecting the parameters of PSTN line, as well as for detecting and generating the tones.
echo-cancellation - echo detection and cancellation. Possible values are 'yes/no'.
If the echo cancellation is on, then the following parameters are used:
aec-tail-length - size of the buffer of echo detection. Possible values are 'short/medium/long'.
aec-nlp-threshold - level of cancellation of silent sounds. Possible values are 'off/low/medium/high'.
aec-atten-scaling - factor of additional echo attenuation. Possible values are 0...10.
aec-atten-boost - level of additional echo attenuation. Possible values are 0, 6, 12 ... 84, 90dB, i.e., should be multipliers of 6.

For linejacks, there is a command blink voiceport, which blinks the LEDs of the specified voiceport for five seconds after it is invoked. This command can be used to locate the respective card under several linejack cards.

Voice Port ISDN (isdn)

All commands relating the ISDN voice ports are listed under the /ip telephony voice-port isdn menu. In contrary to the phonejack and linejack voice ports, which are as many as the number of cards installed, the isdn ports can be added as many as desired.

[MikroTik] ip telephony voice-port isdn> print
Flags: X - disabled 
  0   name="isdn1" autodial="" region=us msn="136" playback-volume=0 
      record-volume=0 agc-on-playback=no agc-on-record=no software-aec=no 

[MikroTik] ip telephony voice-port isdn>

Argument descriptions:

name - Name given by the user or the default one.
msn - Telephone number of the ISDN voice port (ISDN MSN number). It determines which calls from the ISDN line this voice port should answer.
autodial - phone number which will be dialed immediately after the handset has been lifted. If this number is incomplete, then the remaining part has to be dialed on the dial-pad. If the number is incorrect, busy tone is played. If the number is correct, then the appropriate number is dialed. If it is an incoming call from the ISDN line, then the 'directcall' mode is used - the line is picked up only after the remote party answers the call.
playback-volume - playback volume in dB, 0dB means no change, possible values are -24...24dB.
record-volume - recording volume in dB, 0dB means no change, possible values are -24...24dB.
region - regional setting for the voice port (for generating tones only).
agc-on-playback - ( no / yes ) automatic gain control on playback
agc-on-record - ( no / yes ) automatic gain control on record
software-aec - ( no / yes ) software automatic echo cancellation

Note! Do not forget to load the driver for your ISDN card! Follow the instructions in the ISDN Manual.

Voice Port Voice over IP (voip)

The voip voice ports are virtual ports, which designate a voip channel to another host over the IP network. You mast have at least one voip voice port to be able to communicate with other H.323 devices over IP network.

[MikroTik] ip telephony voice-port voip> print detail
Flags: X - disabled
  0   name=VoIP_GW autodial="" address=10.5.8.12 jitter-buffer=50ms
      silence-detection=no prefered-codec=none fast-start=yes

[MikroTik] ip telephony voice-port voip>

Argument description:

name - Name given by the user or the default one.
address - IP address of the remote party (IP telephone or gateway) associated with this voice port. If the call has to be performed through this voice port, then the specified IP address is called. If there is an incoming call from the specified IP address, then the parameters of this voice port are used. If there is an incoming call from an IP address, which is not specified in any of the voip voice port records, then the default record with the address 0.0.0.0 is used. If there is no default record, then default values are used.
autodial - phone number which will be added in front of the telephone number received over the IP network. In most cases it should be blank.
jitter-buffer - size of the jitter buffer, 0...1000ms. The jitter buffer preserves quality of the voice signal against the loss or delay of packets while traveling over the network. The larger the jitter buffer, the larger the total delay, but fewer packets lost due to timeout. If the setting is jitter-buffer=0, the size of it is adjusted automatically during the conversation, to minimize the number of lost packets and the length of the jitter buffer.
silence-detection - if 'yes', then no silence is detected and no audio data is sent over the IP network during the silence period.
prefered-codec - the preferred codec to be used for this voip voice port. If possible, the specified codec will be used.
fast-start - allow or disallow the fast start. The fast start allows establishing the audio connection in a shorter time. However, not always it is possible. Therefore, it should be turned off, there are problems using the fast start mode.

Numbers

This is the so-called "routing table" for voice calls. This table assigns numbers to the voice ports.

[MikroTik] ip telephony numbers> print
Flags: I - invalid, X - disabled
  #    DESTINATION-PATTERN      VOICE-PORT              PREFIX
  0    26                       VoIP_GW                 26
[MikroTik] ip telephony numbers>

Argument description:

destination-pattern - pattern of the telephone number. Symbols '.' and '#' designate any digit. The telephone numbers should be unique.
voice-port - voice port to be used when calling the specified telephone number.
prefix - prefix, which will be used to substitute the known part of the 'destination-pattern', i.e., the part containing digits, when using this voice port. The 'destination-pattern' argument is used to determine which voice port to be used, whereas the 'prefix' argument designated the number to dial over the voice port (be sent over to the remote party). If the remote party is an IP telephony gateway, then the number will be used for making the call.

The main function of the number routing table is to determine:

  1. to which voice port route the call, and
  2. what number to send over to the remote party.
Let us consider the following example for the number table:

[MikroTik] ip telephony numbers> print
Flags: I - invalid, X - disabled
  #    DESTINATION-PATTERN      VOICE-PORT              PREFIX
  0    12345                    XX		     
  1    1111.                    YY		     
  2    22...                    ZZ                      333
  3    ...                      QQ                      55

[MikroTik] ip telephony numbers>

We will analyze the Number Received (nr) - number dialed at the telephone, or received over the line, the Voice Port (vp) - voice port to be used for the call, and the Number to Call (nc) - number to be called over the Voice Port.

If nr=55555, it does not match any of the destination patterns, therefore it is rejected.
If nr=123456, it does not match any of the destination patterns, therefore it is rejected.
If nr=1234, it does not match any of the destination patterns (incomplete for record #0, therefore it is rejected.
If nr=12345, it matches the record #0, therefore number "" is dialed over the voice port XX.
If nr=11111, it matches the record #1, therefore number "1" is dialed over the voice port YY.
If nr=22987, it matches the record #2, therefore number "333987" is dialed over the voice port ZZ.
If nr=22000, it matches the record #2, therefore number "333000" is dialed over the voice port ZZ.
If nr=444, it matches the record #3, therefore number "55444" is dialed over the voice port QQ.

Let us add a few more records:

[MikroTik] ip telephony numbers> print
Flags: I - invalid, X - disabled
  #    DESTINATION-PATTERN      VOICE-PORT              PREFIX
...
  4    222                      KK                      44444
  5    3..                      LL                      553

[MikroTik] ip telephony numbers>

If nr=222 => the best match is the record # 4=> nc=44444, vp=KK.
The 'best match' means that it has the most coinciding digits between the nr and destination-pattern.
If nr=221 => the best match is the record # 3 => nc=55221, vp=QQ
If nr=321 => the best match is the record # 5 => nc=55321, vp=LL
ja nr=421 => matches the record # 3 => nc=55421, vp=QQ
ja nr=335 => the best match is the record # 5 => nc=55321, vp=LL

Let us add a few more records:

[MikroTik] ip telephony numbers> print
Flags: I - invalid, X - disabled
  #    DESTINATION-PATTERN      VOICE-PORT              PREFIX
...
  6    33...                    MM                      33
  7    11.                      NN                      7711

[MikroTik] ip telephony numbers>

If nr=335 => incomplete record # 6 => the call is rejected.
Explanation of this case:

The nr=335 fits perfectly both the record # 3 and # 5. The # 5 is chosen as the 'best match' candidate at the moment. Furthermore, there is record # 6, which has two matching digits (more than for # 3 or # 5). Therefore the # 6 is chosen as the 'best match'. However, the record # 6 requires five digits, but the nr has only three. Two digits are missing, therefore the number is incomplete. Two additional digits would be needed to be entered on the dialpad. If the number is sent over from the network, it is rejected.
If nr=325 => matches the record # 5 => nc=55325, vp=LL
If nr=33123 => matches the record # 6 => nc=33123, vp=MM
If nr=123 => incomplete record # 0 => call is rejected
If nr=111 => incomplete record # 1 => call is rejected
If nr=112 => matches the record # 7 => nc=77112, vp=NN
If nr=121 => matches the record # 3 => nc=55121, vp=QQ

It is impossible to add the following records:

[MikroTik] ip telephony numbers> print
Flags: I - invalid, X - disabled
  #    DESTINATION-PATTERN      VOICE-PORT
...                                         reason:
       11                       DD          conflict with record # 7
       11.                      DD          conflict with record # 7
       11..                     DD          conflict with record # 7
       111                      DD          conflict with record # 1
       22.                      DD          conflict with record # 2
       .....                    DD          conflict with record # 3

Regional Settings

Regional settings are used to adjust the voice port properties to the PSTN system or the PBX. For example, to detect hang-up from line, there has to be correct regional setting for the LineJACK card: there must be correct busy-tone-filter frequency and busy-tone-cadence set for region which this LineJACK card uses.

Regional settings are managed under the /ip telephony region menu:

[MikroTik] ip telephony region> print
Flags: P - predefined 
  0 P name="us" data-access-arrangement=us dial-tone-frequency=350x0,440x0 
      dial-tone-filter=350-440 busy-tone-frequency=480x0,620x0 
      busy-tone-filter=480-620 busy-tone-cadence=500,500,500,500 
      ring-tone-frequency=480x0,440x0 ring-tone-filter=440-480 
      ring-tone-cadence=2000,4000 

  1 P name="uk" data-access-arrangement=uk dial-tone-frequency=350x0,440x0 
      dial-tone-filter=350-440 busy-tone-frequency=400x0 busy-tone-filter=400 
      busy-tone-cadence=375,375,375,375 ring-tone-frequency=400x0,450x0 
      ring-tone-filter=400-450 ring-tone-cadence=400,200,400,2000 

  2 P name="france" data-access-arrangement=france dial-tone-frequency=440x0 
      dial-tone-filter=440 busy-tone-frequency=440x0 busy-tone-filter=440 
      busy-tone-cadence=250,250,250,250 ring-tone-frequency=440x0 
      ring-tone-filter=440 ring-tone-cadence=1500,3500 
  ...

Argument description:

flag - (P) predefined, cannot be changed or removed. Users can add their own regional settings, which can be changed and removed.
name - Name of the regional setting
busy-tone-cadence - Busy tone cadence in ms (0 - end of cadence)
busy-tone-filter - Busy tone detection frequency Hz, or 'off'
busy-tone-frequency - Frequency and volume gain of busy tone Hz x dB
data-access-arrangement - ( australia / france / germany / japan / uk / us ) Ring voltage, impedance setting for line-jack card.
dial-tone-filter - Dial tone detection frequency Hz, or 'off'
dial-tone-frequency - Frequency and volume gain of dial tone Hz x dB
ring-tone-cadence - Ring tone cadence in ms (0 - end of cadence)
ring-tone-filter - Ring tone detection frequency Hz
ring-tone-frequency - Frequency and volume gain of ring tone Hz x dB

For generating the tone, the frequency and cadence arguments are used. For recognizing a tone, the filter and cadence parameters are used. If the filter is set to 'off', the tone is not being detected. The dialtone always is continuous signal, therefore it does not gave the cadence argument. When detecting the dialtone, it should be at least 100ms long.

Sometimes it is necessary to add an additional regional setting matching the properties of a particular PBX. Use the add command to add a new regional setting:

[MikroTik] ip telephony region> add
Creates new item with specified property values.
        busy-tone-cadence  Busy tone cadence in ms (0 - end of cadence)
         busy-tone-filter  Busy tone detection frequency Hz
      busy-tone-frequency  Frequency and volume gain of busy tone Hz x dB
                copy-from  Item number
  data-access-arrangement  Ring voltage, impedance setting for line-jack card
         dial-tone-filter  Dial tone detection frequency Hz
      dial-tone-frequency  Frequency and volume gain of dial tone Hz x dB
                     name  New regional setting name
        ring-tone-cadence  Ring tone cadence in ms (0 - end of cadence)
         ring-tone-filter  Ring tone detection frequency Hz
      ring-tone-frequency  Frequency and volume gain of ring tone Hz x dB
[MikroTik] ip telephony region>

To change, for example, the volume gain of both dial tone frequencies to -6dB for a user defined region 'office', you need to enter the command:

[MikroTik] ip telephony region> set office dial-tone-frequency=350x-6,440x-6

Audio CODEC

The available Audio Coding and Decoding Protocols (CODEC) are listed under /ip telephony codec menu:

[MikroTik] ip telephony codec> print
Flags: X - disabled
  #   NAME
  0   G.723.1-6.4k/hw
  1   G.728-16k/hw
  2   G.711-ALaw-64k/hw
  3   G.711-uLaw-64k/hw
  4   G.711-uLaw-64k/sw
  5   G.711-ALaw-64k/sw
  6   G.729A-8k/sw
  7   G.723.1-6.4k/sw
  8   GSM-06.10-13.2k/sw
  9   LPC-10-2.5k/sw
[MikroTik] ip telephony codec>

CODECs are listed according to their priority of use. The highest priority is at the top. CODECs can be enabled, disabled and moved within the list. When connecting with other H.323 systems, the protocol will negotiate the CODEC which both of them support according to the priority order.

The hardware codecs (/hw) are built-in CODECs supported by Quicknet cards. If an ISDN card is used, then the hardware CODECs are ignored, only software CODECs (/sw) are used.

The choice of the CODEC type is based on the throughput and speed of the network. Better audio quality can be achieved by using CODEC requiring higher network throughput. The highest audio quality can be achieved by using the G.711-uLaw CODEC requiring 64kb/s throughput for each direction of the call. It is used mostly within a LAN. The G.723.1 CODEC is the most popular one to be used for audio connections over the Internet. It requires only 6.4kb/s throughput for each direction of the call.

IP Telephony Troubleshooting

IP Telephony Applications

The following describes examples of some useful IP telephony applications using the MikroTik RouterOS Quicknet telephony cards or ISDN cards.

Let us consider the following example of IP telephony gateway, one MikroTik IP telephone, and one Welltech LAN Phone 101 setup:

Setting up the MikroTik IP Telephone

The QuickNet LineJACK or PhoneJACK card and the MikroTik RouterOS telephony package should be installed in the MikroTik router (IP telephone) 10.0.0.22. An analog telephone should be connected to the 'phone' port of the QuickNet card. If you pick up the handset, a busy tone (no telephony configuration yet) or a dialtone should be heard.

The basic telephony configuration should be as follows:

  1. Add a voip voice port to the /ip telephony voice-port voip for each of the devices you want to call, or want to receive calls from, i.e., (the IP telephony gateway 10.1.1.12 and the Welltech IP telephone 10.5.8.2):

    [Joe] ip telephony voice-port voip>
    add name=gw remote-address=10.1.1.12
    add name=robert remote-address=10.5.8.2
    [Joe] ip telephony voice-port voip> print                                      
    Flags: X - disabled, D - dynamic, R - registered 
      #    NAME      AUTODIAL REMOTE-ADDRESS  JITTER-BUFFER PREFERED-CODEC  SIL FAS
      0    gw                 10.1.1.12       100ms         none            no  yes
      1    robert             10.5.8.2        100ms         none            no  yes
    [Joe] ip telephony voice-port voip>  
    
    You should have three vioce ports now:
    [Joe] ip telephony voice-port> print                                    
    Flags: X - disabled 
      #   NAME                          TYPE           AUTODIAL                    
      0   linejack1                     linejack                                   
      1   gw                            voip                                       
      2   robert                        voip                                       
    [Joe] ip telephony voice-port>  
    
  2. Add a at least one unique number to the /ip telephony numbers for each voice port. This number will be used to call that port:

    [Joe] ip telephony numbers>
    add dst-pattern=31 voice-port=robert
    add dst-pattern=33 voice-port=linejack1
    add dst-pattern=1. voice-port=gw prefix=1
    [Joe] ip telephony numbers> print                                              
    Flags: I - invalid, X - disabled, D - dynamic, R - registered 
      #     DST-PATTERN             VOICE-PORT              PREFIX                 
      0     31                      robert                                         
      1     33                      linejack1                                      
      2     1.                      gw                      1                      
    [Joe] ip telephony numbers>  
    

    Here, the dst-pattern=31 is to call the Welltech IP Telephone, if the number '31' is dialed on the dialpad.
    The dst-pattern=33 is to ring the local telephone, if a call for number '33' is received over the network.
    Anything starting with digit '1' would be sent over to the IP Telephony gateway.

Making calls from the IP telephone 10.0.0.224:

Use the telephony logging feature to debug your setup.

Setting up the IP Telephony Gateway

The QuickNet LineJACK card and the MikroTik RouterOS telephony package should be installed in the MikroTik router (IP telephony gateway) 10.1.1.12. A pbx line should be connected to the 'line' port of the QuickNet LineJACK card. The LED next to the 'line' port should be green, not red.

The IP telephony gateway [voip_gw] requires the following configuration:

  1. Set the regional setting to match our PBX. The 'mikrotik' seems to be best suited:

    [voip_gw] ip telephony voice-port linejack> set linejack1 region=mikrotik   
    [voip_gw] ip telephony voice-port linejack> print                           
    Flags: X - disabled 
      0   name="linejack1" autodial="" region=mikrotik playback-volume=0 
          record-volume=0 ring-cadence="++-++--- ++-++---" agc-on-playback=no 
          agc-on-record=no aec=yes aec-tail-length=short aec-nlp-threshold=low 
          aec-attenuation-scaling=4 aec-attenuation-boost=0 software-aec=no 
    
    [voip_gw] ip telephony voice-port linejack>
    

  2. Add a voip voice port to the /ip telephony voice-port voip for each of the devices you want to call, or want to receive calls from, i.e., (the IP telephone 10.0.0.224 and the Welltech IP telephone 10.5.8.2):

    [voip_gw] ip telephony voice-port voip>
    add name=joe remote-address=10.0.0.224
    add name=robert remote-address=10.5.8.2 prefered-codec=G.723.1-6.4k/hw
    [voip_gw] ip telephony voice-port voip> print
    Flags: X - disabled, D - dynamic, R - registered 
      #    NAME      AUTODIAL REMOTE-ADDRESS  JITTER-BUFFER PREFERED-CODEC  SIL FAS
      0    joe                10.0.0.224      100ms         none            no  yes
      1    robert             10.5.8.2        100ms         G.723.1-6.4k/hw no  yes
    [voip_gw] ip telephony voice-port voip>
    
  3. Add number records to the /ip telephony numbers, so you are able to make calls:

    [voip_gw] ip telephony numbers>
    add dst-pattern=31 voice-port=robert prefix=31
    add dst-pattern=33 voice-port=joe prefix=33
    add dst-pattern=1. voice-port=linejack1 prefix=1
    [voip_gw] ip telephony numbers> print
    Flags: I - invalid, X - disabled, D - dynamic, R - registered 
      #     DST-PATTERN             VOICE-PORT              PREFIX                 
      0     31                      robert                  31                     
      1     33                      joe                     33                     
      2     1.                      linejack1               1                      
    [voip_gw] ip telephony numbers>
    

Making calls through the IP telephony gateway:

Setting up the Welltech IP Telephone

Please follow the documentation from www.welltech.com.tw on how to set up the Welltech LAN Phone 101. Here we give just brief recommendations:

  1. We recommend to upgrade the Welltech LAN Phone 101 with the latest application software. Telnet to the phone and check what you have, for example:

    usr/config$ rom -print
    
    Download Method  :  TFTP
     Server Address  :  10.5.8.1
    
       Hardware Ver. :  4.0
           Boot Rom  :  nblp-boot.102a
    Application Rom  :  wtlp.108h
            DSP App  :  48302ce3.127
         DSP Kernel  :  48302ck.127
      DSP Test Code  :  483cbit.bin
      Ringback Tone  :  wg-ringbacktone.100
          Hold Tone  :  wg-holdtone10s.100
      Ringing Tone1  :  ringlow.bin
      Ringing Tone2  :  ringmid.bin
      Ringing Tone3  :  ringhi.bin
    
    usr/config$ 
    

  2. Check if you have the codecs arranged in the desired order:

    usr/config$ voice -print
    Voice codec setting relate information
        Sending packet size  : 
                G.723.1      : 30 ms
                G.711A       : 20 ms
                G.711U       : 20 ms
                G.729A       : 20 ms
                G.729        : 20 ms
        Priority order codec : 
                g7231 g711a g711u g729a g729 
        Volume levels        : 
                voice volume : 54
                input gain   : 26
                 dtmf volume : 23
    Silence suppression & CNG: 
                G.723.1      : Off
        Echo canceller       : On 
     JitterBuffer Min Delay  : 90
     JitterBuffer Max Delay  : 150
    usr/config$ 
    
  3. Make sure you have set the H.323 operation mode to phone to phone (P2P), not gatekeeper (GK):

    usr/config$ h323 -print
    H.323 stack relate information
        RAS mode               : Non-GK mode
        Registered e164        : 31
        Registered H323 ID     : Robert
        RTP port               : 16384
        H.245 port             : 16640
        Allocated port range   :
                  start port   : 1024
                  end port     : 65535
        Response timeOut       : 5
        Connect  timeOut       : 5000
    usr/config$ 
    
  4. Add the gateway's address to the phonebook:

    usr/config$ pbook -add name gw ip 10.1.1.12      
    usr/config$ 
    This may take a few seconds, please wait....
    
    Commit to flash memory ok!
    
    usr/config$ pbook -print
    index   Name                 IP                    E164
    ======================================================================
    1       gw                   10.1.1.12                                 
    ----------------------------------------------------------------------
    usr/config$ 
    

Making calls from the IP telephone 10.5.8.2:

Use the telephony logging feature on the gateway to debug your setup.

Setting up the MikroTik Router and CISCO Router

Here are some hints on how to get working configuration for telephony calls between CISCO and MikroTik router.

Tested on:

Configuration on the MikroTik side:

Configuration on the CISCO side:

For reference, following is an exported CISCO configuration, that works:

!
version 12.1
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
logging rate-limit console 10 except errors
enable secret 5 $1$bTMC$nDGl9/n/pc3OMbtWxADMg1
enable password 123
!
memory-size iomem 25
ip subnet-zero
no ip finger
!
call rsvp-sync
voice rtp send-recv
!
voice class codec 1
 codec preference 1 g711ulaw
 codec preference 2 g723r63
!
interface FastEthernet0
 ip address 10.0.0.101 255.255.255.0
 no ip mroute-cache
 speed auto
 half-duplex
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.0.1
no ip http server
!
dialer-list 1 protocol ip permit
dialer-list 1 protocol ipx permit
!
voice-port 0/0
!
voice-port 0/1
!
voice-port 2/0
!
voice-port 2/1
!
dial-peer voice 1 pots
 destination-pattern 101
 port 0/0
!
dial-peer voice 97 voip
 destination-pattern 097
 session target ipv4:10.0.0.97
 codec g711ulaw
!
dial-peer voice 98 voip
 destination-pattern 098
 voice-class codec 1
 session target ipv4:10.0.0.98
!
!
line con 0
 transport input none
line aux 0
line vty 0 4
 password 123
 login
!
end


© Copyright 1999-2002, MikroTik