Dear colleagues I have configured realtime asterisk. I have created SIP table in mysql for registering extensions and etc… Please see below it briefly
CREATE TABLE sip ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(80) NOT NULL DEFAULT ‘’, context varchar(80) DEFAULT ‘internal’, deny varchar(95) DEFAULT ‘0.0.0.0/0.0.0.0’, permit varchar(95) DEFAULT ‘192.168.0.0/16’, secret varchar(80) DEFAULT NULL, md5secret varchar(80) DEFAULT NULL, host varchar(31) NOT NULL DEFAULT ‘dynamic’, nat varchar(5) NOT NULL DEFAULT ‘no’, type enum(‘user’,‘peer’,‘friend’) NOT NULL DEFAULT ‘friend’, language char(2) DEFAULT NULL, mailbox varchar(50) DEFAULT NULL,
There is a strange situation for me. When I insert data in the mailbox column the extension that is associated with that malbox cannot be registered. As soon as I remove that data and make it as it was before - to the default state the phone can be registered successfully.
I have tried to configure the same thing in sip.conf and it is working properly. I wonder what is going wrong.
Can you please help me with that ? I would appreciate that very much!
If this what you’re seeing in the log, you should prune the realtime record, then add it back (see below).
NOTICE: chan_sip.c:27655 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 62966
>sip prune realtime 62966
>sip show peer 62966 load
Try including the context with the mailbox (62966@default).
My users (extensions) are created by mysql. So when I enter “sip show peers” it does not give me any result about that extension. Therefore when I do
sip prune realtime 1010
Peer ‘1010’ not found
The thing is that “sip show peers” lists users (extensions) created in sip.conf . But at that case I don’t face any issue because as told before in sip.conf when I enter ‘mailbox’ for any extension everything is ok. But as we must use instead of sip.conf mysql we must find solution for doing the same to work in mysql.
Its really very strange for me that only when ‘mailbox’ column is added to any extension that user is not able to register.
mysql -u root -p
update sip set mailbox = ‘1010@default’ where id = ‘1’;
(sip is the table that I have created before )
Immediately when the user is trying to register I see this:
First, make sure you have “rtcachefriends=yes” in the general section of sip.conf. That will allow realtime caching of the extensions. Also, “default” may not be the correct context. Take a look in you voicemailusers table and if the context is blank, make it the same as your sip extension context, then make the mailbox ext@context. For me, my extensions’ context is from-internal-sip, so my voicemailusers table has from-internal-sip as the context for every mailbox. In the sip table, I have 12966@from-internal-sip. On the phone, I just set the mailbox to 12966 and tell it the voicemail server ip.
I’ve been having trouble with the taskprocessor also. Similar errors on 13.11 and 13.8. Been working with a developer on this. It’s due to a deadlock in how it queues tasks. They have an internal bug that they’re working on. He said he’d bump it up internally, but he also said that it had to do with realtime and voicemail. You and I may be in the same boat with this one. Keep and eye on your memory consumption for the asterisk process. If it gets too high, so far, I’ve just done a “core restart now” from the cli and it goes back down. Not a long term solution, I know. Hopefully they’ll find the problem soon.
Dear friend. Thank you for your kind reply. I added “rtcachefriends=yes” and could register successfully.
Right now I am doing testing. I made a test call and left voicemail. So now when I check for voicemail and want to hear the message the voice tells me to enter mailbox and the password (as it should do). When I enter them it tells that - ‘login indirect’
Can you post the log from a call to VoiceMailMain()? Sounds like it didn’t read the password correctly.
You may also want to add a “,u” or “,b” for unavailable or busy greeting.
If you want to use realtime voicemail, you can, but you’ll need change the Voicemail Options in make menuselect from FILE_STORAGE to ODBC_STORAGE, create the tables, and modify the config files. Some might need adjusted for your installation.
Executing [700@internal:1] VoiceMailMain(“SIP/1010-00000000”, “”) in new stack
<SIP/1010-00000000> Playing ‘vm-login.gsm’ (language ‘en’)
<SIP/1010-00000000> Playing ‘vm-password.gsm’ (language ‘en’)
Incorrect password ‘123’ for user ‘1010’ (context = default)
As you see there is a context default, but I have written in “voicemail.conf” my_context and its not default.
Default I wrote before but then I have changed it to my_context. It doesnt “see” the new context I guess or anything else should be done ?
Regarding to the realtime part I will come back to it a bit later. Firstly I want to finish with this one.
If you’re wanting to store the mailbox messages in the database, the only option now is ODBC. If you’re just storing the voiecmail users in the database, you could continue with the MySQL driver, but I wouldn’t expect it to be available forever in future versions.
ODBC manages the connection information and drivers to databases. Several database servers can be configured in to use Open DataBase Connectivity. It standardizes the connections. Makes it easier to change between backends if you need to. Unless you’re stuck using microsoft sql server and a few others, then you also will need to use FreeTDS.