The new face of Parsipal.com

January 24th, 2012

Parsipal.com has the new face.

good example for adding ssl/tls to phpmailer

December 20th, 2011

Here is a good example for having TLS or SSL on PHPMailer.

                $mail = new PHPMailer();
                $mail->IsSMTP();
                $mail->Host = "1.1.1.1";
                $mail->SMTPAuth = true;
                $mail->SetFrom('fax@lopl.net', 'lopl.net');
                $mail->AddReplyTo('fax@lopl.net', 'lopl.net');
                $mail->Username = 'fax@lopl.net';
                $mail->Password = 'xxxxxxxx';
                $mail->AddAddress("lopl@lopl.net");
                $mail->Subject = "New Fax";
                $mail->SMTPDebug = 3;
                $mail->SMTPSecure = 'tls'; // or $mail->SMTPSecure = 'ssl';
                $mail->Body = "You have new FAX ";
                $mail->Send();
                echo "Error sending: " . $mail->ErrorInfo;

				

new page at parsipal.pcn.ir

December 4th, 2011

My company has a new page at Parscenter.com for new products.

parsipal.pcn.ir is a good place for our new products, related Voice over IP and signal processing.

 

New Products of Parsipal

December 4th, 2011

ParsCenter.com  is a great directory for Persian products.

It’s a good place for description the new products.

here  is the page of my company  at this directory.

parsipal.pcn.ir

 

 

 

Steve Jobs

October 6th, 2011

In memory of Steve Jobs….

We Love You, Steve....

SSH Tunnel for H323

October 2nd, 2011

Here is a good practical solution, for tunneling H323 packets thru SSH.

A is H323 IPPhone or H323 Calls Originator.

B is a Linux server in a same network with A.

C is a Linux server (H323 PBX).

 

Our main goal is transferring H323 Calls from A to C, through the SSH Tunnel(between B and C).

1-SSH Server in C, and SSH client in B.

2-Setup automatic login with SSH without password.

  • Login to the ssh server with your client.
  • Generate your key pair using the following command:

    $ ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/jurn/.ssh/id_rsa):
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/jurn/.ssh/id_rsa
    Your public key has been saved in /home/jurn/.ssh/id_rsa.pub
    $ cd ~/.ssh
    $ cat id_rsa.pub >> authorized_keys
    $ chmod 600 authorized_keys

    Don’t use any passphrase

  • Log out of the server and go back to your local shell

    $ cd
    $ mkdir .ssh

  • Copy the file id_rsa that was generated on the server into this directory. You can use sftp or scp for this.

$ cd .ssh $ chmod 600 id_rsa

  • You should now be able to login via ssh without having to prompt for a password.

    Thanks magicmonster for this example.

     

3-Run this command in B.

ssh -L 0.0.0.0:1720:localhost:1720 root@C_SSH_IP -p C_SSH_PORT

 This command open TCP port 1720 on B, and forward it to TCP Port 1720 on C.

0.0.0.0 means accept VOIP traffic on the all interfaces of B .

4-Set The IP of B, as the H323 gateway of A.

5-The SSH connection is not smart, for detection the disconnection and reconnection , you need AutoSSH.

  • wget http://www.harding.motd.ca/autossh/autossh-1.4b.tgz
  • tar -zxvf  autossh-1.4b.tgz
  • cd autossh-1.4b
  • ./configure; make; make install
  • Finally, my little script, add this to your startup.
    #!/bin/sh
    #
    # Example script to start up tunnel with autossh.
    #
    # This script will tunnel 1720 from the remote host
    # to 1720 on the local host.
    #
    ID=root
    HOST=C_SSH_IP
    if [ "X$SSH_AUTH_SOCK" = "X" ]; then
     eval `ssh-agent -s`
     ssh-add $HOME/.ssh/id_rsa
    fi
    AUTOSSH_POLL=600
    AUTOSSH_PORT=20000
    AUTOSSH_GATETIME=30
    AUTOSSH_LOGFILE=$HOST.log
    AUTOSSH_DEBUG=yes
    AUTOSSH_PATH=/usr/bin/ssh
    export AUTOSSH_POLL AUTOSSH_LOGFILE AUTOSSH_DEBUG AUTOSSH_PATH AUTOSSH_GATETIME AUTOSSH_PORT
    autossh -2 -fN -M 20000 -L 0.0.0.0:1720:localhost:1720 ${ID}@${HOST} -p C_SSH_PORT
    
    
    Thanks for Pierre for this script.
    
    
    
    
    enjoy it.
    
    

libmysqlclient

August 24th, 2011

Before it, there was a rpm for libmysql-client, But during the developing it was renamed to mysqlclient.

Sometimes for installing or compiling new softeware on linux, this error is familiar.

error: Failed dependencies:
        libmysqlclient.so.16 is needed by ...

The solution:

search and install the proper version of mysqlclient. for example here.

 

Dedicated servers

August 23rd, 2011

In each project, finding a powerful hosting for dedicated server or VPS is an important part.

7years ago, I need one. The Fasthost was a best choice. a powerful control panel helped us to improve our services.

After that, I found Rapidswitch(49pence.com), a little company with very good services and extended vision. It was too interesting for us, the speed of ticket answering. all the problems were solved in a few seconds.

Now, there are a lot of  very good data centers. but I never forget the good services we got.

Replacing the content of multifiles in linux

August 21st, 2011

I found this shell script very useful, for replacing a string in the files.

#!/bin/bash
     for fl in *.*; do
     mv $fl $fl.old
     sed 's/oldstring/newstring/g' $fl.old > $fl
     rm -f $fl.old
     done

replace oldstring and newstring with what you need.

 

Asterisk Function Denoise

August 15th, 2011

Denoise is a very powerful function, registered into the asterisk by installing  speex-lib.

This function is not very popular, but has a very powerful functionality.

The following lines show how to use in extensions.conf:

 

exten => 1,1,Set(DENOISE(rx)=on)
exten => 1,2,Set(DENOISE(tx)=off)

 

also try it:

exten => 1,1,Set(AGC(rx)=8000)
exten => 1,2,Set(AGC(tx)=off)

for increasing and decreasing the gain.

more info.