Documentation
pascom Cloud Phone System Documentation and Release Notes
Structure Examples
Learn how to map external data to system variables in the Connector.
Assign variables in the structure
In the tab of the connector, the variables defined in advance (instructions here) must now be assigned to the system variables of the pascom telephone system. Here it is now determined where the connector should transfer the imported data.
Job title of a user in the note field of the pascom phonebook
In the following section we follow the example from the Variable Assignment and enter the job title of a user in the pascom phone book.
To do this, add the lines:
"028pho_notes" : "{{{job}}}"
in der Struktur:
{
"identity": [{
"003use_bez": "{{{displayname}}}",
"003use_name": "{{{username}}}",
"003use_pw": "{{{password}}}",
"011acc_pin": "{{{pin}}}",
"009ext_extension": "{{{phone}}}",
"016voi_email": "{{{email}}}"
,"post": {
"phonebook": [{
"028pho_bez" : "{{{displayName}}}",
"028pho_firstname" : "{{{givenName}}}",
"028pho_lastname" : "{{{surname}}}",
"028pho_email" : "{{{email}}}",
"028pho_notes" : "{{{job}}}"
}]
}
}]
}
This passes the value of the job variable to the 028pho_notes system variable, thereby populating the notes field in the phone book of a user with the job title.
With this type of mapping, imported data can be assigned individually.
Role Assignment
In order to be able to automatically assign users with roles whilst importing, the structure will need to be expanded to accommodate role assignments. The corresponding user roles can be read from the memberOf variable
Under the tab, add the following line by clicking :
Variable: roles
Optional Filters:
//Fill in the roles you want to filter (rolesToFilter) like this:
//array('Role1', 'Role2');
$rolesToFilter=array();
$output=array();
if(empty($rolesToFilter))
return $output;
$src = $row['memberOf'];
if(!is_array($src)) {
$src = array($src);
}
foreach($src as $group) {
$list = explode(',', str_replace(array('[', ']', 'CN=', 'DC=', '"'), '', $group));
foreach($list as $elem) {
if(in_array($elem, $rolesToFilter)) {
$output[]=$elem;
}
}
}
return $output;
The field “roles” relates to a list of roles with which the user user should be assigned. Via the “memberOf” user field, you can define the roles within pascom. With this code, the connector can read the membership assignments and assign them to the user roles pascom field.
In the PHP-Variable rolesToFilter
, enter the field code and role name for which the connector should search for. All other member assignments will be ignored.
Example: array('Role1', 'Role2');
To do this, expand the following lines so:
{{#if rollen}}
,"user_roles": [
{{#each rollen}}
"{{this}}",
{{/each}}
"All Users"
],
{{/if}}
to the structure as follows:
{
"identity": [{
"003use_bez": "{{{displayname}}}",
"003use_name": "{{{username}}}",
"003use_auth_method": "EXTERN",
"011acc_pin": "{{{pin}}}",
"009ext_extension": "{{{phone}}}",
"016voi_email": "{{{email}}}",
{{#if rollen}}
,"user_roles": [
{{#each rollen}}
"{{this}}",
{{/each}}
"default"
],
{{/if}}
"post": {
"phonebook": [{
"028pho_bez": "{{{displayname}}}",
"028pho_firstname": "{{{givenname}}}",
"028pho_lastname": "{{{surname}}}",
"028pho_email": "{{{email}}}"
}]
}
}]
}
The role “default” relates to the system role “All” which is assigned to all users.
Import Labels
pascom labels can be used to display additional information within the pascom telephone book.
In this example, we want to save the contact’s customer number to the label Customernumber. This label is then visible in the telephone book, within the call logs and various other caller information points.
Add Label
To add labels, navigate to > and click .
Select the option , enter Customer Number as the label name and then click .
Apply all outstanding jobs in order to complete the Label addition process.
Modify a Connector Profile
Go to the tab and via the button, paste the following line:
Variable | Source |
---|---|
customernumber | return $row['customerNumber']; |
Through this modification, the Connector will save the content of the source variable “customerNumber” in the Variable “customernumber”.
This variable must now be assigned to the label Customernumber pascom field via the tab.
To do this simply add the following line:
"post": {
"phonebook.phonebooklabel": [
{
"050lab_bez": "Customernumber",
"028050pholab_value": "{{{customernumber}}}"
}
]
}
to the structure:
{
"phonebook": [{
"028pho_bez" : "{{{displayname}}}",
"028pho_phone" : "{{{phone}}}",
"028pho_firstname" : "{{{givenname}}}",
"028pho_lastname" : "{{{surname}}}",
"028pho_organisation" : "{{{organisation}}}",
"028pho_email" : "{{{email}}}",
"028pho_mobile" : "{{{mobile}}}",
"028pho_homephone" : "{{{homephone}}}",
"028pho_fax" : "{{{fax}}}",
"post": {
"phonebook.phonebooklabel": [
{
"050lab_bez": "Customernumber",
"028050pholab_value": "{{{customernumber}}}"
}
]
}
}]
}
This will assign all contacts with an entered customer number value with the Call Label Customer Number and corresponding value.
Check Results
Label assignments will NOT be displayed when using the “Save and Simulate” tool.
To check whether the label assignment has been successful, go to the pascom PBX Web-UI menu options > . Select and an appropriate user and check whether the assignment was successful under the tab. Alternatively, you can check your results by accessing the Company Phonebook via the pascom Desktop Client.
Add softphone to user
In order to be able to assign a softphone to a user directly during import, the structure must be extended to include terminal assignment. Some connectors already bring an implemented solution, which can be used directly in the basic settings.
To do this, add the following line in the tab by :
Variable: createSoftphone
- Important: The value of the variable createSoftphone must correspond to the value “yes” in the source variable.
To do this, add the lines:
{{#if createSoftphone}}
,"ipdevice.mdsoftphone": [{
"010dev_bez": "{{username}}_softphone"
}]
to the structure:
{
"identity": [{
"003use_bez": "{{{displayname}}}",
"003use_name": "{{{username}}}",
"003use_auth_method": "EXTERN",
"011acc_pin": "{{{pin}}}",
"009ext_extension": "{{{phone}}}",
"016voi_email": "{{{email}}}",
{{#if rollen}}
,"user_roles": [
{{#each rollen}}
"{{this}}",
{{/each}}
"default"
],
{{/if}}
"post": {
"phonebook": [{
"028pho_bez": "{{{displayname}}}",
"028pho_firstname": "{{{givenname}}}",
"028pho_lastname": "{{{surname}}}",
"028pho_email": "{{{email}}}"
}]
}
}]
{{#if createSoftphone}}
,"ipdevice.mdsoftphone": [{
"010dev_bez": "{{username}}_softphone"
}]
}
This will assign a softphone to each user with entered value “yes” in createSoftphone variable.
Assign action templates during user import
To be able to assign an action template to users directly during import, the Identity structure must be extended. This function is currently only limited to the call type - after of the action template. This applies to both external and internal telephony.
To do this, add the following line to the tab by :
Variable: action_post_ext or action_post_int.
- Important: The value of the variable action_post_ext or action_post_int must match the action template name in the source variable. (e.g. Own Voicemailbox).
To do this, add the lines:
"action_post_ext": "{{{action_post_ext}}}",
"action_post_int": "{{{action_post_int}}}",
to the structure:
{
"identity": [{
"003use_bez": "{{{displayname}}}",
"003use_name": "{{{username}}}",
"003use_auth_method": "EXTERN",
"011acc_pin": "{{{pin}}}",
"009ext_extension": "{{{phone}}}",
"016voi_email": "{{{email}}}",
"action_post_ext": "{{{action_post_ext}}}",
"action_post_int": "{{{action_post_int}}}",
}]
}
This assigns the appropriate action template to each user during import.
Fix syntax error, JSON is invalid
It can happen that during import certain characters like ", :, , cause a syntax error, which makes the JSON file invalid. In the following example we want to import a value in quotes (Foo):
{
"phonebook": [{
"028pho_bez" : "Blaa "Foo" baar test",
"028pho_phone" : "",
"028pho_firstname" : "Blaa "Foo" baar",
"028pho_lastname" : "test",
"028pho_organisation" : "",
"028pho_email" : "",
"028pho_mobile" : "",
"028pho_homephone" : "",
"028pho_fax" : "",
"011acc_id": ""
}]
}
Solution:
For the variable, remove 1 of the 3 accolades (curly brackets) so that the connector no longer observes the error-causing characters. This should fix the syntax error.
{{displayname}} instead of {{{displayname}}}
"post": {
"phonebook": [{
"028pho_bez": "{{displayname}}",
"028pho_firstname": "{{{givenname}}}",
"028pho_lastname": "{{{surname}}}",
"028pho_email": "{{{email}}}"
}]
}
}]