Jump to content

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}>

Link to comment
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.

Link to comment
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}>

Link to comment
Share on other sites

  • 5 months later...

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?

Link to comment
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.

 

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...