Project

General

Profile

Provisioning guide » History » Version 41

Tijmen de Mes, 08/26/2013 10:02 AM

1 1 Tijmen de Mes
h1. Provisioning guide
2
3 2 Tijmen de Mes
Provisioning of Multimedia Service Platform is performed by the NGNPro SOAP/XML provisioning server. To access the server you need a SOAP/XML client, either the web front-end that comes standard with the platform or one developed by the operator using the supplied SOAP/XML schema.
4 1 Tijmen de Mes
5 36 Tijmen de Mes
bq. The examples and screenshots presented in this document have been taken using AG Projects developed NGNPro client part of CDRTool application and may differ from the actual deployment of each customer. Access to the hosted version of Multimedia Service Platform also exposes less functionality, some functions are only available to administrator account and not available to resellers.
6 1 Tijmen de Mes
7
8
9
It is the responsibility of the operator to build a web interface that talks to the SOAP/XML interface. The sample code provided with CDRTool application is merely an example for how to access the API and should not be used in production by customers.
10
11
h2. NGNPro Server
12
13
NGNPro server software provides a SOAP/XML provisioning interface that allows for the management of accounts along with all their auxiliary settings.
14
15
Using NGNPro SOAP/XML interface the Operator may build new front-ends or adapt the existing CRM, provisioning or support systems to the Multimedia Service Platform, making the integration easy and effective. SOAP/XML is an industry standard for which there are implementations available in almost any programming language (like C, Java, PHP and Python) and it can be used by web developers to create customized web portals for the Operator or its resellers without bothering with the complexity of the platform setup and the database schemas sitting behind.
16
17
The SOAP/XML provisioning API is described at:
18
19
"https://mdns.sipthor.net/ngnpro/wsdl":https://mdns.sipthor.net/ngnpro/wsdl
20
21
h3. SOAP/XML API
22
23
# SIP domain management (adding, removing and querying domains)
24
# SIP account management (adding, updating, deleting and getting a SIP account)
25
# SIP aliases (adding, deleting and getting SIP aliases for a given SIP account)
26
# Group membership management (granting, revoking or listing group membership)
27
# Voicemail account (adding, updating, removing or getting a voicemail account)
28
# Call diversions (setting or getting the diversions for a given user)
29
# Retrieving call information for a certain user (missed, placed, received calls)
30
# Retrieving the registered phones one user has (getting the user locations info)
31
# ENUM management (adding, removing and getting the ENUM mappings)
32
# LCR management (adding, removing and getting the PSTN routes and gateways)
33
34 25 Tijmen de Mes
!NGNPro-Datatree.png!
35 1 Tijmen de Mes
36 37 Tijmen de Mes
h2. Encrypted passwords
37
38 38 Tijmen de Mes
The platform can be configured for using encrypted or non encrypted passwords for sip accounts. The web passwords are separate and are currently stored as 'plain' text in the database. The web password allows you to login with a sip account to the settings for that sip account.
39 37 Tijmen de Mes
40 38 Tijmen de Mes
If the platform is using encrypted passwords you will be not able to retrieve the password as 'plain' text. This results in that passwords will not be shown in the email you get when sending account info to to configured email address. Only the web password will show, which allows you to login and change the sip account password.
41 37 Tijmen de Mes
42 40 Tijmen de Mes
The time you'll know the password before it is encrypted, is when provisioning the accounts (add). At this point in time you should send the email/letter to the customers telling them the info they need. From CDRTool they will get an email without password if the send email to email is used from the Identity tab.
43
44
Another consequence is that the web interface will never show the password. It can only be changed.
45 39 Tijmen de Mes
46 1 Tijmen de Mes
h2. NGNPro Clients
47
48
Multimedia Service Platform comes with a fully featured provisioning client, which is part of CDRTool web application. The Operator may also chose to develop his own web portals to interface with Multimedia Service Platform by using the provided SOAP/XML schema.
49
50
h3. Python Client
51
52 34 Tijmen de Mes
To help the development of a custom client an attachment:wsdl.tar.gz
53 1 Tijmen de Mes
54
Usage is simple and described in the WSDL.Proxy class docstring. In addition to what is mentioned there, you need to also specify the auth argument, which is a dictionary like:
55
56 35 Tijmen de Mes
  dict(username='myusername', password='mypassword')
57 1 Tijmen de Mes
58
59
The Proxy, will load the WSDL and add the methods from the specified port in the WSDL on the fly to the proxy instance that is created when you instantiate Proxy(). After the creation you can call the port methods directly on the proxy, so no code generation is needed. You can discover the available methods using inspection on the proxy instance as with any other python object. You pass simple data structures (strings, ints, lists, dicts), that are automatically converted to the appropriate SOAP types.
60
61
Inside the archive you'll also find a short example of how to use it in ngnpro_test.py
62
63
h3. PHP Client
64
65
To use this example code you must install SOAP library for PEAR project.
66
67
Generate the library with:
68
69 4 Tijmen de Mes
<pre><code class="php">
70
#!/usr/bin/php
71 1 Tijmen de Mes
<?
72
require_once('SOAP/WSDL.php');
73
$wsdl       = new SOAP_WSDL('https://mdns.sipthor.net/ngnpro/wsdl');
74
print "<?\n";
75
print $wsdl->generateAllProxies();
76
print "?>\n";
77 6 Tijmen de Mes
?></code>
78 4 Tijmen de Mes
</pre>
79 1 Tijmen de Mes
80 5 Tijmen de Mes
You will end up with a file containing all client functions, attached is an example of the generated file for NGNPro version 4.3.5 attachment:ngnpro_soap_lib.php
81 1 Tijmen de Mes
82 5 Tijmen de Mes
The script attachment:sip_add_account.php
83 1 Tijmen de Mes
84
h3. Server Location
85
86
NGNPro is reachable on the following URLs, which were configured during the setup phase of the platform:
87
88
89
|Platform|Protocol|Port|Location|SOAP ports|
90
|Collocated Multimedia Service Platform|TLS|443|"https://cdr.example.com/ngnpro":https://cdr.example.com/ngnpro|all ports except Voicemail port|
91
|Collocated Multimedia Service Platform|TLS|443|"https://cdr.example.com/ngnpro/voicemail":https://cdr.example.com/ngnpro/voicemail|Voicemail port|
92
|Collocated Multimedia Service Platform|TCP|9200|"http://sip.example.com:9200":http://sip.example.com:9200|all ports except Voicemail port|
93
|Collocated Multimedia Service Platform|TCP|9200|"http://vm.example.com:9200":http://vm.example.com:9200|Voicemail port|
94
|Collocated SIP Thor Platform|TLS|9200|"https://ngnpro.example.com:9200":https://ngnpro.example.com:9200|All ports|
95
96
97
h3. Test Server
98
99
You can test your provisioning client against the live platform hosted by AG Projects.
100
101
102
|Platform|Protocol|Port|Location|SOAP ports|
103
|Hosted AG Projects platform|TLS|443|"https://mdns.sipthor.net/ngnpro":https://mdns.sipthor.net/ngnpro|All ports|
104
105
106
The credentials for accessing the test server are the same as the login account used for accessing AG Projects support web page.
107
108
h3. SOAP/XML Authentication
109
110
SOAP/XML requests must contain valid authentication header with credentials in the form of a combination of username, password and impersonate attributes. There are two types of SOAP credentials to access the server:
111
112
* Administrator level. The server has an administrator account configured in the server configuration file, /etc/ngnpro/config.ini, that can be used to perform all functions without restrictions. Set the *impersonate* attribute of the SOAP authentication header to a valid customer of the system to perform actions in behalf of that customer.
113
* Customer level. Access a partition of the data provisioned into the platform. The customers table, managed using the SOAP/XML CustomerPort, is used as a login database for authenticating and authorizing the SOAP/XML requests. First use the administrator level account to add a customer. When the combination of username/password in the SOAP authentication header matches an entry in the customers table, all actions will be performed in behalf of that customer. This means that any record created will inherit the customer id of the customer and any modification will be checked for ownership before being committed. This allows reseller to have limited access to the platform based on rights assigned to them by the system administrator.
114
115
For more information about the *Customer* concept read below.
116
117
h2. Customer
118
119
Customers are entities created in the platform to store names, address, billing and other information. Customers can also have arbitrary attribute/value pairs stored in the properties attribute.
120
121
Each customer is assigned, during creation by the server, a unique id and a reseller id.
122
123
h3. Record Assignment
124
125
The customer id can be used for assignment of SIP domains, ENUM ranges and DNS zones. The assignment is done by setting the customer id attributes of the record in question.
126
127
All SIP accounts inherit the customer id from their parent SIP domain. For example a SIP domain that has customer and reseller attributes set cause all SIP accounts created under this domain to share the same customer and reseller too (because the SIP account always belong to a SIP domain). Same concept works for the ENUM numbers (they belong to ENUM ranges) and DNS records (they belong to DNS zones).
128
129
Before deleting a customer, make sure that no records belong to his id.
130
131
h2. Reseller
132
133
The reseller has the role of grouping multiple customers together. The concept is similar to how the users in a Unix system work, where each user has a unique id and a group id. As opposed to the Unix model, a customer can belong to a single reseller. Customers having their id equal to the reseller&#95;id are referred as resellers. Also customers that have the impersonate attribute set to the reseller id have the same right as their reseller.
134
135
If a reseller is not specified during the creation of a new customer entry, a new reseller id equal to the customer id will be assigned, in fact creating a new Reseller in the system. Only provisioning requests made with admin rights can add a reseller into the system.
136
137
h3. Conventions for resellers
138
139
A customer that is a reseller (the customer id is equal to reseller id) is allowed to create other customers and records in the platform if the *resellerActive* attribute of the customer is set to true.
140
141
The number of records each reseller is allowed to provision into the platform is controlled by some special properties belonging to the reseller. These special properties are: sip&#95;credit, sip&#95;alias&#95;credit, enum&#95;range&#95;credit, enum&#95;number&#95;credit, dns&#95;zone&#95;credit, email&#95;credit
142
143
The same credit convention is valid for customers belonging to a reseller. Each customer may create records within their own credit. The total of all records created by all customers may not exceed the credit of the reseller. The server checks during creation of each record if the quota has not been exceeded.
144
145
The following properties controls if the reseller or customer has access to enable access to PSTN for the SIP accounts:
146
147
* pstn&#95;access (can create SIP accounts with PSTN prepaid access)
148
* prepaid&#95;changes (can toggle a SIP account from prepaid to postpaid and vice versa)
149
150
On CDRTool, to create an account that has access to the records belonging to a specific customer set the Impersonate field of the CDRTool login account to *customer&#95;id.reseller&#95;id*.
151
152
h3. Conventions for the properties
153
154
As mentioned before, each customer can have a list of attributed/value pairs attached to them in the properties attribute, this allowing for storage of arbitrary data with each customer. Each attribute has a field called permission. The following rules apply:
155
156
* Properties having permission set to admin can be modified only by the administrator
157
* Properties having permission set to reseller can be modified by the administrator and their reseller
158
* Properties having other permission can be modified by their customer, their reseller or by the administrator
159
160
If the SIP domain of a SIP account belongs to a customer (the customer&#95;id != 0), the pstn&#95;access and prepaid&#95;access properties can be enabled only if the corespondent reseller has these properties set to 1.
161
162
h2. Owner
163
164
At SIP account, SIP alias and ENUM number level another attribute called owner exists. Owner attribute can be used to assign or group individual records like SIP accounts and ENUM numbers to customers in the customer table. For example one customer can have multiple SIP accounts and ENUM numbers if their owner field are set to his customer id.
165
166
h3. SOAP/XML functions
167
168
* CustomerPort-&gt;addAccount()
169
* CustomerPort-&gt;updateAccount()
170
* CustomerPort-&gt;deleteAccount()
171
* CustomerPort-&gt;getAccount()
172
* CustomerPort-&gt;getCustomers()
173
* CustomerPort-&gt;getResellers()
174
* CustomerPort-&gt;setProperties()
175
* CustomerPort-&gt;getProperties()
176
177
Customer attributes:
178 8 Tijmen de Mes
<pre>
179 7 Tijmen de Mes
  <complexType name="CustomerAccount">
180
181
  <sequence>
182
  <element name="id" nillable="true" type="xsd:integer"/>
183
  <element name="reseller" nillable="true" type="xsd:integer"/>
184
  <element name="impersonate" nillable="true" type="xsd:integer"/>
185
  <element name="username" nillable="true" type="xsd:string"/>
186
  <element name="password" nillable="true" type="xsd:string"/>
187
  <element name="firstName" nillable="true" type="xsd:string"/>
188
  <element name="lastName" nillable="true" type="xsd:string"/>
189
  <element name="organization" nillable="true" type="xsd:string"/>
190
  <element name="vatNumber" nillable="true" type="xsd:string"/>
191
  <element name="email" nillable="true" type="xsd:string"/>
192
  <element name="web" nillable="true" type="xsd:string"/>
193
  <element name="tel" nillable="true" type="xsd:string"/>
194
  <element name="fax" nillable="true" type="xsd:string"/>
195
  <element name="mobile" nillable="true" type="xsd:string"/>
196
  <element name="sip" nillable="true" type="xsd:string"/>
197
  <element name="enum" nillable="true" type="xsd:string"/>
198
  <element name="address" nillable="true" type="xsd:string"/>
199
  <element name="postcode" nillable="true" type="xsd:string"/>
200
  <element name="city" nillable="true" type="xsd:string"/>
201
  <element name="state" nillable="true" type="xsd:string"/>
202
  <element name="country" nillable="true" type="xsd:string"/>
203
  <element name="timezone" nillable="true" type="xsd:string"/>
204
  <element name="language" nillable="true" type="xsd:string"/>
205
  <element name="bankAccount" nillable="true" type="xsd:string"/>
206
  <element name="billingAddress" nillable="true" type="xsd:string"/>
207
  <element name="billingEmail" nillable="true" type="xsd:string"/>
208
  <element name="balance" nillable="true" type="xsd:double"/>
209
  <element name="credit" nillable="true" type="xsd:double"/>
210
  <element name="companyCode" nillable="true" type="xsd:string"/>
211
  <element name="resellerActive" nillable="true" type="xsd:boolean"/>
212
  <element name="changeDate" nillable="true" type="xsd:string"/>
213
  <element name="properties" nillable="true" type="ngnpro:CustomerPropertyArray"/>
214
  </sequence>
215 1 Tijmen de Mes
  </complexType>
216 8 Tijmen de Mes
</pre>
217 1 Tijmen de Mes
218
h3. Graphical client
219
220
@CDRTool->Accounts->Customers@
221
222 25 Tijmen de Mes
!ngnpro-customers.png!
223 1 Tijmen de Mes
224
Click on the customer id to edit its properties.
225
226
h2. DNS Zones
227
228
The SIP Proxy is configured to serve domains that must be reachable over the Internet. The SIP devices must support RFC3263 (Locating SIP Services), namely support for DNS SRV lookups for SIP services. Each SIP domain configured in the SIP Proxy must have DNS zone configured on a DNS server responsable for that domain. When using the platform built-in DNS servers and DNS management you must create the proper DNS zones and records for each SIP domain.
229
230
To enable the use of an Internet domain for SIP you must provision in the DNS zone the following records:
231
232 9 Tijmen de Mes
  example.com.  300 IN  NAPTR   20 0 "s" "SIP+D2U" "" _sip._udp.example.com.
233
  _sip._udp.example.com. 300  IN  SRV 0 0 5060 sip.example.com.
234 1 Tijmen de Mes
235
236
Replace example.com with your own domain and add an A record pointing sip.example.com. to the IP address of the SIP Proxy.
237
238
h3. SOAP/XML functions
239
240
* DnsPort-&gt;addZone()
241
* DnsPort-&gt;updateZone()
242
* DnsPort-&gt;deleteZone()
243
* DnsPort-&gt;getZone()
244
* DnsPort-&gt;getZones()
245
* DnsPort-&gt;addRecord()
246
* DnsPort-&gt;addFancyRecord()
247
* DnsPort-&gt;updateRecord()
248
* DnsPort-&gt;updateFancyRecord()
249
* DnsPort-&gt;deleteRecord()
250
* DnsPort-&gt;deleteFancyRecord()
251
* DnsPort-&gt;getRecord()
252
* DnsPort-&gt;getFancyRecord()
253
* DnsPort-&gt;getRecords()
254
* DnsPort-&gt;getFancyRecords()
255
256
DNZ zone attributes:
257
258 10 Tijmen de Mes
<pre>
259
<complexType name="DnsZone">
260 1 Tijmen de Mes
261
<sequence>
262
<element name="name" nillable="false" type="xsd:string"/>
263
<element name="ttl" nillable="true" type="xsd:nonNegativeInteger"/>
264
<element name="nameservers" nillable="true" type="ngnpro:StringArray"/>
265
<element name="email" nillable="true" type="xsd:string"/>
266
<element name="serial" nillable="true" type="xsd:int"/>
267
<element name="refresh" nillable="true" type="xsd:int"/>
268
<element name="retry" nillable="true" type="xsd:int"/>
269
<element name="expire" nillable="true" type="xsd:int"/>
270
<element name="minimum" nillable="true" type="xsd:int"/>
271
<element name="customer" nillable="true" type="xsd:integer"/>
272
<element name="reseller" nillable="true" type="xsd:integer"/>
273
<element name="changeDate" nillable="true" type="xsd:string"/>
274
<element name="info" nillable="true" type="xsd:string"/>
275
</sequence>
276
</complexType>
277 10 Tijmen de Mes
</pre>
278 1 Tijmen de Mes
279
When using AG Projects hosted platform you must select and use for DNS delegation the following name servers:
280
281
# ns1.dns-hosting.info
282
# ns2.dns-hosting.info
283
284
h3. Graphical client
285
286
@CDRTool->Accounts->DNS zones@
287
288 27 Tijmen de Mes
!ngnpro-dns-zones.png!
289 1 Tijmen de Mes
290
Click on each zone to edit its properties.
291
292 27 Tijmen de Mes
!ngnpro-dns-zone.png!
293 1 Tijmen de Mes
294
h2. DNS Records
295
296
Each DNS zones has one or more records. For every SIP domain served by the platform you must create the following DNS records:
297
298
Example for:
299
300
* SIP domain: sipdomain.com
301
* SIP Proxy hostname configured for the platform: sip.example.com
302
303 33 Tijmen de Mes
<pre>
304 1 Tijmen de Mes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
305
; DNS records specified by RFC 3263 (Locating SIP services) ;
306
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
307
308
; SIP communications using UDP transport
309 33 Tijmen de Mes
sipdomain.com.             IN NAPTR  10 0 "S" "SIP+d2u" "" _sip._udp.sipdomain.com.
310 1 Tijmen de Mes
_sip._udp.sipdomain.com.   IN SRV    0  0 5060 sip.example.com.
311 33 Tijmen de Mes
312 1 Tijmen de Mes
</pre>
313
314
h3. SOAP/XML functions
315
316
* DnsPort-&gt;addRecord()
317
* DnsPort-&gt;updateRecord()
318
* DnsPort-&gt;deleteRecord()
319
* DnsPort-&gt;getRecord()
320
* DnsPort-&gt;getRecords()
321
322
DNS record attributes:
323
324 27 Tijmen de Mes
<pre>
325 11 Tijmen de Mes
<complexType name="DnsRecord">
326 1 Tijmen de Mes
327
<sequence>
328
<element name="id" nillable="true" type="xsd:integer"/>
329
<element name="zone" nillable="true" type="xsd:string"/>
330
<element name="name" nillable="true" type="xsd:string"/>
331
<element name="type" nillable="true" type="ngnpro:DnsRecordType"/>
332
<element name="ttl" nillable="true" type="xsd:unsignedInt"/>
333
<element name="value" nillable="true" type="xsd:string"/>
334
<element name="priority" nillable="true" type="xsd:unsignedShort"/>
335
<element name="owner" nillable="true" type="xsd:integer"/>
336
<element name="customer" nillable="true" type="xsd:integer"/>
337
<element name="reseller" nillable="true" type="xsd:integer"/>
338
<element name="changeDate" nillable="true" type="xsd:string"/>
339
</sequence>
340
</complexType>
341 11 Tijmen de Mes
</pre>
342 1 Tijmen de Mes
343
DNS record types:
344
345 11 Tijmen de Mes
<pre>
346
<simpleType name="DnsRecordType">
347 1 Tijmen de Mes
348
<xsd:restriction base="xsd:string">
349
<xsd:enumeration value="A"/>
350
<xsd:enumeration value="AAAA"/>
351
<xsd:enumeration value="CNAME"/>
352
<xsd:enumeration value="MX"/>
353
<xsd:enumeration value="NAPTR"/>
354
<xsd:enumeration value="NS"/>
355
<xsd:enumeration value="SRV"/>
356
<xsd:enumeration value="TXT"/>
357
<xsd:enumeration value="PTR"/>
358
<xsd:enumeration value="LOC"/>
359
</xsd:restriction>
360
</simpleType>
361 11 Tijmen de Mes
</pre>
362 1 Tijmen de Mes
363
h3. Graphical client
364
365
@CDRTool->Accounts->DNS records@
366
367 27 Tijmen de Mes
!ngnpro-dns-records.png!
368 1 Tijmen de Mes
369
Click on each record to edit its attributes.
370
371 27 Tijmen de Mes
!ngnpro-dns-record.png!
372 1 Tijmen de Mes
373
h2. SIP Domains
374
375
Before creating SIP accounts you need to create at least one SIP domain. (e.g. example.com)
376
377
h3. SOAP/XML functions
378
379
* SipPort-&gt;addDomain()
380
* SipPort-&gt;updateDomain()
381
* SipPort-&gt;deleteDomain()
382
* SipPort-&gt;getDomains()
383
384
h3. Graphical client
385
386
@CDRTool->Accounts->SIP domains@
387
388 27 Tijmen de Mes
!ngnpro-sip-domains.png!
389 1 Tijmen de Mes
390
h2. SIP Accounts
391
392
The provisioning of SIP account is performed using the SOAP/XML functions present in the Sip port described in NGNPro WSDL.
393
394
You must add at least one SIP domain before adding a SIP account.
395
396
SIP account passwords can be stored in clear text or encrypted formats depending on how you supply the password. NGNPro needs two MD5 checksums (hexdigests) computed based on the (id.username, id.domain, password) tuple. A hexdigest must be a string of length 32, containing only hexadecimal digits. These hexdigests can be computed by the client and given to NGNPro instead of a clear text password, as follows: the password field must be in "digest1:digest2" form, where digest1=MD5("username:domain:password") and digest2=MD5("username&#64;domain:domain:password"). Otherwise, if the password is given in clear text, NGNPro computes these two digests and stores them. If the store&#95;clear&#95;text&#95;passwords configuration option is set to Yes (the default value), the clear text password will be also be stored. If store&#95;clear&#95;text&#95;passwords is set to No, the password will not be stored and it will not be available in the future.
397
398
To enable different rights for SIP accounts, they must be part of specific groups.
399
400
You can add or remove a SIP account from a group by using Sip.addToGroup() and Sip.removeFromGroup() SOAP methods. The list of groups to which a SIP account belongs can also be set using the `groups' attribute of the SipAccount structure in Sip.addAccount() and Sip.updateAccount() methods. When you're using a group list for modification, all the old groups will be deleted and the new ones will be inserted in place.
401
402
To enable PSTN calls to a SIP account, that account must be in the 'free-pstn' group.
403
404
If you want to limit the access to PSTN, in the margins of a predefined quota (expressed in the currency used by CDRTool rating engine), the SIP account must have a positive value set for the 'quota' attribute in the SipAccount structure. In this case, the CDRTool quota system blocks the user if the traffic exceedes the predefined quota by adding the user to the 'quota' group. In this case the SIP account can still place free calls.
405
406
A SIP account can be administratively blocked (it cannot make any calls and it cannot register thus not receiving calls), if it's part of the 'blocked' group.
407
408
If you want a SIP account to make calls marked as anonymous, that SIP account must be placed in the 'anonymous' group.
409
410
To mark a SIP account as prepaid, the 'prepaid' attribute of the SipAccount structure must be set to True.
411
412
SipAccount.properties attribute can be used to store per-account information in the form of name-value pairs and they can then be used on the client side for its own purposes. Properties do not influence routing decisions. Their meaning depends on the interpretation the client side gives them, for example they can be used from a web-based interface to store settings like the display language or the account type.
413
414
Diversion rules routing order:
415
416
# Unavailable,
417
# Unconditional
418
# Not-online
419
# Busy
420
# No-answer
421
422
Not-online means there is no registered device for that account, Unavailable means that the subscriber has accept rules in place that forbid the caller at the current time, accept rules can be temporary (valid a a number of minutes after which they'll be discarded) or scheduled (permanent rules based on time of day and day of week).
423
424
The last 2 rules are not handled together with the other 3, they are only handled if the call fails.
425
426
h3. SOAP/XML functions
427
428
* SipPort-&gt;addAccount()
429
* SipPort-&gt;updateAccount()
430
* SipPort-&gt;deleteAccount()
431
* SipPort-&gt;getAccount()
432
* SipPort-&gt;getAccounts()
433
* SipPort-&gt;addToGroup()
434
* SipPort-&gt;removeFromGroup()
435
* SipPort-&gt;getGroups()
436
* SipPort-&gt;addPhonebookEntry()
437
* SipPort-&gt;updatePhonebookEntry()
438
* SipPort-&gt;deletePhonebookEntry()
439
* SipPort-&gt;getPhonebookEntries()
440
* SipPort-&gt;setRejectMembers()
441
* SipPort-&gt;getRejectMembers()
442
* SipPort-&gt;setAcceptRules()
443
* SipPort-&gt;getAcceptRules()
444
* SipPort-&gt;setBarringPrefixes()
445
* SipPort-&gt;getBarringPrefixes()
446
* SipPort-&gt;setCallDiversions()
447
* SipPort-&gt;getCallDiversions()
448
* SipPort-&gt;getCalls()
449
* SipPort-&gt;getCallStatistics()
450
* SipPort-&gt;getSipDeviceLocations()
451
452
SIP account attributes:
453
454 12 Tijmen de Mes
<pre>
455
<complexType name="SipAccount">
456 1 Tijmen de Mes
457
<sequence>
458
<element name="id" nillable="false" type="ngnpro:SipId"/>
459
<element name="password" nillable="true" type="xsd:string"/>
460
<element name="firstName" nillable="true" type="xsd:string"/>
461
<element name="lastName" nillable="true" type="xsd:string"/>
462
<element name="email" nillable="true" type="xsd:string"/>
463
<element name="acl" nillable="true" type="ngnpro:SubscriberACLArray"/>
464
<element name="groups" nillable="true" type="ngnpro:StringArray"/>
465
<element name="properties" nillable="true" type="ngnpro:PropertyArray"/>
466
<element name="timezone" nillable="true" type="xsd:string"/>
467
<element name="rpid" nillable="true" type="xsd:string"/>
468
<element name="quota" nillable="true" type="xsd:int"/>
469
<element name="quickdialPrefix" nillable="true" type="xsd:string"/>
470
<element name="callLimit" nillable="true" type="xsd:int"/>
471
<element name="prepaid" nillable="true" type="xsd:boolean"/>
472
<element name="region" nillable="true" type="xsd:string"/>
473
<element name="timeout" nillable="true" type="xsd:nonNegativeInteger"/>
474
<element name="owner" nillable="true" type="xsd:integer"/>
475
<element name="customer" nillable="true" type="xsd:integer"/>
476
<element name="reseller" nillable="true" type="xsd:integer"/>
477
<element name="changeDate" nillable="true" type="xsd:string"/>
478
<element name="createDate" nillable="true" type="xsd:string"/>
479
</sequence>
480
</complexType>
481 12 Tijmen de Mes
</pre>
482 1 Tijmen de Mes
483
Meaning of SIP account attributes:
484
485
* rpid: caller id presented to the callee when calling to PSTN destinations
486
* prepaid: if true, subscriber may call within the limit of its prepaid balance, when balance is zero all calls in progress are cut
487
* properties: list with attribute/value pairs, used to store arbitrary data per subscriber
488
* quota: if set to a possitive integer, the subscriber may call to the PSTN up to this limit, calls in progress continue, the usage is reset each calendar month
489
* region: label that matches a region when calling an emergency number, the call is routed to the emergency point defined for that region
490
* callLimit: maximum amount of concurrent PSTN calls allowed
491
* acl: a list of allowed IP networks
492
493
* groups: group membership for SIP accounts. Available groups and their meaning:
494
495
* free-pstn: subscriber may call to PSTN destinations
496
* blocked: only calls to emergency numbers defind in the SIP Proxy are allowed
497
* anonymous: hide caller id when calling to the PSTN (using Privacy headers)
498
* anonymous-reject: reject calls from "anonymous&#64;anonymous.invalid":mailto:anonymous@anonymous.invalid
499
* quota: subscriber has been blocked because monthy quota has been exceeded, calls to PSTN destinations are denied
500
* missed-calls: subscriber will be notifie by email about his sessions in the last 24 hours
501
502
Reserved groups for internal use (do not change them):
503
504
* prepaid, intercept
505
506
On updateAccount() operation all attributes must be supplied otherwise any missing attribute will be deleted. First perform a getAccount() operation, update the attributes that need to be changed and finally perform an updateAccount() with the modified object.
507
508
h3. Graphical client
509
510
@CDRTool->Accounts->SIP accounts@
511
512 28 Tijmen de Mes
!ngnpro-sip-accounts.png!
513 1 Tijmen de Mes
514
h3. Control panel
515
516 3 Tijmen de Mes
!http://wiki.sip2sip.info/attachments/3809/sip2sip-cp-menu.png(http://wiki.sip2sip.info/attachments/3809/sip2sip-cp-menu.png)!
517 1 Tijmen de Mes
518
The above menu gives you access to various settings and information related to your SIP account.
519
520
h3. Voicemail
521
522
This panel can set the way the voicemail messages are delivered.
523
524 3 Tijmen de Mes
!http://wiki.sip2sip.info/attachments/3813/sip2sip-cp-voicemail.png(http://wiki.sip2sip.info/attachments/3813/sip2sip-cp-voicemail.png)!
525 1 Tijmen de Mes
526
h3. Online devices
527
528
This panel displays the list of registered SIP devices.
529
530 29 Tijmen de Mes
!sip2sip-cp-devices.png!
531 1 Tijmen de Mes
532
h3. Accept calls
533
534
This panel control when and from whom calls are accepted.
535
536 3 Tijmen de Mes
!http://wiki.sip2sip.info/attachments/3801/sip2sip-cp-accept.png(http://wiki.sip2sip.info/attachments/3801/sip2sip-cp-accept.png)!
537 1 Tijmen de Mes
538
h3. Call diversions
539
540
This panel controls the call diversions.
541
542 3 Tijmen de Mes
!http://wiki.sip2sip.info/attachments/3807/sip2sip-cp-diversions.png(http://wiki.sip2sip.info/attachments/3807/sip2sip-cp-diversions.png)!
543 1 Tijmen de Mes
544
Call diversions data type:
545
546 13 Tijmen de Mes
<pre>
547
<complexType name="CallDiversions">
548 1 Tijmen de Mes
549 13 Tijmen de Mes
<sequence>
550 1 Tijmen de Mes
551 13 Tijmen de Mes
<!--
552 1 Tijmen de Mes
553
                        FUNC - forward unconditionally
554
                        FNOL - forward if not online
555
                        FUNV - forward if not available
556
                        FNOA - forward if no answer
557
                        FBUS - forward if busy
558
                        RUNC - redirect unconditionally
559
                        RNOL - redirect if not online
560
                        RUNV - redirect if not available
561
                        RNOA - redirect if no answer
562
                        RBUS - redirect if busy
563
            
564
            - Forward conditions cause the traffic to be routed and accounted through the SIP Proxy
565
            - Redirect conditions cause traffic to be made directly between the caller and end destination, 
566
              bypassing the SIP Proxy
567
            - Always used FXXX conditions when accounting is desired
568
            
569
                    
570 13 Tijmen de Mes
-->
571
<element name="FUNC" nillable="true" type="xsd:string"/>
572
<element name="FNOL" nillable="true" type="xsd:string"/>
573
<element name="FUNV" nillable="true" type="xsd:string"/>
574
<element name="FNOA" nillable="true" type="xsd:string"/>
575
<element name="FBUS" nillable="true" type="xsd:string"/>
576
<element name="RUNC" nillable="true" type="xsd:string"/>
577
<element name="RNOL" nillable="true" type="xsd:string"/>
578
<element name="RUNV" nillable="true" type="xsd:string"/>
579
<element name="RNOA" nillable="true" type="xsd:string"/>
580
<element name="RBUS" nillable="true" type="xsd:string"/>
581
</sequence>
582
</complexType>
583 1 Tijmen de Mes
</pre>
584
585
h3. Aliases
586
587
This panel displays the aliases associated with a SIP account.
588
589 3 Tijmen de Mes
!http://wiki.sip2sip.info/raw-attachment/wiki/SipSettings/sip2sip-cp-aliases.png(http://wiki.sip2sip.info/raw-attachment/wiki/SipSettings/sip2sip-cp-aliases.png)!
590 1 Tijmen de Mes
591
h2. SIP Aliases
592
593
Aliases can be used to provide custom SIP addresses that map to exiting SIP accounts.
594
595
h3. SOAP/XML functions
596
597
* SipPort-&gt;addAlias()
598
* SipPort-&gt;updateAlias()
599
* SipPort-&gt;deleteAlias()
600
* SipPort-&gt;getAlias()
601
* SipPort-&gt;getAliasesForAccount()
602
* SipPort-&gt;getAliases()
603
604
h3. Graphical client
605
606
@CDRTool->Accounts->SIP aliases@
607
608 32 Tijmen de Mes
!ngnpro-sip-aliases.png!
609 1 Tijmen de Mes
610
h2. Trusted Peers
611
612
Trusted peers are identified by their IP addresses and are allowed to transit the platform. Trusted peers are used to define SIP trunks to/from PBXs allowed to connect to the platform. For more information see "SIP trunking section":http://msp-documentation.ag-projects.com/wiki/PeeringGuide#SIPtrunking.
613
614
h3. SOAP/XML functions
615
616
* SipPort-&gt;addTrustedPeer()
617
* SipPort-&gt;deleteTrustedPeer()
618
* SipPort-&gt;getTrustedPeers()
619
620
Trusted peer attributes:
621
622 14 Tijmen de Mes
<pre>
623
<complexType name="TrustedPeer">
624 1 Tijmen de Mes
625
<sequence>
626
<element name="ip" nillable="false" type="xsd:string"/>
627
<element name="protocol" nillable="true" type="ngnpro:TrustedPeerProtocol" default="any"/>
628
<element name="fromPattern" nillable="true" type="xsd:string" default="^sip:.*$"/>
629
<element name="tag" nillable="true" type="xsd:string"/>
630
<element name="description" nillable="true" type="xsd:string" default=""/>
631
<element name="reseller" nillable="true" type="xsd:integer"/>
632
<element name="changeDate" nillable="true" type="xsd:string"/>
633
</sequence>
634
</complexType>
635 14 Tijmen de Mes
</pre>
636 1 Tijmen de Mes
637
h3. Graphical client
638
639
@CDRTool->Accounts->Trusted peers@
640
641 31 Tijmen de Mes
!ngnpro-trusted-peers.png!
642 1 Tijmen de Mes
643
h2. ENUM Ranges
644
645
ENUM is used in the routing logic of the SIP Proxy for sessions that use telephone numbers as identifiers. ENUM is a protocol that provides a translation mechanism for E.164 telephone numbers into IP addressing schemes.
646
647
An ENUM range is a telephone number prefix that has been allocated to your platform (by your telephone numbers supplier or telecom regulator in your country). For example you are an operator in Holland (contry code 31) and you have been allocated from the local authorities the numbers 31208005100 till 31208005199 (one hundred numbers). The prefix is therefore 312080051. First create an ENUM range using this prefix, then add individual numbers belonging to this range.
648
649
An ENUM range is similar with a DNS zones but it contains extra non DNS attributes like the type of numbers allowed to be stored.
650
651
h3. SOAP/XML functions
652
653
* EnumPort-&gt;addRange()
654
* EnumPort-&gt;updateRange()
655
* EnumPort-&gt;deleteRange()
656
* EnumPort-&gt;getRanges()
657
658
ENUM range attributes:
659
660 15 Tijmen de Mes
<pre>
661
<complexType name="EnumRange">
662 1 Tijmen de Mes
663
<sequence>
664
<element name="id" nillable="false" type="ngnpro:EnumRangeId"/>
665
<element name="ttl" nillable="true" type="xsd:nonNegativeInteger" default="3600"/>
666
<element name="minDigits" nillable="true" type="xsd:int"/>
667
<element name="maxDigits" nillable="true" type="xsd:int"/>
668
<element name="size" nillable="true" type="xsd:int"/>
669
<element name="nameservers" nillable="true" type="ngnpro:StringArray"/>
670
<element name="used" nillable="true" type="xsd:int"/>
671
<element name="serial" nillable="true" type="xsd:int"/>
672
<element name="customer" nillable="true" type="xsd:integer"/>
673
<element name="reseller" nillable="true" type="xsd:integer"/>
674
<element name="changeDate" nillable="true" type="xsd:string"/>
675
<element name="info" nillable="true" type="xsd:string"/>
676
</sequence>
677
</complexType>
678 15 Tijmen de Mes
</pre>
679 1 Tijmen de Mes
680
h3. Graphical client
681
682
@CDRTool->Accounts->ENUM ranges@
683
684 30 Tijmen de Mes
!ngnpro-enum-ranges.png!
685 1 Tijmen de Mes
686
Click on each range to modify its properties.
687
688 30 Tijmen de Mes
!ngnpro-enum-range.png!
689 1 Tijmen de Mes
690
h2. ENUM Numbers
691
692
ENUM is used in the routing logic of the SIP Proxy for sessions that use telephone numbers as identifiers. For each SIP account in the platform that must be reachable besides the SIP address also by one ore more telephone numbers, you must create the ENUM numbers and add mappings to their corresponding SIP account. Before creating any ENUM number, you must create an ENUM range.
693
694
The ENUM NAPTR record management has been developed based on the standards described at "http://www.ag-projects.com/content/view/61/96/":http://www.ag-projects.com/content/view/61/96/
695
696
Each ENUM number may have up to 5 NAPTR records as specified in ETSI TS 102 172 V1.2.1 (Minimum requirements for interoperability of ENUM implementations)
697
698
h3. SOAP/XML functions
699
700
* EnumPort-&gt;addNumber()
701
* EnumPort-&gt;updateNumber()
702
* EnumPort-&gt;deleteNumber()
703
* EnumPort-&gt;getNumber()
704
* EnumPort-&gt;getNumbers()
705
706
ENUM number attributes:
707
708 16 Tijmen de Mes
<pre>
709
<complexType name="EnumNumber">
710 1 Tijmen de Mes
711
<sequence>
712
<element name="id" nillable="false" type="ngnpro:EnumId"/>
713
<element name="mappings" nillable="true" type="ngnpro:EnumMappingArray"/>
714
<element name="info" nillable="true" type="xsd:string"/>
715
<element name="owner" nillable="true" type="xsd:integer"/>
716
<element name="customer" nillable="true" type="xsd:integer"/>
717
<element name="reseller" nillable="true" type="xsd:integer"/>
718
<element name="changeDate" nillable="true" type="xsd:string"/>
719
</sequence>
720
</complexType>
721 16 Tijmen de Mes
</pre>
722 1 Tijmen de Mes
723
724
ENUM mapping attributes:
725
726 16 Tijmen de Mes
<pre>
727
<complexType name="EnumMapping">
728 1 Tijmen de Mes
729
<sequence>
730
<element name="id" nillable="true" type="xsd:int"/>
731
<element name="type" nillable="true" type="xsd:string"/>
732
<element name="mapto" nillable="true" type="xsd:string"/>
733
<element name="priority" nillable="true" type="xsd:int"/>
734
<element name="ttl" nillable="true" type="xsd:int" default="3600"/>
735
</sequence>
736
</complexType>
737 16 Tijmen de Mes
</pre>
738 1 Tijmen de Mes
739
The following NAPTR record types ENUM service types are supported:
740
741 16 Tijmen de Mes
<pre>
742
var $NAPTR_services=array(
743 1 Tijmen de Mes
        "sip"    => array("service"=>"sip",
744
                              "webname"=>"SIP",
745
                              "schemas"=>array("sip:","sips:")),
746
        "mailto" => array("service"=>"mailto",
747
                              "webname"=>"Email",
748
                              "schemas"=>array("mailto:")),
749
        "web:http"   => array("service"=>"web:http",
750
                              "webname"=>"WEB (http)",
751
                              "schemas"=>array("http://")),
752
        "web:https"  => array("service"=>"web:https",
753
                              "webname"=>"WEB (https)",
754
                              "schemas"=>array("https://")),
755
        "x-skype:callto" => array("service"=>"x-skype:callto",
756
                              "webname"=>"Skype",
757
                              "schemas"=>array("callto:")),
758
        "h323"   => array("service"=>"h323",
759
                              "webname"=>"H323",
760
                              "schemas"=>array("h323:")),
761
        "iax"    => array("service"=>"iax",
762
                              "webname"=>"IAX",
763
                              "schemas"=>array("iax:")),
764
        "iax2"   => array("service"=>"iax2",
765
                              "webname"=>"IAX2",
766
                              "schemas"=>array("iax2:")),
767
        "mms"    => array("service"=>"mms",
768
                              "webname"=>"MMS",
769
                              "schemas"=>array("tel:","mailto:")),
770
        "sms"    => array("service"=>"sms",
771
                              "webname"=>"SMS",
772
                              "schemas"=>array("tel:","mailto:")),
773
        "ems"    => array("service"=>"ems",
774
                              "webname"=>"EMS",
775
                              "schemas"=>array("tel:","mailto:")),
776
        "im"     => array("service"=>"im",
777
                              "webname"=>"IM",
778
                              "schemas"=>array("im:")),
779
        "npd:tel"   => array("service"=>"npd+tel",
780
                              "webname"=>"Portability",
781
                              "schemas"=>array("tel:")),
782
        "void:mailto"  => array("service"=>"void:mailto",
783
                              "webname"=>"VOID(mail)",
784
                              "schemas"=>array("mailto:")),
785
        "void:http"  => array("service"=>"void:http",
786
                              "webname"=>"VOID(http)",
787
                              "schemas"=>array("http://")),
788
        "void:https" => array("service"=>"void:https",
789
                              "webname"=>"VOID(https)",
790
                              "schemas"=>array("https://")),
791
        "voice"  => array("service"=>"voice",
792
                              "webname"=>"Voice",
793
                              "schemas"=>array("voice:","tel:")),
794
        "tel"    => array("service"=>"tel",
795
                              "webname"=>"Tel",
796
                              "schemas"=>array("tel:")),
797
        "fax:tel"    => array("service"=>"fax:tel",
798
                              "webname"=>"Fax",
799
                              "schemas"=>array("tel:")),
800
        "ifax:mailto"   => array("service"=>"ifax:mailto",
801
                              "webname"=>"iFax",
802
                              "schemas"=>array("mailto:")),
803
        "pres"   => array("service"=>"pres",
804
                              "webname"=>"Presence",
805
                              "schemas"=>array("pres:")),
806
        "ft:ftp"    => array("service"=>"ft:ftp",
807
                              "webname"=>"FTP",
808
                              "schemas"=>array("ftp://")),
809
        "loc:http"  => array("service"=>"loc:http",
810
                              "webname"=>"GeoLocation",
811
                              "schemas"=>array("http://")),
812
        "key:http"  => array("service"=>"key:http",
813
                              "webname"=>"Public key",
814
                              "schemas"=>array("http://")),
815
        "key:https"  => array("service"=>"key:https",
816
                              "webname"=>"Public key (HTTPS)",
817
                              "schemas"=>array("https://"))
818 16 Tijmen de Mes
        );
819
</pre>
820 1 Tijmen de Mes
821
h3. Graphical client
822
823
@CDRTool->Accounts->ENUM numbers@
824
825 26 Tijmen de Mes
!ngnpro-enum-numbers.png!
826 1 Tijmen de Mes
827
Click on each number to modify its properties.
828
829 26 Tijmen de Mes
!ngnpro-enum-number.png!
830 1 Tijmen de Mes
831
h2. Voicemail Accounts
832
833
The provisioning is performed using the SOAP/XML functions present in the Voicemail port described in NGNPro WSDL.
834
835
To add a voicemail account for a SIP account, the Voicemail.addAccount() method must be used. For each newly created account, a mailbox number will be automatically generated by the provisioning to uniquely identify the voicemail account. If you set the mailbox by yourself, please note that the Asterisk configuration might need to be updated, for example if you give shorter voicemailboxes (3, 4 digits), that are not accepted by default.
836
837
By default mailboxes are created starting with number 1000000.
838
839
You can configure the voicemail server to delete or store the received voicemail messages by setting VoicemailAccount.VoicemailOptions.delete attribute to True or False, respectively.
840
841
To forward requests of a SIP account to the Voicemail account, use the '&lt;voice-mailbox&gt;' wildcard as a value for FUNC, FNOL, FUNV, FNOA, FBUS forwarding indicators in the Sip.setCallDiversions() method.
842
843
Each SIP account can access its own voicemail messages and settings by dialing the voicemail extension (by default &#42;70) configured in the SIP Proxy in:
844
845 20 Tijmen de Mes
<pre>
846 17 Tijmen de Mes
  /etc/opensips/config/settings.m4
847 20 Tijmen de Mes
</pre>
848 1 Tijmen de Mes
849 20 Tijmen de Mes
<pre>
850 17 Tijmen de Mes
  # Number to dial to get to voicemail
851 1 Tijmen de Mes
  define(`VOICEMAIL_NUMBER', `*70')
852 20 Tijmen de Mes
</pre>
853 1 Tijmen de Mes
854
855
Some devices are using the &#42; key internally. For such devices you may create an alias in the platform (like voicemail or a full number without &#42;).
856
857
Voice messages are by default sent by email. If you wish to store the on the voicemail server and listen to them using a telephone device you must enable voicemail storage option for each SIP account using the provisioning API. If the server storage option is enabled, a Message Waiting Indicator (a.k.a MWI) is sent to the devices that subscribed for this event, the devices supporting such feature will provide an indication that voice messages have been stored on the server.
858
859
MWI is enabled if the storage of message on server is enabled. MWI is reset by accessing the voicemail box using a SIP phone.
860
861
To change the default content of asterisk email notification, you must edit in /etc/asterisk/voicemail.conf and change the following directives:
862
863 17 Tijmen de Mes
<pre>
864 1 Tijmen de Mes
;emailbody=
865
;emailsubject=
866
867
; Change the from, body and/or subject, variables:
868
;     VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,
869
;     VM_CIDNAME, VM_DATE
870
871
and
872
873
;serveremail = notification@some_domain.tld
874
</pre>
875
876
An asterisk reload or restart is required:
877
878 17 Tijmen de Mes
  sudo asterisk -r reload
879 1 Tijmen de Mes
880
881
h3. SOAP/XML functions
882
883
* VoicemailPort-&gt;addAccount()
884
* VoicemailPort-&gt;updateAccount()
885
* VoicemailPort-&gt;deleteAccount()
886
* VoicemailPort-&gt;getAccount()
887
* VoicemailPort-&gt;setAnnouncement()
888
889
h2. PSTN Routes
890
891
A route is a PSTN prefix, one or more carriers can be assigned for routing sessions for it. PSTN prefixes always start with 00 + Country code. (e.g. 0031 is Nederland). An empty prefix will match all possible routes while a longer match takes precedence. The actual number format sent out to the PSTN gateway can be modified using the gateway rules described below.
892
893
h3. SOAP/XML functions
894
895
* SipPort-&gt;addRoutes()
896
* SipPort-&gt;deleteRoutes()
897
* SipPort-&gt;getRoutes()
898
899
h3. Graphical client
900
901
@CDRTool->Accounts->PSTN routes@
902
903 26 Tijmen de Mes
!ngnpro-pstn-routes.png!
904 1 Tijmen de Mes
905
h2. PSTN Carriers
906
907
A carrier groups one or more gateways together and can be used during the assignment of PSTN routes. You must define at least one carrier for PSTN routing.
908
909
h3. SOAP/XML functions
910
911
* SipPort-&gt;addCarrier()
912
* SipPort-&gt;deleteCarrier()
913
* SipPort-&gt;getCarriers()
914
915
h3. Graphical client
916
917
@CDRTool->Accounts->PSTN carriers@
918
919 26 Tijmen de Mes
!ngnpro-pstn-carriers.png!
920 1 Tijmen de Mes
921
h2. PSTN Gateways
922
923
You must define at least one gateway for PSTN routing. Before creating any gateway you must create a carrier.
924
925
h3. SOAP/XML functions
926
927
* SipPort-&gt;addGateway()
928
* SipPort-&gt;updateGateway()
929
* SipPort-&gt;deleteGateway()
930
* SipPort-&gt;getGateways()
931
932
h3. Graphical client
933
934
@CDRTool->Accounts->PSTN gateways@
935
936 26 Tijmen de Mes
!ngnpro-pstn-gateways.png!
937 1 Tijmen de Mes
938
h2. PSTN Rules
939
940
These rules define the format of the request URI sent to the remote gateway. Rules can be used to strip and prepend digits depending on various conditions.
941
942
h3. SOAP/XML functions
943
944
* SipPort-&gt;addGatewayRule()
945
* SipPort-&gt;updateGatewayRule()
946
* SipPort-&gt;deleteGatewayRule()
947
* SipPort-&gt;getGatewayRules()
948
949
h3. Graphical client
950
951
@CDRTool->Accounts->PSTN rules@
952
953 26 Tijmen de Mes
!ngnpro-pstn-rules.png!
954 1 Tijmen de Mes
955
Click on rule to edit its properties.
956
957 26 Tijmen de Mes
!ngnpro-pstn-rule.png!
958 3 Tijmen de Mes
959 1 Tijmen de Mes
h2. Emergency Numbers
960
961
Emergency calls refer to dialing short numbers usually associated with emergency services like police or fire-brigade (e.g. 112 or 911). When a SIP session is setup to a short number designated as emergency (in the SIP Proxy configuration), a secondary database lookup is performed in the proxy database in the emergency&#95;mapping table. Based on the *region* attribute provisioned with each SIP account, the final destination number for the emergency service in the region of the account is looked up.
962
963
964 41 Tijmen de Mes
1. Define the emergency numbers in the /etc/opensips/config/settings.m4
965 26 Tijmen de Mes
966 21 Tijmen de Mes
<pre>
967 18 Tijmen de Mes
  # Emergency numbers
968
  define(`EMERGENCY_NR1', `112')
969
  define(`EMERGENCY_NR2', `911')
970 1 Tijmen de Mes
  define(`EMERGENCY_NRS', `2')
971
</pre>
972
973 41 Tijmen de Mes
2. Add the local access number for each region to emergency&#95;mapping table, the table has the following structure:
974
975
  |*Field*|*Type*|
976
  |id|int(10) unsigned|
977
  |username|varchar(64)|
978
  |domain|varchar(64)|
979
  |region|varchar(32)|
980
  |target|varchar(128)|
981
  |change&#95;date|timestamp|
982
983
  Example: 
984 21 Tijmen de Mes
<pre>
985 1 Tijmen de Mes
+----------+-------------+-----------+-------------------------------+---------------------+
986
| username | domain      | region    | target                        | change_date         |      
987
+----------+-------------+-----------+-------------------------------+---------------------+
988
| 112      | example.com | 010       | sip:0031141217112@example.com | 2006-05-09 14:33:18 | 
989
| 112      | example.com | 0111      | sip:0031141219112@example.com | 2006-05-09 14:33:18 | 
990
| 112      | example.com | 0113      | sip:0031141219112@example.com | 2006-05-09 14:33:18 | 
991
| 112      | example.com | 0114      | sip:0031141219112@example.com | 2006-05-09 14:33:18 | 
992
| 112      | example.com | 0115      | sip:0031141219112@example.com | 2006-05-09 14:33:18 | 
993
+----------+-------------+-----------+-------------------------------+---------------------+
994 21 Tijmen de Mes
</pre>
995 1 Tijmen de Mes
996 41 Tijmen de Mes
3. Set the *region* attribute for each SIP account using Sip-&gt;updateAccount() to match the region column in emergency&#95;mapping table.
997 1 Tijmen de Mes
998
h2. Email Notifications
999
1000
h3. Quota exceeded
1001
1002
This notification is sent out to the email address associated with SIP accounts that have the *quota* attribute set to a positive value, when the monthly quota has been exceeded. The email is generated by a CDRTool cron job task from the script:
1003
1004 24 Tijmen de Mes
  /var/www/CDRTool/scripts/OpenSIPS/quotaCheck.php
1005 1 Tijmen de Mes
1006
1007
To change the email headers or the body of the notification message you must insert/update a row in cdrtool.settings mysql table. See for an example:
1008
1009 24 Tijmen de Mes
  /var/www/CDRTool/setup/mysql/custom_notifications.mysql 
1010 1 Tijmen de Mes
1011
1012
h3. Voicemail
1013
1014
The notification that contains also the actual voice message as a WAV attachment is sent out by the Asterisk voicemail server. To change the email headers or body you must change the configuration file:
1015
1016 24 Tijmen de Mes
  /etc/asterisk/voicemail.conf
1017 1 Tijmen de Mes
1018
1019
This notification cannot be enabled/disabled per user, it is a global platform setting.
1020
1021
h3. Last sessions
1022
1023
An email with last received sessions in the previous 24 hours is sent out by a CDRTool cronjob script:
1024
1025 24 Tijmen de Mes
  /var/www/CDRTool/scripts/OpenSIPS/notifyLastSessions.php
1026 1 Tijmen de Mes
1027
1028
The From header of the email notification can be modified by changing the following setting from /etc/cdrtool/global.inc:
1029
1030 24 Tijmen de Mes
  $CDRTool['provider']['fromEmail'] ="support@ag-projects.com";
1031 1 Tijmen de Mes
1032
1033
The notification is sent only if the SIP account belongs to the *missed-calls* group.