Howto:Dynamic MOH: Difference between revisions
(New page: <!-- Keywords: dynamic moh, moh per user, moh per group --> ==Applies To== This information applies to V12r2 and later ==More Information== ===Problem Details=== Sometimes it is desired t...) |
|||
Line 26: | Line 26: | ||
// SOAP lookup to the PBX (group membership, pbx selection, etc.) | // create a SOAP lookup to the PBX (group membership, pbx selection, etc.) | ||
// CURL lookup to a different system | // create a CURL lookup to a different system | ||
// | // create whatever you need to make a decision | ||
// use | // use your own criteria from above | ||
if ($_GET['user'] == 'alice') { | if ($_GET['user'] == 'alice') { | ||
header("Location: https://tld.com/webdav/announcements/special_moh_for_alice.".$_GET['codec']); | header("Location: https://tld.com/webdav/announcements/special_moh_for_alice.".$_GET['codec']); |
Revision as of 14:42, 11 March 2019
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.
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']);
} else {
header("Location: https://tld.com/webdav/announcements/default_moh.".$_GET['codec']);
}
?>