Customized moh per extension

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#1
This will let you set a category of moh per extension, and override the default one.

1. backup /var/www/html/admin/modules/core/functions.inc.php
2. edit the file and find the following sections and leave them like:

in function core_devices_addsip($account)

Code:
...
array($account,'permit',(isset($_REQUEST['permit']))?$_REQUEST['permit']:''),
array($account,'disallow',(isset($_REQUEST['disallow']))?$_REQUEST['disallow']:''),
array($account,'mohsuggest',(isset($_REQUEST['mohsuggest']))?$_REQUEST['mohsuggest']:'default'),
array($account,'allow',(isset($_REQUEST['allow']))?$_REQUEST['allow']:'')
//array($account,'record_in',(isset($_REQUEST['record_in']))?$_REQUEST['record_in']:'On-Demand'),
...
in function core_devices_addiax2($account)
Code:
...
array($account,'disallow',($_REQUEST['disallow'])?$_REQUEST['disallow']:''),
array($account,'allow',($_REQUEST['allow'])?$_REQUEST['allow']:''),
array($account,'mohsuggest',($_REQUEST['mohsuggest'])?$_REQUEST['mohsuggest']:'default'),
array($account,'accountcode',($_REQUEST['accountcode'])?$_REQUEST['accountcode']:'')
//array($account,'record_in',($_REQUEST['record_in'])?$_REQUEST['record_in']:'On-Demand'),
...
in function core_devices_configpageinit($dispnum)
under
//iax2
Code:
...
$tmparr['deny'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['permit'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['mohsuggest'] = array('value' => 'default', 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'iax2', $tmparr);
...
in function core_devices_configpageinit($dispnum)
under
//sip
Code:
...
$tmparr['deny'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['permit'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['mohsuggest'] = array('value' => 'deault', 'level' => 1);
$currentcomponent->addgeneralarrayitem('devtechs', 'sip', $tmparr);
...

once you have finished, save the file and execute the following commands on the shell:
Code:
/var/lib/asterisk/bin/retrieve_conf
asterisk -rx "reload"
Now when you edit any of your extensions (sip or iax2) on the web interface, under "Device Options" you will see a new option "mohsuggest" in here you may put the music on hold category that will be used for that extension, just take into account that case is taken into account (pop is different that Pop).

If you write a moh category that doesn't exists or if you leave on blank this box, your extension will use the "default category"
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#2
Good job. Hope it will go in the next release.
 

dack

Joined
May 29, 2009
Messages
1
Likes
0
Points
0
#3
Excellent! I would love to see this in the next release.
 

mcfee

Joined
Oct 28, 2008
Messages
141
Likes
0
Points
16
#4
Thats awesome trick, Thanks for your post.


Bye
 

ElasMex

Joined
Oct 22, 2007
Messages
493
Likes
0
Points
16
#5
Hello jgutierrez

Is there any way to put music to external Elastix moh?

Greetings
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#6
Yes, it is possible, you may use streaming MOH, he is a link that may guide you
 

henryksm

Joined
Aug 24, 2009
Messages
9
Likes
0
Points
0
#7
Dear All,

We are newbie on VOIP, and now we have study with elastix software (elastix 1.5.2). We interest with topic moh per extension, so we have try it using guide that give in this topic. We have follow step-by-step that give.
When we try it (fill mohsuggest for some extension with another than default), we find trouble that moh for extension is still run on default.
We hope you can give us suggest to solve moh per extension problem.

Note: Asterisk verison 1.4.24

Thanks For Your Attention
 

Megabyte

Joined
Mar 28, 2009
Messages
327
Likes
0
Points
0
#8
Hi, yesterday i was trying to follow this sugestion about MoH per extension but i cant do it. please can you explain a little more how we can do it or can you upload a sample file of how we need to modify the file.

Thanks.
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#9
Did you got any error? What happened on the extension menu? Have you executed retrieve_conf? Have you done the reload step? Attach your modified file
 

Megabyte

Joined
Mar 28, 2009
Messages
327
Likes
0
Points
0
#10
Ok, right now i did it but i have one question


$tmparr['deny'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);
$tmparr['permit'] = array('value' => '0.0.0.0/0.0.0.0', 'level' => 1);

Now i can see in the created extensions too those fields.

When i add those lines i can define here and static ip here from what ip the phone its registering right?


Because the default install dosent have that option, but i think its a great plus for the security of thge system
 

henryksm

Joined
Aug 24, 2009
Messages
9
Likes
0
Points
0
#11
Dear all

we have following guide on this topic to create mohsuggest per extension. Our step is same as guide:
1. backup /var/www/html/admin/modules/core/functions.inc.php

2. /var/lib/asterisk/bin/retrieve_conf
3. asterisk -rx "reload"

After apply it, we find permit, deny and mohsuggest field in extension page. Mohsuggest filled with default value. We have try change mohsuggest from default to another value (ex: lagu). After change and appy configuration change, we have try it. Weh we try it, we still have default moh played. It seems that mohsuggest that we set earlier doesn't have affect.

Pelase help me to solve this problem. Thanks For Your Attention
Note: We attach funcions.inc.php that have mohsuggest field.
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#12
What version of Elastix are you using? If I'm not mistaken, changes where for Elastix 1.5
 

henryksm

Joined
Aug 24, 2009
Messages
9
Likes
0
Points
0
#13
Dear All,

Elastix version that we use is elastix 1.5.2
Thx
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,968
Messages
131,029
Members
17,679
Latest member
rodmontgt
Top