[Asterisk-Users] TDM400 w/ FXS S110M pinout on RJ11 connector?

2005-09-02 Thread Werner Johansson

Hi all,

I just got my long awaited FXS modules for a TDM400 card, and was a bit 
puzzled about how my phones and the FXS interface worked together. Here 
goes:


In Sweden (that's where I am located) phones traditionally are connected in 
daisy chain configuration. This means that a phone in on-hook condition 
passes the line through back onto the outer pair of the RJ11, back into the 
wall outlet to the next phone's inner pair. Our phone outlets automatically 
goes into pass-through mode if no phone is attached (otherwise all outlets 
has to be connected to phones for it to work). Anyway when I tried just 
connecting a phone to the FXS module it immediately thought the phone was 
going off-hook, nothing seemed to help to get it back on-hook. Finally after 
disconnecting the phone it goes back on-hook. I realised that something was 
wrong with the pinout when I used a cable with only the inner pair connected 
and everything just works to work. After some more testing I discover that 
I'm actually causing a complete _short_ on the battery voltage by looping 
the inner pair back to the outer pair in the phone! The voltage drops from 
approx. -48V to 0.0V.


To my question: Does anyone know what's actually connected to the outer pair 
on the TDM400 ports? I guess the only workaround is to only use cables where 
only the two wires from the inner pair is connected?


This might be informative to others trying the same thing as I did, I though 
it would be a quick way to see that the ports were alive, only to find that 
they appeared completely broken when I tried.. :| Any educated guesses why 
the ports are wired as they are?


Regards,
Werner 


___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Current status on _outgoing_ Swedish/Dutch DTMF CLIP for TDM400 FXS interfaces?

2005-09-03 Thread Werner Johansson

Hi all,

I have been looking at the code for both the zaptel driver (wctdm.c/wcfxs.c) 
and the asterisk channel driver (chan_zap.c) trying to figure out how much 
of this that has been implemented. So far I can see that the current stable 
1.0.9.1 zaptel driver don't have the SETPOLARITY ioctl that would be 
required to properly signal the Swedish/Dutch CLIP, but the 1.2 beta1 has 
this support..


Moving forward from that I then look at the 1.2 beta1 chan_zap code, but 
nothing's in there could possibly give us any DTMF tones. I have seen some 
bugs being posted and closed (particulary this one: 
http://bugs.digium.com/view.php?id=3866). After a bit of experimenting with 
that code and the fxstest.c code supplied with zaptel I have something that 
actually reverses the polarity of the idle line, waits, sends the digits, 
waits again and reverses polarity back to normal - this results in fully 
working CallerID using my stand-alone CID display and a Gigaset4010 DECT 
phone which unfortunately doesn't understand FSK CLIP/CNIP. I have also 
checked the signal with my scope and it looks just like my landline CLIP 
procedure (and working equally well.. :))


The code is provided at the end of this mail. After browsing the 1.2beta1 
release I also downloaded the latest bleeding edge cvs and verified that 
these parts of the code looked exactly like 1.2beta1.


There are a few questions I have though:

Why do I have to continuously set the ProSLIC register 64 to 6 (active 
reverse transmission) to get the tones onto the line if I'm onhook? Only 
doing it once just after reverse polarity ioctl doesn't do the trick... The 
idea with SETPOLARITY in addition with going OFFHOOK with ZT_HOOK should be 
the same, right? It works if I take the phone offhook though, then I can 
hear the tones even without having to force the register to 6. Next question 
would be if there's a better way to know that the "dialing" is complete, 
especially if this is to be embedded into the chan_zap code, it would be 
nice to have a cleaner solution?


Is this something for the dev list as well, I guess there's some interest in 
getting this to work in the stock Asterisk code, even though we're not that 
many people requiring this as it seems..? Should I reopen the bug?


I'm thankful for any input in this matter..

Regards,
Werner


#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "zaptel.h"
#include "tonezone.h"
#include "wctdm.h"

static int tones[] = {
   ZT_TONE_DIALTONE,
   ZT_TONE_BUSY,
   ZT_TONE_RINGTONE,
   ZT_TONE_CONGESTION,
   ZT_TONE_DIALRECALL,
};

int main(int argc, char *argv[])
{
   ZT_DIAL_OPERATION dop;
   struct wctdm_regop regop;
   struct zt_dialparams dps;

   int fd,ctlfd,toneduration;
   int res;
   int x;
   if (argc < 3) {
   fprintf(stderr, "Usage: fxstest  \n"
  "   where cmd is one of:\n"
  "   stats - reports voltages\n"
  "   regdump - dumps ProSLIC registers\n"
  "   tones - plays a series of tones\n"
  "   polarity - tests polarity reversal\n"
  "   ring - rings phone\n");
   exit(1);
   }

// Code added by [EMAIL PROTECTED] to set the default tone length to shorten the 
time it takes to transmit DTMF CLIP
//  25ms is enough for me but according to specs 40 _should_ be understood 
as a valid digit, YMMV.

   ctlfd = open("/dev/zap/ctl", O_RDWR);
   if (ctlfd == -1) {
   fprintf(stderr,"Couldn't open zapctl!\n");
   }

   toneduration = 40;
   if (toneduration > -1) {
   dps.dtmf_tonelen = dps.mfv1_tonelen = toneduration;
   res = ioctl(ctlfd, ZT_SET_DIALPARAMS, &dps);
   if (res < 0) {
   fprintf(stderr,"Couldn't dialparms!\n");
   }
   }
   close(ctlfd);
// End of code added - [EMAIL PROTECTED]

   fd = open(argv[1], O_RDWR);
   if (fd < 0) {
   fprintf(stderr, "Unable to open %s: %s\n", argv[1], 
strerror(errno));

   exit(1);
   }
   if (!strcasecmp(argv[2], "ring")) {
   fprintf(stderr, "Ringing phone...\n");
   x = ZT_RING;
   res = ioctl(fd, ZT_HOOK, &x);
   if (res) {
   fprintf(stderr, "Unable to ring phone...\n");
   } else {
   fprintf(stderr, "Phone is ringing...\n");
   sleep(2);
   }
   } else if (!strcasecmp(argv[2], "polarity")) {
// Code modified by [EMAIL PROTECTED] to not only reverse polarity but also send an 
example DTMF CLIP

   fprintf(stderr, "Sending DTMF CLIP...\n");

   x = 1;
   res=ioctl(fd, ZT_SETPOLARITY, &x);
   if (res) {
   fprintf(stderr, "Unable to set reverse 
polarity...\n");

Re: [Asterisk-Users] newbie install problem. And I already searchedeverywhere!

2005-09-03 Thread Werner Johansson

When startin * it tells me:

[chan_zap.so] => (Zapata Telephony w/PRI)
== Parsing '/etc/asterisk/zapata.conf': Found
Sep 3 17:21:59 DEBUG[1076873856]: chan_zap.c:1208 update_conf: Updated
conferencing on 1, with 0 conference users
-- Registered channel 1, PRI Signalling signalling
Sep 3 17:21:59 DEBUG[1076873856]: chan_zap.c:1208 update_conf: Updated
conferencing on 2, with 0 conference users
-- Registered channel 2, PRI Signalling signalling
-- Automatically generated pseudo channel
== Starting D-Channel on span 1

..snip..

and my zapata.conf is:
===
[channels]
switchtype = euroisdn

; p2mp TE mode
signalling = bri_cpe_ptmp

; p2p TE mode
;signalling = bri_cpe
; p2mp NT mode
;signalling = bri_net_ptmp
; p2p NT mode
signalling = bri_net

pridialplan = national
prilocaldialplan = local
nationalprefix = 0
internationalprefix = 00

echocancel=yes
echotraining = 100
echocancelwhenbridged=yes

immediate=yes
group = 1
context=incoming
channel => 1-2



This configuration looks strange. You know that the "channel" word sets 
those channels to the "latest" settings above, right? The syntax is a bit 
weird. That means that your signalling looks odd - first you set it to 
bri_cpe_ptmp and then to bri_net, meaning that bri_net overrides the 
previous setting. I'm a bit confused about the PRI signalling here, it looks 
like you're using a BRI card, so why pridialplan? I haven't played around 
with BRI equipment together with Asterisk (yet) so maybe the PRI signalling 
should be there..


What is ztcfg -vv giving as output if you run it?

/Werner 


___
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users