How to create H323 providers/devices in the MOR

From Kolmisoft Wiki
Jump to navigationJump to search

How to create H323 providers/gateways

H323 does not have Realtime support in Asterisk. That's why H323 should be configured not in GUI but in .conf files.

Future version of MOR will allow to manage it from GUI.

Using this configuration calls still be billed by MOR.



In order to configure them you should do following steps:

1. Create provider in GUI
2. Write down just created provider's device accountcode which can be found in provider's edit window in Device ID: field.
3. In h323.conf create section for this provider:

[nameofh323provider]
type=friend
host=22.33.44.55
fastStart=yes
context=from_pstn

NOTE: context=from_pstn

4. In extensions.conf

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

Where X(variable) is Device ID from Provider's settings, example:

Device id for providers.png

Here X == 1. (It is example! In your configuration X will have other value!)

NOTE: [from-pstn] is same context as in h323.conf

5. Reload Asterisk and you are ready to go!


H323 providers/gateway connection configuration example

Example configuration for 2 H323 gateways: MERA and QUINTUM

/etc/asterisk/h323.conf

[global]
userbyalias=no
[mera] type=friend host=23.45.67.89 fastStart=no context=from_mera
[quintum] type=friend host=192.168.10.5 fastStart=no context=from_quintum

/etc/asterisk/extensions.conf

[from_mera]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=X)
exten => _X.,2,Goto(mor,${EXTEN},1)
[from_quintum] exten => _X.,1,Set(CDR(ACCOUNTCODE)=Y) exten => _X.,2,Goto(mor,${EXTEN},1)

Note accountcodes X and Y - they should be equal to devices ID in MOR GUI to tie this configuration with MOR.

H323 device/user configuration example

Lets say we have 3 users:

  • 1st will dial from IP: 111.111.111.111
  • 2nd will dial from IPs: 222.222.222.222 AND 333.333.333.333
  • 3rd will dial from IPs: 444.444.444.444 and 555.555.555.555

Note: IPs ARE NOT real! That's just an example.

  • For 2nd user we do not care from which IP call came
  • For 3rd users each device on separate IPs, that means we CARE from which IP call came and we want to see which call came from which IP

1. Create appropriate users in GUI: user1, user2, user3

2. Create device1 for user1, remember ID of device1 (device1_ID)

3. Create device2 for user2, remember ID of device2 (device2_ID)

4. Create device31 AND device32 for user3, remember IDs of device31 and device32 (device31_ID and device32_ID)

  • How to know the devices ID? Go to appropriate user window and press on Device's icon. In window device ID = Acc in table:

Device id.png

5. In /etc/asterisk/h323.conf create such sections:

[device1]
type=friend
host=111.111.111.111
fastStart=yes
context=device1
[device21]
type=friend
host=222.222.222.222
fastStart=yes
context=device2
[device22]
type=friend
host=333.333.333.333
fastStart=yes
context=device2
[device31]
type=friend
host=444.444.444.444
fastStart=yes
context=device31
[device32]
type=friend
host=555.555.555.555
fastStart=yes
context=device32
  • NOTE: [deviceXX] is just for informational purposes, create any name you want here, do not make suplicates

6. Now n /etc/asterisk/extensions.conf create:

[device1]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=device1_ID)
exten => _X.,2,Goto(mor,${EXTEN},1)
[device2]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=device2_ID)
exten => _X.,2,Goto(mor,${EXTEN},1)
[device31]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=device31_ID)
exten => _X.,2,Goto(mor,${EXTEN},1)
[device32]
exten => _X.,1,Set(CDR(ACCOUNTCODE)=device32_ID)
exten => _X.,2,Goto(mor,${EXTEN},1)


  • IMPORTANT!!!! device1_ID, device2_ID, device31_ID and device32_ID are INTEGERS! Change them to the CORRECT VALUES which you got from GUI in STEP 2,3 and 4!

7. Reload Asterisk.

Troubleshooting

  • If you hear "Congratulation from asterisk ...." message that means you forget to set context = mor in h323.conf file for your provider.
  • If calls goes but there is no audio, make sure in h323.conf you have correct value for bindaddr.