This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb [2013/05/14 12:58] – [Asterisk Database] admin | asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb [2014/04/30 16:35] (current) – [Config File] admin | ||
---|---|---|---|
Line 337: | Line 337: | ||
- | DROP TABLE IF EXISTS | + | DROP TABLE IF EXISTS |
CREATE TABLE `sipregs` ( | CREATE TABLE `sipregs` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | `id` int(11) NOT NULL AUTO_INCREMENT, | ||
Line 504: | Line 504: | ||
</ | </ | ||
<note important> | <note important> | ||
- | **voiceboxes** is used to store voicemail box profiles and has the standard structure required by Asterisk. Storing voice box profiles in database allows to run several instances of Asterisk that can be load balanced or used in fail-over mode to store or listen to voice messages. | + | **voicemail** is used to store voicemail box profiles and has the standard structure required by Asterisk. Storing voice box profiles in database allows to run several instances of Asterisk that can be load balanced or used in fail-over mode to store or listen to voice messages. |
</ | </ | ||
<note important> | <note important> | ||
- | **voicemessages** is used to store voice messages and has the standard structure required by Asterisk. Storing voice messages in database allows to run several instances of Asterisk that can be load balanced or used in fail-over mode to store or listen to voice messages. | + | **voicemail_messages** is used to store voice messages and has the standard structure required by Asterisk. Storing voice messages in database allows to run several instances of Asterisk that can be load balanced or used in fail-over mode to store or listen to voice messages. |
</ | </ | ||
< | < | ||
If you need to do adjustments to the tables used by Asterisk, check the SQL scripts from Asterisk source tree located in **contrib/ | If you need to do adjustments to the tables used by Asterisk, check the SQL scripts from Asterisk source tree located in **contrib/ | ||
+ | </ | ||
+ | <note important> | ||
+ | In previous versions of this tutorial, there were different table names for **voicemail** and **voicemail_messages** (respectively **voiceboxes** and **voicemessages**) -- they were changed to match the default name in Asterisk, because they have same structure. **sipusers** and **sipregs** are a bit customized, thus they have different names - **sipusers** maps over **sippeers** and **sipregs** can be actually a view over **sipusers**. The table **voicemail_messages** is used for storing voice messages in database via odbc, you have to set its value inside voicemail.conf file, in the attribute **odbctable**. | ||
</ | </ | ||
Line 561: | Line 564: | ||
sippeers => odbc, | sippeers => odbc, | ||
sipregs => odbc, | sipregs => odbc, | ||
- | voicemail => odbc, | + | voicemail => odbc, |
</ | </ | ||
Line 598: | Line 601: | ||
<code sql> | <code sql> | ||
- | insert into sipusers (name, | + | insert into sipusers (name, |
values (' | values (' | ||
- | insert into sipusers (name, | + | insert into sipusers (name, |
values (' | values (' | ||
- | insert into sipusers (name, | + | insert into sipusers (name, |
values (' | values (' | ||
Line 609: | Line 612: | ||
insert into sipregs(name) values(' | insert into sipregs(name) values(' | ||
- | insert into voiceboxes(customer_id, | + | insert into voicemail(context, mailbox, password) values (' |
- | insert into voiceboxes(customer_id, | + | insert into voicemail(context, mailbox, password) values (' |
- | insert into voiceboxes(customer_id, | + | insert into voicemail(context, mailbox, password) values (' |
</ | </ | ||
Line 1021: | Line 1024: | ||
#!ifdef WITH_ASTERISK | #!ifdef WITH_ASTERISK | ||
- | modparam(" | + | modparam(" |
modparam(" | modparam(" | ||
modparam(" | modparam(" | ||
Line 1386: | Line 1389: | ||
# Authentication route | # Authentication route | ||
route[AUTH] { | route[AUTH] { | ||
+ | |||
+ | # if caller is not local subscriber, then check if it calls | ||
+ | # a local destination, | ||
+ | if (from_uri!=myself && uri!=myself) | ||
+ | { | ||
+ | sl_send_reply(" | ||
+ | exit; | ||
+ | } | ||
+ | |||
#!ifdef WITH_AUTH | #!ifdef WITH_AUTH | ||
Line 1417: | Line 1429: | ||
consume_credentials(); | consume_credentials(); | ||
} | } | ||
- | # if caller is not local subscriber, then check if it calls | ||
- | # a local destination, | ||
- | if (from_uri!=myself && uri!=myself) | ||
- | { | ||
- | sl_send_reply(" | ||
- | exit; | ||
- | } | ||
- | |||
#!endif | #!endif | ||
return; | return; |