Jump to content
Vodia PBX forum
ahennis@voicespring.net

Trunk Custom Headers

Recommended Posts

We are using custom headers in our trunks with the To header set up as follows.

"{domain-display}" <sip:{if clip true}anonymous@anonymous.invalid{fi clip true}{if disa true}{ext-ani}@{domain}{fi disa true}{from-ani}@{domain}>

We need to change the "{domain-display}" part based on the outbound ANI of the extension making the call or some other custom field that can be configured for each extension. I do not see any other variables we can use to replace {domain-display} with to make this happen.

 

We can't use {ext-display} because each extension has the users first and last name configured. It would be great if there was a field for each extension that could be populated with this a value that set a variable that could be used in the custom header, something like {ext-CNAM}. If an extension's CNAM field were set to "Company 1" the {ext-CNAM} variable would "Company 1" If a different extension on the same domain had its CNAM field set to "Company 2" the {ext-CNAM} variable would "Company 2"

 

In he custom header below if an extensions CNAM field is set, whatever value was in the field would be used otherwise processing will continue and the {domain-display} variable will be used.

{if ext-CNAM isset}"{ext-CNAM}" "{domain-display}" <sip:{if clip true}anonymous@anonymous.invalid{fi clip true}{if disa true}{ext-ani}@{domain}{fi disa true}{from-ani}@{domain}>

Share this post


Link to post
Share on other sites

The first problem I see here is that you need to handle true and false cases. Otherwise you will end up with "Whatever" <sip:anonymous@anonymous.invalid123456@domain.com>.

 

I think it makes sense to include the general purpose parameters that are available for extensions and also other accounts. We will call them {ext-param1-3} in the next build. Then you can put whatever you like in there and reference it when building the header.

Share this post


Link to post
Share on other sites

Yes domain-paramX also makes sense!

This is great to have the variables exposed.

 

Will we also be able to do logical tests on the variables so we can change the header accordingly? For example using {if clip true} checks if the variable clip is true allowing us to return a different value if variable clip is set to true or false. Maybe something like {if ext-param1 isblank} or would it be as simple as {if ext-param1 ""} to make a string comparison with "" meaning a null value. I prefer the later as it is more flexible and allows not only checking if a variable is null but also if it is equal to a value.

 

For example in the below statement we are checking if the ext-param1 field has been populated for an extension making a call. If the variable has a non blank value the system would return {ext-parm1} else it would return {domain-display}.

 

{if ext-param1 isblank}"{domain-display}""{ext-param1}" <sip:{if clip true}anonymous@anonymous.invalid{fi clip true}{if disa true}{ext-ani}@{domain}{fi disa true}{from-ani}@{domain}>

Share this post


Link to post
Share on other sites

Yes you can combine that with conditional statements. If you want to compare with empty string, you can use {if ext-param1}, because the argument is missing and evaluate to "". There is actually no quoting there.

Share this post


Link to post
Share on other sites

Where are they located to put values in them,? I would expect the dom-param1-3 to be on the General Settings for the domain and ext-param1-3 to be somewhere  on the General tab for each extension. I do not see them anywhere. I am running 59.0 with build date of Oct 7 2017 03:01:21

Share this post


Link to post
Share on other sites

I have looked everywhere. Even the documentation. The Parameter 1, Parameter 2 and Parameter 3 fields under the registration tab have been there since at least 5.5.0 therefore I can't see how they would be related to a feature put in in v58.

Other than being the person who requested the feature I know nothing else about it that what has been presented it this thread. Would it be possible to check with the engineer who added the feature as to how the new feature works?

Share this post


Link to post
Share on other sites

That is what I am looking for.

I was unaware that the Parameter 1 thru 3 on the registration page were being used for this because the documentation says the following and makes no reference at all to them being accessible for use in custom trunk headers.

  • Parameters 1 through 3: Parameters 1 through 3 allow you to configure fixed values that can be used in conjunction with the "External Voicemail System" setting at the domain level. Without using these parameter settings, using a value of 7$u in the "External Voicemail System" setting tells the PBX to prefix the user name (number) with a "7" before sending it to an external voicemail system. If you prefer to set a fixed value (e.g., 555) for the user name, set one of the parameters to a specific extension (e.g., 555) and link it to the "External Voicemail System" setting by entering 7$1 (if using parameter 1) into the "External Voicemail System" setting. The PBX will then use 7555 for the ANI. These Parameter settings can also be used during the dial plan replacement operation. By default, the PBX uses "\r" in the dial plan replacement to substitute "trunk registrar." Similarly, you can use "\x" to use the value set in Parameter 1, "\y" to use the value set in Parameter 2, and "\z" to use the value set in Parameter 3.

 

Share this post


Link to post
Share on other sites

Hi,

 

Did you try to use these variables from the registration tab anyway? We are in middle of changing the documentation as well, maybe we will change this too.

Share this post


Link to post
Share on other sites

I have not tried yet. This was a feature that I requested and I was just looking at how to use it. I was specifically looking for the global variables (domain-parm1-3). I saw the variables were added to be used in the custom trunk header documentation on the wiki but I did not see anywhere in the wiki of the PBX GUI where I could populate the variables with values.

My understanding of the feature was that there would be 3 new fields on the Advanced|General Settings page of the domain where I could populate the variables with values. There was also supposed to be 3 new fields added for each extension where I could populate the variables with values.

I am looking forward to using this feature and am thankful it was added.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×