Thursday 5 June 2014

Freepbx - Asterisk multiline pstn same number setup

I had to setup a multiline on a asterisk PBX the other day for the 1st time, the VoIP was so bad because of the poor broadband, we decided to opt for the multiline pstn option.

I could not really find much on the internet with any help to setup.

So i installed my new fxo card to sit alongside the other that i already had.

The Important settings.

You have to create two Dahdi  trunks - call them say Mulitiline1 and multiline2

My setup in the PBX was actually for 3 pstn dahdi lines incoming and i had 1 fxs card.

Line 1 FXO - Dahdi trunk = channel 1 (original spare bt number)
Line 2 FXO - Dahdi trunk = channel 2 (1st of the multiline channels)
Line 3 FXS - not used at the moment = channel 3
Line 4 FXO -- Dahdi trunk = channel 4 (2nd of the multiline channels)

On my setup it sends to the ivr then queues the calls to the two office phones.

Actually the owner wanted 3 options on the ivr, you may ask how do you know what the call is for if it rings the same two phones at the same time.

What i did was to make an announcement, for example if one is press by the caller for sales, the announcement  tells either phone sales and they then know what the call is for. Two is for enquiries and information etc etc

The first trunk should go through to the ivr, followed by the second which is automatically switched at the phone exchange.

The outgoing rules are very important  to make this work.

In your outbound route
where the section at the bottom for
Trunk sequence for Matched Routes is
add multiline1 then add multiline2 for your failover.

Finally back to the trunks edit your multiline1 and set max calls to 1
this then tells asterisk that the line is busy when in use and it drops through to multiline2.

Of course to keep the the multiline as free as possible, you may want to use another line for outbound calling or VoIP if your broadband is better than ours.
 



35 comments:

  1. Hi... I have the A200 and a BT Multiline but I cannot get it to work correctly... external calls once connected to PSTN have a loud buzz.... and incoming calls do not connect to the PBX until the caller hangsup.... could you please explain how you got this to work correctly I have setup two trunks one for multiline line.... incoming route to extension... when call is made nothing appears in the CLI but once the caller hangsup it suddenly appears, any help would be appreciated thanks

    ReplyDelete
    Replies
    1. which distro are you using

      Delete
    2. have you run dahdi_genconf
      what is the result of dahdi_cfg -vvvv
      have you setup /etc/modprobe.d/dahdi.conf
      heres mine
      options wctdm opermode=UK battthresh=4 fwringdetect=1
      heres my dahdi-channels.conf
      ; Span 1: WCTDM/4 "Wildcard TDM400P REV E/F Board 5" (MASTER)
      ;;; line="1 WCTDM/4/0 FXSKS (In use) (EC: OSLEC - INACTIVE)"
      signalling=fxs_ks
      callerid=asreceived
      group=0
      context=from-pstn
      channel => 1
      callerid=
      group=
      context=default

      ;;; line="2 WCTDM/4/1 FXSKS (In use) (EC: OSLEC - INACTIVE)"
      signalling=fxs_ks
      callerid=asreceived
      group=0
      context=from-pstn
      channel => 2
      callerid=
      group=
      context=default

      and finally dahdi_dahdi.conf
      [channels]
      language=en
      busydetect=yes
      busycount=10
      usecallerid=yes
      callwaiting=yes
      usecallingpres=yes
      threewaycalling=yes
      transfer=yes
      cancallforward=yes
      callreturn=yes
      echocancel=yes
      echocancelwhenbridged=no
      echotraining=no
      immediate=no
      faxdetect=no
      rxgain=3
      txgain=3
      module_name=wctdm24xxp
      opermode_checkbox=on
      opermode=UK
      alawoverride_checkbox=0
      alawoverride=0
      fxs_honor_mode_checkbox=on
      fxs_honor_mode=0
      cidsignalling=v23
      cidstart=polarity
      callerid=asreceived

      Delete
  2. using FreePBX 12

    dahdi_cfg -vvvv

    DAHDI Tools Version - 2.10.0.1

    DAHDI Version: 2.10.0.1
    Echo Canceller(s): OSLEC
    Configuration
    ======================


    Channel map:

    Channel 01: FXS Kewlstart (Default) (Echo Canceler: oslec) (Slaves: 01)
    Channel 02: FXS Kewlstart (Default) (Echo Canceler: oslec) (Slaves: 02)

    2 channels to configure.

    Setting echocan for channel 1 to oslec
    Setting echocan for channel 2 to oslec


    modprobe:
    options wctdm opermode=UK battthresh=4 fwringdetect=1

    dahdi-channels.conf:

    ; Span 1: WRTDM/0 "wrtdm Board 1" (MASTER)
    ;;; line="1 WRTDM/0/0 FXSKS (In use) (EC: OSLEC - INACTIVE)"
    signalling=fxs_ks
    callerid=asreceived
    group=0
    context=from-pstn
    channel => 1
    callerid=
    group=
    context=default

    ;;; line="2 WRTDM/0/1 FXSKS (In use) (EC: OSLEC - INACTIVE)"
    signalling=fxs_ks
    callerid=asreceived
    group=0
    context=from-pstn
    channel => 2
    callerid=
    group=
    context=default

    chan_dahdi.conf:

    [channels]
    language=en
    busydetect=yes
    busycount=10
    usecallerid=yes
    callwaiting=yes
    usecallingpres=yes
    threewaycalling=yes
    transfer=yes
    cancallforward=yes
    callreturn=yes
    echocancel=yes
    echocancelwhenbridged=no
    echotraining=no
    immediate=no
    faxdetect=no
    rxgain=3.0
    txgain=3.0
    cidsignalling=v23
    module_name=wctdm24xxp
    cidstart=polarity
    signalling=1
    context=1
    opermode_checkbox=on
    opermode=uk
    alawoverride_checkbox=0
    alawoverride=0
    fxs_honor_mode_checkbox=on
    fxs_honor_mode=0
    callerid=asreceived


    I cant seem to get rid of the signaling = 1 and context = 1

    although the strange thing is this works absolutely perfectly with a standard Single BT PSTN....

    Thank you for your help

    ReplyDelete
    Replies
    1. are you using the dahdi module in the gui?
      have you tested each multiline socket with a normal phone
      eg is there a line fault on the multiline?

      Delete
    2. further thought what happens when you plug one say just line 1 in to freepbx does it behave properly then and then swap to second module on same master socket , eg do both modules behave correctly when singly plugged in

      Delete
  3. Hi,

    I have used the GUI in the past yes.... but not since I have been here.... I have managed to get the signaling/context to move out of the way....


    I have tried just one line no difference..... both lines have been tested by phone and BT....

    Thank you again

    ReplyDelete
    Replies
    1. so just one line plugged in a loud buzz and does not connect until caller hangs up?

      Delete
    2. if user dials out once the line is connected to PSTN loud buzz.... on incoming call PBX does not connect until caller hangs up

      Delete
  4. one thing to note.... I am waiting for the Disconnect Clear Time to be increased to 800ms.... but I still don't see why the Single one works but Multiline does not

    ReplyDelete
    Replies
    1. do you have callerid turned on with multilines from provider?

      Delete
    2. No it wasn't something they needed... is it required for FreePBX?

      Delete
    3. having said that Callerid is not on from BT on Single Line either... just FYI

      Delete
    4. callerid wont account for the buzzing
      but it may account for the hangup as the cards maybe looking for the callerid, have had many problems on panasonic pbx too with no callerid turned on.

      so when plugged in to another single line behaves perfectly using same freepbx behaves as expected?


      Delete
    5. yes... when the PBX is plugged into Single Line works fine... that doesn't have callerid either... im not sure about the buzz.. I think that happens but not as loud

      Delete
  5. would it be possible to get into pbx remotely?

    ReplyDelete
  6. Replies
    1. Jonathan there is a failsafe way of doing this if we run into problems
      i believe that the linksys spa3102 can be used as the pstn gateway, so x 2 of them and then simply setup two trunks as voip in freepbx to those units, they simply will convert pstn to voip for freepbx, so keep that in mind for a failsafe way.

      Delete
  7. you can call me details are here cotswoldpc.com so we can chat

    ReplyDelete
  8. Hi, I am having similar problem. BT multilines work fine. However if the caller hangs up before the extension answers the call then call keeps running. Asterisk doesnt detect hangup on BT Multiline

    ReplyDelete
  9. were you able to solve this? can someone pls help :(

    ReplyDelete
    Replies
    1. what cards are you using and version of asterisk?

      Delete
    2. Hi its a Digium Wildcard A4B with 4 FXO modules running on Elastix 2.5 with Asterisk Version 11.17.1

      Delete
    3. I would check that its setup for UK if in UK and also run a dahdi_genconf

      Delete
    4. Hi Tudor

      Following is the chan_dahdi.conf

      dahdi_genconf doesnt get me any info

      ; Auto-generated by /usr/sbin/hardware_detector
      [trunkgroups]

      [channels]
      cidsignalling=v23
      cidstart=polarity
      callprogress=yes
      context=from-pstn
      signalling=fxs_ks
      rxwink=300 ; Atlas seems to use long (250ms) winks
      usecallerid=yes
      hanguponpolarityswitch=yes
      hidecallerid=no
      callwaiting=yes
      usecallingpres=yes
      callwaitingcallerid=yes
      threewaycalling=yes
      transfer=yes
      canpark=yes
      cancallforward=yes
      callreturn=yes
      echocancel=yes
      echocancelwhenbridged=no
      faxdetect=incoming
      echotraining=800
      rxgain=0.0
      txgain=0.0
      callgroup=1
      pickupgroup=1
      relaxdtmf=yes

      ;Uncomment these lines if you have problems with the disconection of your analog lines
      busydetect=yes
      busycount=3
      busypattern=400/375,0/375

      immediate=no

      #include dahdi-channels.conf
      #include chan_dahdi_additional.conf

      Delete
    5. do you want to give me a call

      Delete
    6. what does /etc/dahdi/system.conf show

      Delete
    7. # Autogenerated by /usr/sbin/dahdi_genconf on Thu Sep 24 14:51:55 2015
      # If you edit this file and execute /usr/sbin/dahdi_genconf again,
      # your manual changes will be LOST.
      # Dahdi Configuration File
      #
      # This file is parsed by the Dahdi Configurator, dahdi_cfg
      #
      # Span 1: WCTDM/0 "Wildcard A4B" (MASTER)
      fxsks=1
      echocanceller=oslec,1
      fxsks=2
      echocanceller=oslec,2
      fxsks=3
      echocanceller=oslec,3
      fxsks=4
      echocanceller=oslec,4

      # Global data

      loadzone = us
      defaultzone = us

      strangely just noticed why is it US and not UK :/

      If its okay with you then I can call yes.

      Delete
    8. call me i think the US setting is wrong

      Delete
    9. Also
      Documentation from digium
      The FXO module never seems to hang-up the line. How do I set it to
      hang-up?
      Set busydetect = yes and busycount = 10 in the chan_dahdi.conf for
      your channels. This will cause the line to hang-up by listening for a
      consecutive number of busy tones. Upon editing chan_dahdi.conf , you
      will need to restart Asterisk.

      Delete
    10. This comment has been removed by the author.

      Delete
  10. This comment has been removed by the author.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Hi Tudor,

    I really want to thank you for all the efforts and time you put into sorting this issue out and for all the support. MUCH APPRECIATED!

    Really owe you! Thanks once again.

    God bless!

    ReplyDelete