Difference between revisions of "Zaptel configuration for MOR"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= DAHDI Installation and configuration =
Asterisk now supports DAHDI for ISDN channels. But you can use the below guide - just make sure to configure MOR with support for ZAP channel names
More information [[Install Dahdi | here]]
= Checking if Zaptel is installed/configured to work with Asterisk properly =
= Checking if Zaptel is installed/configured to work with Asterisk properly =


Line 28: Line 34:
  ;Sangoma A104 port 1 [slot:1 bus:6 span:1] <wanpipe1>
  ;Sangoma A104 port 1 [slot:1 bus:6 span:1] <wanpipe1>
  switchtype=euroisdn
  switchtype=euroisdn
  '''context=from-pstn1'''
  '''context=from_pstn1'''
  '''group=1'''
  '''group=1'''
  signalling=pri_cpe
  signalling=pri_cpe
  channel =>1-15,17-31
  channel =>1-15,17-31
 
  ;Sangoma A104 port 2 [slot:1 bus:6 span:2] <wanpipe2>
  ;Sangoma A104 port 2 [slot:1 bus:6 span:2] <wanpipe2>
  switchtype=euroisdn
  switchtype=euroisdn
  '''context=from-pstn2'''
  '''context=from_pstn2'''
  '''group=2'''
  '''group=2'''
  signalling=pri_cpe
  signalling=pri_cpe
  channel =>32-46,48-62
  channel =>32-46,48-62
 
  ;Sangoma A104 port 3 [slot:1 bus:6 span:3] <wanpipe3>
  ;Sangoma A104 port 3 [slot:1 bus:6 span:3] <wanpipe3>
  switchtype=euroisdn
  switchtype=euroisdn
  '''context=from-pstn3'''
  '''context=from_pstn3'''
  '''group=3'''
  '''group=3'''
  signalling=pri_cpe
  signalling=pri_cpe
  channel =>63-77,79-93
  channel =>63-77,79-93
 
  ;Sangoma A104 port 4 [slot:1 bus:6 span:4] <wanpipe4>
  ;Sangoma A104 port 4 [slot:1 bus:6 span:4] <wanpipe4>
  switchtype=euroisdn
  switchtype=euroisdn
  '''context=from-pstn4'''
  '''context=from_pstn4'''
  '''group=4'''
  '''group=4'''
  signalling=pri_cpe
  signalling=pri_cpe
Line 58: Line 64:


<br><br>
<br><br>
= MOR Configuration =
= MOR Configuration =


Line 80: Line 87:
In file ''/etc/asterisk/extensions.conf'' at the very end add such lines:
In file ''/etc/asterisk/extensions.conf'' at the very end add such lines:


  [from_pstn1]
  ['''from_pstn1''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID1)
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''ID1''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)
 
  [from_pstn2]
  ['''from_pstn2''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID2)
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''ID2''')
exten => _X.,2,Goto(mor,${EXTEN},1)
['''from_pstn3''']
exten => _X.,1,Set(CDR(ACCOUNTCODE)='''ID3''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)
 
  [from_pstn3]
  ['''from_pstn4''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID3)
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''ID4''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)


[from_pstn4]
Now look at Providers page and press on EDIT for each Provider in MOR GUI again ID1 = ID for first Providers DeviceID, ID2 = ID for second Providers Device ID and so on:
exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID4)
exten => _X.,2,Goto(mor,${EXTEN},1)


Now look at Providers page in MOR GUI again and change ID1 = ID for first Provider, ID2 = ID for second Provider and so on.
[[Image:zap_deviceid.png]]


In our example after changes we will see:
In our example after changes we will see:


  [from_pstn1]
  ['''from_pstn1''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=21)
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''171''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)
 
  [from_pstn2]
  ['''from_pstn2''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=41)
exten => _X.,1,Set(CDR(ACCOUNTCODE)='''191''')
exten => _X.,2,Goto(mor,${EXTEN},1)
['''from_pstn3''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''201''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)
   
   
  [from_pstn3]
  ['''from_pstn4''']
  exten => _X.,1,Set(CDR(ACCOUNTCODE)=51)
  exten => _X.,1,Set(CDR(ACCOUNTCODE)='''211''')
  exten => _X.,2,Goto(mor,${EXTEN},1)
  exten => _X.,2,Goto(mor,${EXTEN},1)


[from_pstn4]
<br><br>
exten => _X.,1,Set(CDR(ACCOUNTCODE)=61)
 
exten => _X.,2,Goto(mor,${EXTEN},1)
= Connections visualized =
 
[[Image:zap3.png]]


<br><br>
<br><br>
== How did we do that?! ==
 
= Final steps =
 
Reload Asterisk and make calls.

Latest revision as of 19:17, 14 May 2012

DAHDI Installation and configuration

Asterisk now supports DAHDI for ISDN channels. But you can use the below guide - just make sure to configure MOR with support for ZAP channel names

More information here

Checking if Zaptel is installed/configured to work with Asterisk properly

In order to configure Zaptel for MOR, Zaptel should be installed and connected to work with Asterisk properly.

To check that in Asterisk CLI issue such command:

CLI> zap show status
Description                              Alarms     IRQ        bpviol     CRC4
wanpipe1 card 0                          OK        0          0          0
wanpipe2 card 1                          OK        0          0          0
wanpipe3 card 2                          OK        0          0          0
wanpipe4 card 3                          OK        0          0          0

Output can be different, but Alarms should show OK.

If you get:

CLI> zap show status
No such command 'zap show' (type 'help' for help)

That means Zaptel is not installed/configured to work with Asterisk properly. Fix it and only after that you can continue in this manual.



Configuring /etc/asterisk/zapata.conf

We as example here will configure each port of ISDN card as separate Provider. For this in /etc/asterisk/zapata.conf file make such changes to context field:

;Sangoma A104 port 1 [slot:1 bus:6 span:1] <wanpipe1>
switchtype=euroisdn
context=from_pstn1
group=1
signalling=pri_cpe
channel =>1-15,17-31

;Sangoma A104 port 2 [slot:1 bus:6 span:2] <wanpipe2>
switchtype=euroisdn
context=from_pstn2
group=2
signalling=pri_cpe
channel =>32-46,48-62

;Sangoma A104 port 3 [slot:1 bus:6 span:3] <wanpipe3>
switchtype=euroisdn
context=from_pstn3
group=3
signalling=pri_cpe
channel =>63-77,79-93

;Sangoma A104 port 4 [slot:1 bus:6 span:4] <wanpipe4>
switchtype=euroisdn
context=from_pstn4
group=4
signalling=pri_cpe
channel =>94-108,110-124

IMPORTANT! Your file can look different. Make changes ONLY to 'context=' and 'group=' fields, DO NOT EDIT ANYTHING ELSE!




MOR Configuration

Create 4 Providers in MOR like this:

Zap1.png

So after all they all looked like this:

Zap2.png

Important part is marked in RED.

NOTE: Channel values g1, g2, g3 and g4 represent group=1, group=2, group=3 and group=4 in /etc/asterisk/zapata.conf file. This is main link between Zaptel/ISDN and MOR.




Extension Configuration

Now it is necessary to configure extensions for calls to go directly to MOR and for MOR to really know from where call came.

In file /etc/asterisk/extensions.conf at the very end add such lines:

[from_pstn1]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID1)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn2]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID2)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn3]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID3)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn4]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=ID4)
exten => _X.,2,Goto(mor,${EXTEN},1)

Now look at Providers page and press on EDIT for each Provider in MOR GUI again ID1 = ID for first Providers DeviceID, ID2 = ID for second Providers Device ID and so on:

Zap deviceid.png

In our example after changes we will see:

[from_pstn1]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=171)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn2]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=191)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn3]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=201)
exten => _X.,2,Goto(mor,${EXTEN},1)

[from_pstn4]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=211)
exten => _X.,2,Goto(mor,${EXTEN},1)



Connections visualized

Zap3.png



Final steps

Reload Asterisk and make calls.