Wednesday, December 19, 2012

PBX Setting for Singapore Singtel ISDN

I had a chance to set up a PBX server with my ex company.  It was fun and recently , the server was down. I was called up and out of goodwill , I had a go at it.

The problem was someone upgraded rpm , modules and hence messing up the DAHDI settings.


Server --> Dell
ISDN Card -- > TE110P
Service Provider -- > Singtel ISDN-30

Software used --> AsteriskNow
Asterisk Core --> asterisk-core-1.6.2.24-1_centos5
GUI -- > Freepbx


these are the DAHDI settings (Freepbx)

Framing/Coding : CCS/HDB3/CRC4
Signalling: PRI-CPE
SwitchType: EuroISDN
Sync/Clock Source: 0
Context: from-pstn

*Others that are not mention , leave it as default

For the hardcore users,
# cat /etc/dahdi/system.conf
span=1,0,0,CCS,HDB3,CRC4
bchan=1-15,17-30
dchan=16
loadzone=sg


# cat dahdi-channels.conf


; Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0" (MASTER) HDB3/CCS/CRC4
group=0,11
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = default
group = 63

# cat /etc/asterisk/dahdi-channels.conf

; Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0" (MASTER) HDB3/CCS/CRC4
group=0,11
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = default
group = 63

Restart dahdi after applying the settings

*******
pri_net & pri_cpe control who acts like the "ISDN Network" and who acts like the "ISDN Customer Equipment". When you connect to a telco provided PRI, you'll want to set to "pri_cpe" *and* set the span in dahdi.conf to take clock from the line because you are customer equipment. If you are plugging your asterisk box into a PBX or something that is not a telco provided, you'll want to be set to "pri_net" because you are pretending to be the telephone network and you want to set the span in dahdi.conf to be timing level "0" to provide clock out onto the line.
*******

Check on dahdi status

From console

# asterisk -vvvr

dahdi show channels













 


dahdi show status



Blog shall revive

After stopping for 3 years... I am going to put in more effect in reviving this blog. (hopefully)

Tuesday, December 22, 2009

Centos 5.3 - LDAP Setup + PhpLdapAdmin

Installing of RPMs

## install PHP , APACHE and other nessecary RPMs using yum##

yum -y install autoconf automake automake17 bzip2 bzip2-devel bzip2-libs compat-gcc-34 compat-gcc-34-c++ compat-glibc compat-glibc-headers compat-libf2c compat-libgcc compat-libstdc++-296 compat-libsdc++-33 curl curl-devel expect expect-devel gcc gcc-c++ gdbm gdbm-devel gmp gmp-devel groff httpd httpd-devel httpd-manual krb5-auth-dialog krb5-devel krb5-libs krb5-workstation libgcc libidn libidn-devel libtool libtool-ltdl libtool-ltdl-devel ntp openssh openssh-clients openssh-askpass openssh-server openssl openssl-devel pcre pcre-devel perl-libwww-perl perl-Archive-Tar perl-Digest-HMAC perl-Digest-SHA1 perl-HTML-Parser perl-Net-DNS php php-ldap php-mysql php-pear redhat-rpm-config rpm rpm-build rpm-devel rpm-libs rpm-python sed setup setuptool stunnel system-config-date wget which zlib zlib-devel ncurses-devel

## install LDAP RPMs using yum##
yum -y install nss_ldap openldap openldap-servers openldap-devel openldap-clients perl-LDAP

#### Update the system ##
yum -y update

when done, Reboot the system

Creating of LDAP Folders

## Creating a LDAP directory instead of using the default ##
mkdir /var/lib/ldap/AL

## Copy moving the DB config file ##
cp /etc/openldap/DB_CONFIG.example /var/lib/ldap/AL/DB_CONFIG


## change the ownership to LDAP ##
chown -R ldap:ldap /var/lib/ldap/AL/


Configuration of LDAP

## Creating Root password ##
generate new LDAP root password in SSHA encryption (Without quotes)
slappasswd -s "Your Desire LDAP root password"

Results:
Example {SSHA}GSNjXV+Vlz1h989jGayZCbVKD1yrsxgf

## Edit slapd.conf using vi ##
vi slapd.conf


## additional variable to add in before database definitions - Disable annoymous login ##
disallow bind_anon

## Other changes to be made ##

edit the database to "bdb"

edit suffix to "dc=al,dc=ldap"

edit rootdn to "cn=root,dc=al,dc=ldap"

edit rootpw to the encryption password we generated earlier
rootpw {SSHA}GSNjXV+Vlz1h989jGayZCbVKD1yrsxgf

edit directory to "/var/lib/ldap/AL" to the folder we create earlier

## additional variable to add in "" - For fast searching ##
cachesize 10000

## additional variable to add in "" - Default size limt is 100 ##
sizelimit 999


save the configuration
Start openLDAP "/etc/rc.d/init.d/ldap start"


Installation of PLA
#### Install PhpLdapAdmin (PLA) ##
PLA can be downloaded from http://sourceforge.net/projects/phpldapadmin/files/


## untar the file to /var/www/html ##
tar {phpldapadmin-version}-xvf .tgz

## change the folder name to a shorter naming convention##
mv /var/www/html/phpldapadmin /var/www/html/pla

## Start Apache Server ##
/etc/rc.d/init.d/httpd start


Point your browser to the webserver -
E.g http://123.123.123.123/pla


Login to pla as root (Without Quotes)
login: cn=root,dc=al,dc=ldap
Password:
"Your Desire LDAP root password"


Using pla, we could create the respective OU groups and accounts under dc=al,dc=ldap

For more information of PLA, please refer to
http://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page

Solaris 10 - Zone Config

Error Message
============
lofiadm: /dev/lofictl: No such file or directory, Solaris non-global zone

zonecfg:plateng01p> add device
zonecfg:plateng01p:device> set match=/dev/lofictl
zonecfg:plateng01p:device> end
zonecfg:plateng01p> add device
zonecfg:plateng01p:device> set match=/dev/lofi/*
zonecfg:plateng01p:device> end
zonecfg:plateng01p> add device
zonecfg:plateng01p:device> set match=/dev/rlofi/*
zonecfg:plateng01p:device> end
zonecfg:plateng01p> verify
zonecfg:plateng01p> commit
zonecfg:plateng01p> exit

Reboot the zone

Solaris 10 - SSH problem

Unable to SSH into the server due to no common Kex alg (After patching up Solaris 10)

Error Message
==========
no common kex alg: client 'diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1', server 'gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g=='


[a] generate ssh keys
# /lib/svc/method/sshd -c


[b] Allow remote root login in /etc/ssh/sshd_config ( Only for those using root access)
PermitRootLogin no -> PermitRootLogin yes

[c] enable ssh daemon
# /usr/sbin/svcadm enable ssh

Solaris 10 - Reset root password.

Use Clt+break to enter OK prompt


# mount /dev/dsk/c0t0d0s0 /a
# cd /a/etc
# TERM=vt100
# export TERM
# vi shadow(Remove root's encrypted password string)
# cd /
# umount /a
# init 6

1st Posting

Have been thinking to post up on blog post for a long time. And today will be the day that I start.

The purpose of this blog is to document all those problems I faced during my work(Linux and Solaris) . Hopefully one day it will come handy for You or me.