Friday 25 April 2008

HOWTO Connect Nokia E65 to Asterisk

Hi All,

This tutorial will be very usefull for some people who are looking to connect a Nokia E65 to Asterisk.

SIP Parameter

Name Mode : You need to define the name
Service Mode : IETF
Access Point : Your access point
Username : sip:userid@IP_address_asterisk_server
Compression : no
Register : Always active
Use security : Non


Proxy Parameter

Server address : sip :IP_address_asterisk_server
Domain : realm (default asterisk value)
Username : userid extension on Asterisk
Password : userpassword
Allow routing : yes
Type of transport : UDP
Port : 5060


Registrar Parameter

Server address registrar : sip :IP_address_asterisk_server
Domain : none
Username : userid extension on Asterisk
Password : none
Type of transport : UDP
Port : 5060


When everything is done, normally you will have a small icon (phone icon) on your E65 mobile phone

Let me know if you have a problem.


Best Regards.

Thursday 24 April 2008

Automatic Script for CMS (Call Management System) for Avaya

Hi All,

Sometimes it's arrives that you need to have to change a big list of login name or delete lot of login manually, so I think taht the scripts below will be very interesting for the majority of the people, so in first we'll see how to have a script in order to modify a list of login name and if the login doesn't exist then it will be created:

1) CMS Script to change agent and/or add the agent if he doesn't exist:

The value below must be changed in order to work with your system:

SERVERNAME= IP ADDRESS OF YOUR CMS SERVER
Dictionary.ACD = This is the value of your ACD on CMS
OpenTextFile("C:\agents.txt", 1) = This is the path where the list of your agent will be stored, so you need to create a file agents.txt on your hard drive C:\























Copy the content below in a file with the extension below .acsup so for example the name of my file will be "Script to change or add an agent.acsup" so you just need to doble click on this file and CMS will be started then enter your password and the script will be started automatically:


'LANGUAGE=ENG
'SERVERNAME=xx.xx.xx.xx
Public Sub Main()

'Place a ";" separated file name agents.txt on the root of C drive
'This file needs to have the agent format: Cyril;1234 on every line
'This line will be read and split on the ";" and put in an array to add into CMS


l=0 'loop value for read loop
result=0 'Answer on adding
c=0 'counter for giving the messagebox

dim regel, a 'variabel for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for agent name. All data is read into this from agents.txt
dim NumberArray(999) 'define array for agent number
dim fs, f 'define filesystem stuff for read
Dim agAdded
Dim agModif
Dim ress
cvsSrv.Dictionary.ACD = 3

'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\agents.txt", 1)

Dim ss


Do While f.AtEndOfStream <> True

'result = msgbox (regel, 1, "regel")
regel = f.ReadLine
a = split(regel,";")
NameArray(l) = a(0)
NumberArray(l) = a(1)
l=l+1
'regel = f.ReadLine
Loop 'keep reading in data until EOF hit.

'a = split(regel,";")
'NameArray(l) = a(0)
'NumberArray(l) = a(1)

f.Close 'close agents.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Read all agents into string and display it in a messagebox

for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Modify these Agents?")
if result = 1 then

sString = "" 'make string empty for next use

'Modify entries

b = cvsSrv.Dictionary.CreateOperation("Login Identifications",Op)
'b2 = cvsSrv.Dictionary.CreateOperation("Login Identifications",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 2540


agAdded = 0
agModif = 0
for c = 0 to l-1

If b Then
Op.SetProperty "login_id", NumberArray(c)
Op.SetProperty "ag_name", NameArray(c)

On Error Resume Next

if b = Op.DoAction("Modify") then

agModif = agModif + 1
else
sString = sString & " " & NumberArray(c) & (Chr(13) & Chr(10))


b2 = Op.DoAction("Add")
if Not(b2) Then
result = msgbox (NameArray(c), 64, "failed adding user")
else
agAdded = agAdded + 1
End If
end if

End If

next


ress = "Agents Added " & agAdded & " Agents Modified " & agModif
result = msgbox (ress, 64, "Result")

' if sString <> "toto" then
'msgbox sString, 64, "Following Agents Already Exist"
'else
'msgbox "All Agents Modify", 64, "Operation Succesfull"
' end if

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing

end if

end Sub




This is the code to delete automatically a list of agent:


'LANGUAGE=ENG
'SERVERNAME=xx.xx.xx.xx
Public Sub Main()

'Place a ";" separated file name agents.txt on the root of C drive
'This file needs to have the agent format: Cyril;1234 on every line
'This line will be read and split on the ";" and put in an array to delete in CMS


l=0 'loop value for read loop
result=0 'Answer on deleting
c=0 'counter for giving the messagebox

dim regel, a 'variable for readline and for splitting on ";"
dim sString 'variable for information on adding data
dim NameArray(999) 'define array for agent name. All data is read into this from agents.txt
dim NumberArray(999) 'define array for agent number
dim fs, f 'define filesystem stuff for read

cvsSrv.Dictionary.ACD = 3

'Reads file one line at a time into name and number array
'Place the textfile on the root of C drive

Set fs=CreateObject("Scripting.FileSystemObject")
Set f=fs.OpenTextFile("C:\agents.txt", 1)

Do While f.AtEndOfStream <> True
regel = f.ReadLine
a = split(regel,";")
NameArray(l) = a(0)
NumberArray(l) = a(1)
l=l+1
Loop 'keep reading in data until EOF hit.

f.Close 'close agents.txt file

Set f=Nothing 'clear f and fs
Set fs=Nothing

'Read all agents into string and display it in a messagebox

for c = 0 to l-1
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
next
result = msgbox (sString, 1, "Sure to Delete these Agents?")
if result = 1 then

sString = "" 'make string empty for next use

'Delete entries

b = cvsSrv.Dictionary.CreateOperation("Login Identifications",Op)
Op.Window.Top = 4490
Op.Window.Left = 4680
Op.Window.Width = 6000
Op.Window.Height = 2540

for c = 0 to l-1

If b Then
Op.SetProperty "login_id", NumberArray(c)
Op.SetProperty "ag_name", NameArray(c)

On Error Resume Next

if b = Op.DoAction("Delete") then
else
sString = sString & NumberArray(c) & " - " & nameArray (c) & (Chr(13) & Chr(10))
end if

End If

next
if sString <> "" then
msgbox sString, 64, "Following Agents Not in System"
else
msgbox "All Agents Deleted", 64, "Operation Succesfull"
end if

If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove Op.TaskID
Set Op = Nothing

end if

end Sub



Take care when you want to start your script if you have some different version language available on CMS it could try to start the wrong one so just start your english version log you on CMS and run the script.

If some french people need to have an adaptation I can also try to change my version to work with a French CMS Supervisor version.

I hope this tutorial could help some people!!

Monday 21 April 2008

HOWTO Connect Avaya to Asterisk

Hi All,

I think that it could be nice to share my knowledge on this subject and help the others people to connect Asterisk to Avaya:

In first we need to add on Avaya a new node-name:

Make on Avaya "change node-names ip"

And attribute the name Sip_server for our example and also the IP address of your Asterisk server:


Create a new signaling group, you need to use a CLAN of your system and the node-name that you have created above, keep the fiedl "Trunk group for Channel Selection" empty, this field will be fill after creation of the Trunk.



After the creation of the signalling we can create the trunk, in my example I'll create the trunk 42 but you can use a different number:

Page 1 of the trunk:



Page 2 of the trunk:





Page 3 of the trunk:



Page 4 of the trunk:



Page 5 of the trunk:



Page 6 of the trunk:



Creation of the uniform dialplan:



AAR Table:























Route pattern:





Now the trunk has been created don't forget to go back the signalling group that you have created and add in the field "Trunk group for channels selection" the value of your trunk in my example I have created a trunk 42 so it will be the value 42 in the field.

Now on Avaya we are ready to connect on Asterisk so we need to configure Asterisk:

You just need to follow my example below:

In H323.conf

[general]
port = 1720
bindaddr = 10.148.20.26
progress_setup = 8
progress_alert = 8
faststart=yes

h245tunneling=yes
gatekeeper = DISABLE

;We need to conserve the main parameters to allow the h323 to call to the SIP phone
disallow=all
allow=alaw
dtmfmode=inband
context=internal ; name of your context


[Avaya]
type=friend
context=internal
host=10.147.9.64; IP Address of your CLAN
port=1720; port used to connect on CLAN it could be some others port regarding your configuration in signalling group.
disallow=all
allow=alaw
canreinvite=no
dtmfmode=inband




In extensions.conf

[general]
static=yes
autofallthrough=yes


[internal]
;My extension 59xxx
exten => 59000,1,Dial(SIP/59000)
exten => 59000,2,VoiceMail(59000@118218)
exten => 59000,3,PlayBack(vm-goodbye)
exten => 59000,4,Wait(2)
exten => 59000,5,HangUp()



exten => _7XXXXX,1,Dial(H323/${EXTEN}@Avaya); Avaya Extension
exten => _5XXXX,1,Dial(H323/${EXTEN}@Avaya); to call on SIP Extension
exten => _4XXXX,1,Dial(H323/${EXTEN}@Avaya); Your extension on Avaya
exten => _006XXXXXXXX,1,Dial(H323/${EXTEN}@Avaya); to call on mobile
exten => _00XXXXXXXXX,1,Dial(H323/${EXTEN}@Avaya); to call on National


In Sip.conf
[general]
context=internal
bindaddr=10.148.20.26; IP Address of your Asterisk
srvlookup=yes
videosupport=yes ; if you want activate video support
canreinvite=no

[59000]
type=friend
secret=XXXXXXXXXX ;your password
host=dynamic
dtmfmode=inband
disallow=all
allow=alaw
allow=h263 ; to use a video codec if needed
callerid="Cyril CONSTANTIN" <59000>
nat=yes

Do not forget to restart Asterisk when you have finished to configure the .conf files.


I hope that this tutorial will help lot of people, if you follow this tutorial it will be easy for everybody to interconnect the both system.

Tuesday 8 April 2008

HOWTO Compil Asterisk 1.4.19 with H323

Hi All,

You are probably interesting to compile Asterisk with H323, after lot of test it has been successfully compiled but is not easy when you don't know Linux so if you follow this tutorial it will be easy for the majority of the people:


Installation of the package necessary on CentOS 5.1:
yum -y install ncurses ncurses-devel openssl openssl-devel zlib zlib-devel bison bison-devel glibc gcc kernel-devel flex


Installation of the package on Debian:

pt-get install libc6 libc6-dev libncurses5 libncurses5-dev libssl-dev openssl libssl0.9.8 flex m4 bison libpopt-dev libdv4-dev libpopt-dev zlib1g zlib1g-dev



Now you need to download the package for Asterisk from the folder /usr/src/:


mkdir -p /usr/src/Asterisk_and_H323
wget -P /usr/src/Asterisk_and_H323 http://www.voxgratia.org/releases/pwlib-v1_10_0-src-tar.gz
wget -P /usr/src/Asterisk_and_H323 http://www.voxgratia.org/releases/openh323-v1_18_0-src-tar.gz
wget -P /usr/src/Asterisk_and_H323 http://downloads.digium.com/pub/libpri/releases/libpri-1.4.3.tar.gz
wget -P /usr/src/Asterisk_and_H323 http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.19.tar.gz


Do not use another release more recent of OpenH323/Pwlib because the dependencies are not stable.

It can arrives sometimes that the compilation doesn't work due to a missing files /usr/include/linux/compiler.h, so it could be nice to create in all case the file below:

vi /usr/include/linux/compiler.h


Below the content of the compiler.h:


#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif /* __LINUX_COMPILER_H */



Compilation de PWLib:


cd /usr/src/Asterisk_and_H323
tar -xvzf pwlib-v1_10_0-src-tar.gz
cd pwlib_v1_10_0/
./configure --prefix=/usr
make opt
make install
export PWLIBDIR=/usr/src/Asterisk_and_H323/pwlib_v1_10_0


Compilation of the library OpenH323:

cd /usr/src/Asterisk_and_H323
tar -xvzf openh323-v1_18_0-src-tar.gz
cd openh323_v1_18_0
./configure --prefix=/usr
make opt
make install
export OPENH323DIR=/usr/src/Asterisk_and_H323/openh323_v1_18_0


Compilation de Libpri:

cd /usr/src/Asterisk_and_H323
tar -xvzf libpri-1.4.3.tar.gz
cd libpri-1.4.3
make install


Compilation d'Asterisk:

You can observe that there is 2 times the make command, it permits to check if the compilation of H323 has been successfully done, if it is not the case please re-check the step above.

cd /usr/src/Asterisk_and_H323
tar -xvzf asterisk-1.4.19.tar.gz
cd asterisk-1.4.19/
./configure --prefix=/usr
make menuselect (The modification can damage the compilation)
make
make
make install
make samples
make config
asterisk


In case of failure:

- Check the version of the software used. I can certify that all version used on CentOS works correctly. Take care about "./configure --prefix=/usr".

To uninstall:
In the installation folder (/usr/src/Asterisk_and_H323/...): make uninstall et rm

Please find the French version of this HOWTO originally made by my colleague Etienne:

Compiler Asterisk avec H323