Picture of Pascal 39
Registered 12 years 201 days
Pascal 39 Wednesday, 22 July 2015, 03:58 PM
MOH based on user setting
Hello,

Is it possible to set different MOH on each user / template

Regards
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Wednesday, 22 July 2015, 04:05 PM
1 of 1 users consider this post helpful
Re: MOH based on user setting
Hi Pascal,

I have moved that to the discussion forum, as it is a question rather than a suggestion, ok?

The only way to distinguish the MOH that comes to mind is described in the fish-help.png PBX/Config/General (Music On Hold URL).

This allows you to provide separate MOH for any user.

Regards, Christoph
Picture of Carlos 1853
Registered 10 years 208 days
Carlos 1853 Wednesday, 22 July 2015, 04:38 PM
Re: MOH based on user setting
Hi Christoph,

the question does interest me too, for a customer asked us yesterday about this.

Is it possible to configure different MOHs on each subscriber under PBX/Config/General ? And how?

Regards,

Carlos.
Picture of Peter 1333
Registered 11 years 156 days
Peter 1333 Wednesday, 22 July 2015, 04:50 PM
1 of 1 users consider this post helpful
Re: MOH based on user setting
Hello Carlos

So i will say, if i read the wiki, yes it would work.

Wiki Says:
Within the URL % can be used to put in some context information of the call. The information refers to the party which has put the receiving party on hold. For information about the receiving party itself, the id has to be preceeded by '.' (e.g. .l). l Long Name h Name (H.323 id) n Number N Node P PBX

so if you use
http://127.0.0.1/Company.$n.$coder?coder=g729&repeat=true

you must add files to the store like
Company.10.g729
Company.11.g729
Company.12.g729
etc.

You should have different MOH for each user.

Please test and report us, i don't have time at the Moment but i also want to know it smile

Peter
Picture of Carlos 1853
Registered 10 years 208 days
Carlos 1853 Wednesday, 22 July 2015, 05:01 PM
Re: MOH based on user setting
Hi Peter,

yes, it should work, I'll test it and let you know.


Thanks!

Carlos.
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Wednesday, 22 July 2015, 05:07 PM in response to Carlos 1853
Re: MOH based on user setting
Carlos,

the mechanism described in the link I provide above works as follows:

  • when a call needs MOH, then the PBX will create a call to the MOH provider
  • the MOH provider is configured in PBX/Config/General/Music On Hold URL
  • if it is empty (or the word MOH), the default (built-in) provider is used
  • if it is configured to an invalid URL, silence is used
  • if it is configured to an existing URL, the content of this URL is retrieved and used as MOH

For the URL, there some variables defined (see the wiki article). For example, let us assume your PBX user object has the Name property set to Carlos. When I call you (and my Name property is set to Christoph), then I could define the Music On Hold URL property as

http://my.fileserver.tld/somepath/moh-%h.$coder?coder=g729,g711a,g711u,g723&repeat=true&fallback=ringback

This will do the following for the call's MOH:

  • the %h will be replaced by your Name: http://my.fileserver.tld/somepath/moh-Carlos.$coder?coder=g729,g711a,g711u,g723&repeat=true&fallback=ringback
  • the PBX will off me (the caller) music on hold with g729,g711a,g711u and g723 codec
  • my phone will choose one of those (let us assume g.729)
  • the PBX will replace $coder by g729: http://my.fileserver.tld/somepath/moh-Carlos.g729?coder=g729,g711a,g711u,g723&repeat=true&fallback=ringback
  • the PBX will retrieve the content of http://my.fileserver.tld/somepath/moh-Carlos.g729
  • if this succeeds (the file is accessible), it will play its contents as MOH to me
  • once the file ends, it will start all over again (due to the repeat=true)
  • if it does not succeed, it will instead play a ringback tone (due to the fallback=ringback)

On your file server (http://my.fileserver.tld/somepath), you thus need the files moh-Carlos.g729, moh-Carlos.g711a, moh-Carlos.g711u and moh-Carlos.g723. So everybody will have ringback tone as MOH, except those users calling you. Of course, when you provide more files (for more Names), more users will have their own MOH.

When you retrieve the files locally (CF card), your URL will likely start with something like http://127.0.0.1/DRIVE/CF0/moh/).

Combining the %x variables and the fallback= mechanism lets you do a lot of magic.

Christoph
Picture of Peter 1333
Registered 11 years 156 days
Peter 1333 Wednesday, 22 July 2015, 05:15 PM
Re: MOH based on user setting
Hello Christoph

Do you have a better documentation then the wiki? smile
Waht can i do with the %x variable?

Peter
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Wednesday, 22 July 2015, 05:20 PM
Re: MOH based on user setting
smile no, how could I wink
"%x" was meant as a place holder for all those % substitutions which are possible (and documented)

smile c.
Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Wednesday, 22 July 2015, 05:21 PM in response to Christoph Künkel (innovaphone)
Re: MOH based on user setting
Just one more thought: the URL you provide does not need to point to a file really. Consider
http://my.scriptserver.tld/somepath/moh.php?coder=g711a&user=%h&caller=%.n
lets you do even more magic.
Picture of Peter 1333
Registered 11 years 156 days
Peter 1333 Wednesday, 22 July 2015, 05:24 PM
Re: MOH based on user setting
No comment at this time ;)
I will say like my gradfather, he was the doctor of you village, tell me what you can't do, then we are faster

Peter
Picture of Carlos 1853
Registered 10 years 208 days
Carlos 1853 Thursday, 23 July 2015, 08:49 AM
Re: MOH based on user setting
Hi,

http://192.168.64.11/DRIVE/CF0/moh/test.%n.$coder?coder=g729,g711a,g711u,g723&repeat=true

worked for me.

Christoph, can you edit the wiki to add the detailed description of your post and an example? There will be surely other interested people who will be glad to find it there.

Thanks!

Carlos.





Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Thursday, 23 July 2015, 08:54 AM
Re: MOH based on user setting
Good morning Carlos,

happy to hear this!
One question: are you sure you do not want a &fallback= query argument?

smile Christoph
Picture of Carlos 1853
Registered 10 years 208 days
Carlos 1853 Thursday, 23 July 2015, 09:00 AM
Re: MOH based on user setting
Hehe,

this is the first time I test this function: I'm not sure about a thing!

&fallback=true should play the default one if the file wasn't found, shouldn't it?

Regards,

Carlos.

Picture of Christoph Künkel (innovaphone)
Moderator Registered 15 years 132 days
Christoph Künkel (innovaphone) Thursday, 23 July 2015, 09:11 AM
Re: MOH based on user setting
exactly.
Also, you can have your own file in the same directory your custom MOH is in which is played. You would use fallback=mydefaultmoh then.
Picture of Carlos 1853
Registered 10 years 208 days
Carlos 1853 Thursday, 23 July 2015, 09:12 AM
Re: MOH based on user setting
Ok, dankeschön!

Grüße,

Carlos.
← You can define your color theme preference here