X100P

From LinuxMCE
Jump to: navigation, search

1) Create a blank zaptel.conf file in /etc/

   NOTE: If this file does not exist the zaptel driver install will fail.

2) Open a shell and type: sudo apt-get install zaptel

3) In your shell type: genzaptelconf

   This will populate the blank zaptel.conf file you created earlier

4) Now you are ready to write your zapata.conf file in /etc/asterisk I have attached both my zaptel.conf and my zapata.conf as working examples.

5) We should be able to run some diagnostic commands to be sure we're on the right track. You can run ztcfg -vvvv and you should get some output similar to the following:

Zaptel Version: 1.4.3 Echo Canceller: MG2 Configuration

==========

Channel map: Channel 01: FXS Kewlstart (Default) (Slaves: 01) 1 channels configured.

6) The manual part is done at this point, now we jump to the LMCE web-admin and navigate to Advanced>Phones Setup>Trunks>Add Zap Trunk.

7) My PSTN line is my only phone line so I route all traffic in and out of it so the only fields I filled out were :

Outbound Caller ID: Your Phone # Maximum Channels: 1 Zap Identifier (trunk name): 1

Cool Submit and apply your changes

9) This part I am fuzzy on since my current installation is simply ringing every phone in my house, whether it is a standard PSTN or a SIP phone. At any rate, I have a ring group I created to accomplish this, pm me if you want more details and I'll break it down but it is beyond the scope of a basic working setup. Anyways, we need to create and inbound route so click on Inbound Routes, I configured mine as follows:

Zaptel Channel: 1 Destination Ring Groups: RingAll <600>

You should configure your destination to your needs and based on how you want asterisk to work in your setup.

10) Submit and apply your changes

11) This is the last part, we need to create an outbound route so that asterisk knows when you use our zaptel trunk. Click on Outbound Routes. I configured mine as follows:

Route Name: OutPSTN Dial patterns wizards: Local 7/10 and Emergency Trunk Sequence: ZAP/1

12) Submit and apply your changes

13) Reload zaptel and verify our work from the CLI by loading up a shell and typing Asterisk -vvvvvvvvvvr, to reload zaptel we type zap restart, then check our card by typing zap show status. We should see some output like:

Description Alarms IRQ bpviol CRC4 Wildcard X100P Board 1 OK 0 0 0 ZTDUMMY/1 1 UNCONFIGUR 0 0 0

14) Finally we can verify the channels are created successfully by typing zap show channels and you should see something like:

  Chan Extension     Context                       Language   MOH Interpret
   pseudo                  from-zaptel                default
   1                           from-zaptel                default

Taken directly from a post made by los93sol [1]

attachments: zapata.conf [2] zaptel.conf [3]




The above information does not seem to work with 1004 : mainly because there is no freepbx and now we must use DAHDI instead of zaptel

I am currently working on getting my X100P card working in 1004 I have found that the package to install / manage the drivers for this type of card is: apt-get install dahdi

I've been looking at this page for more info about the new package/driver: [4]

my lspci returns:

01:07.0 Communication controller: Motorola Wildcard X100P

and dahdi_hardware returns:

pci:0000:01:07.0 wcfxo- 1057:5608 Wildcard X100P

Using this link I was able to figure out the following: [5]

once dahdi was installed I had to add the driver to /etc/dahdi/modules file: for the X100P card the driver name was: wcfxo

then restarted dahdi: service dahdi restart

then I noticed in dmesg that the correct module was installed for the card that showed lspci

then I ran dahdi_cfg and dahdi_genconf

it generated the correct configuration files for both dahdi and asterisk, but asterisk did not have the dahdi modules installed so I ran: apt-get install asterisk-dahdi and then uncommented the dahdi module from /etc/asterisk/modules.conf

I then created a /etc/asterisk/chan_dahdi.conf file with the contents of the previously mentioned zapata.conf file; changing the second occurrance of context to have the value "from-trunk-<MYPHONENUMBER>".

I restarted asterisk and connected to the console using asterisk -vvvvr

and typing dahdi show channels I can see my card. I can also execute dahdi_tool and see my card.

apprently much of asterisk is configure in mysql and can be accessed using mysql -u asteriskuser -p asterisk / lmce

this page explains alittle how the database part of the asterisk configuration is used: [6]

To be able to make outbound calls and it would be enought to just execute the following sql:

insert into extensions values (, 'outbound-allroutes', '_.', '1', 'Macro', 'dialout-trunk,DAHDI/1,${EXTEN:1},,');

insert into extensions values (, 'outbound-allroutes', '_.', '2', 'Macro', 'outisbusy,');

but thats a hack and nothing else in from web admin would work...

so I made the following changes to dcerouter:

/var/www/lmce-admin/operations/phones/phoneLines.php Line: 24 (REPLACE):

$ProtocolList=array('SIP','IAX','SPA','GTALK','DAHDI');

Line: 106 (REPLACE):

<td>'.translate('TEXT_HOST_CONST').' / Channel *</td>

/usr/pluto/bin/db_phone_config.sh Line: 366 (APPEND):

       elif  $protocol == "DAHDI" ; then
               LINESSQL="$LINESSQL INSERT INTO $DB_Extensions_Table (context,exten,priority,app,appdata) VALUES \
               ('$context','_$prefix.','1','Macro','dialout-trunk,$protocol/$host,+\${EXTEN}:1},,'),\
               ('$context','_$prefix.','2','Macro','outisbusy,');"

Lines: 382-387 (REPLACE):

       context="from-trunk-$phonenumber"
       LINESSQL="$LINESSQL DELETE FROM $DB_Extensions_Table WHERE context like '$context';"
       if  $protocol == "DAHDI" ; then
               LINESSQL="$LINESSQL INSERT INTO $DB_Extensions_Table (context,exten,priority,app,appdata) VALUES \
               ('$context','_.','1','Set','GROUP()=OUT_$LineCounter'), \
               ('$context','_.','2','Goto','from-trunk,$phonenumber,1');"
       else
               LINESSQL="$LINESSQL INSERT INTO $DB_Extensions_Table (context,exten,priority,app,appdata) VALUES \
               ('$context','_.','1','Set','GROUP()=OUT_$LineCounter'), \
               ('$context','_.','2','Goto','from-trunk,\${EXTEN},1');"
       fi

NOW you can select DAHDI in the phonelines menu of web admin when you add a new phoneline. set the phone number to the same phone number you set in chan_dahdi.conf ("from-trunk-<MYPHONENUMBER>"). and in hostname put the channel number (with X100P it ought to be 1). Set whatever name, username, password you want (that info is not used).

ANOTHER Change I made was to the voicemail timeout. Not sure if its just me, but when someone hung up without selecting something from voice-menu-lmce-custom asterisk would just loop (even though they hung up). so I made the following changes:

file: db_create_dialplan.sh line: 292 (replace);

       ('$Context_Voice_Menu','t','1','Playback','vm-goodbye'),
       ('$Context_Voice_Menu','t','2','Macro','hangupcall,'),

and ran this in mysql console:

update extensions set app = 'Playback', appdata = 'vm-goodbye' where context = 'voice-menu-lmce-custom' and exten = 't' and priority = '1'; insert into extensions values (, 'voice-menu-lmce-custom', 't', '2', 'Macro', 'hangupcall,');