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

[global]
bindaddr=YOUR_SERVERS_IP
userbyalias=no

create section for this provider:

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

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 h245Tunneling=no [quintum] type=friend host=192.168.10.5 fastStart=no context=from_quintum h245Tunneling=no

/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
h245Tunneling=no
[device21]
type=friend
host=222.222.222.222
fastStart=yes
context=device2
h245Tunneling=no
[device22]
type=friend
host=333.333.333.333
fastStart=yes
context=device2
h245Tunneling=no
[device31]
type=friend
host=444.444.444.444
fastStart=yes
context=device31
h245Tunneling=no
[device32]
type=friend
host=555.555.555.555
fastStart=yes
context=device32
h245Tunneling=no
  • 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.

ast_rtp_new_with_bindaddr: Unexpected bind error: Cannot assign requested address

In file /etc/asterisk/h323.conf set

bindaddr=IP

where IP is your servers' IP

h245Tunneling and fastStart options

These values (yes/no) depends on configuration on other end (e.g. your provider or device). These settings should match. If you have problems sending or receiving call - make sure these values are correct.


h323 debug

If nothing helps execute h323 debug command on Asterisk CLI and look for call end string.

Then check it with H323 hangupcause codes to see why call failed.


No Audio

In file /etc/asterisk/h323.conf set

bindaddr=IP

where IP is your servers' IP