Howto:Dynamic MOH

From innovaphone wiki
Jump to navigation Jump to search

Applies To

This information applies to

V12r2 and later

More Information

Problem Details

Sometimes it is desired to be able to play a different MOH per user, group or special selection.

We can store a custom logic, and then redirect to the MOH to use with an HTTP redirect.

Often you also able to solve your problem with the native methods in the PBX, see Music On Hold URL in Reference13r1:PBX/Config/General

System Requirements

A Linux Application Platform or a Webserver with PHP or something similar.

Installation

Use the following URL as Music On Hold URL in your PBX.

https://tld.com/dynamic_moh/moh.php?codec=$coder&coder=g722,g711a,g711u,g729,g723&user=%h

Create a PHP script on your LinuxAP with the following content

<?php

// $_GET['codec'] contains the selected codec // $_GET['user'] contains the H.323 name of the user who initiated the consultation


// create a SOAP lookup to the PBX (group membership, pbx selection, etc.) // create a CURL lookup to a different system // create whatever you need to make a decision

// use your own criteria from above if ($_GET['user'] == 'alice') {

   header("Location: https://tld.com/webdav/announcements/special_moh_for_alice.".$_GET['codec']);

} elseif ($_GET['user'] == 'cooper') {

   header("Location: https://tld.com/webdav/announcements/special_moh_for_cooper.".$_GET['codec']);

} else {

   header("Location: https://tld.com/webdav/announcements/default_moh.".$_GET['codec']);

}

?>

Known Problems