Extensions using realtime

HI all,

so i have been trying to use realtime as a method to making depoyment of the asterisk server a little less stressfull, and have managed to get my snom phones to authenticate them selfs.

problem is now i can ring wother of them as i know there is somethign wrong with the extensions db config.

i have the following code in the foollowing places, can some one tell me where i am going wrong.

extensions.conf

[code][1231]
switch => Realtime/@1231

[1223]
switch => Realtime/@1223

[8500]
switch => Realtime/@8500
[/code]

there the switch statemnets i have read about on voip-info.org and in the extensions database i have the following code for extensions 1231

[code]context = 1231
exten = 1231
priority = 1
app = Dial
appdata = SIP/1231,20,tr

context = 1231
exten = 1231
priority = 2
app = voicemail
appdata = u1231

context = 1231
exten = 1231
priority = 102
app = voicemail
appdata = b1231

also i have voicemail in there to

context = voicemail
exten = 8500
priority = 1
app = voicemail
appdata = main
[/code]

so there is the 4 statemnets i have in my extensions_table in my asterisk database, those values i have there worked in the flatfile config, so i am at a loss why there not working in the realtime config.

have i missed something???

i have the same statements in there for extension 1223 those are the 2 i am using to communicate to each other.

can any one help me or point me in the right direction.

Alan

is there no one out there using real time to manage there extensions, i cant beleive that there is no one not using it.

please, pretty please with a vherry on top lol

man this is frustrating

Alan

:angry:

In extensions.conf you need something like this. Replace default with whatever context you are using.

[default]
switch => Realtime/@

Dave,

i tried what you said but still my snom is saying number not found, im just not sure that the values i am entering in the database are correct.

just to clarify i have the following extensions

1223
1231

here is what i have in extensions.conf

[1231]
switch => Realtime/@

[1223]
switch => Realtime/@

and here is what i have in the database

context = 1231
exten = 1231
priority = 1
app = Dial
appdata = SIP/1231,20,tr

context = 1231
exten = 1231
priority = 2
app = voicemail
appdata = u1231

context = 1231
exten = 1231
priority = 102
app = voicemail
appdata = b1231

context = 1231
exten = 1231
priority = 1
app = Dial
appdata = SIP/1231,20,tr

context = 1223
exten = 1223
priority = 2
app = voicemail
appdata = u1223

context = 1223
exten = 1223
priority = 102
app = voicemail
appdata = b1223

asterisk debug log says this

Feb 27 09:41:43 DEBUG[669] chan_sip.c: Setting NAT on RTP to 524288
Feb 27 09:41:43 DEBUG[669] chan_sip.c: Checking SIP call limits for device 1223
Feb 27 09:41:43 DEBUG[669] chan_sip.c: Stopping retransmission on ‘3c2673fd5302-q8k10u7lqlnh@192-168-1-170’ of Response 1: Match Found

my phone just complains number not found

have i missed something

Alan

Try this:

In extensions.conf remove what you have and put this (make a backup 1st):

[default]

switch => Realtime/@

And in your extensions table in the database, change all of the context fields to “default” (without the quotes).

You are creating a different context for each extension when you really want to create extensions within the same context.
Also make sure that the contexts are set to “default” in sip.conf or your sip table in the real-time database.

Dave,

just one more thing, ive re created some extensions in the extensions_table but seem to be getting an error back from asterisk on the phone of closed…

same when i tried to create the asterisk test, any ideas whats that could be

Debug Log

Feb 28 12:32:49 DEBUG[23183] chan_sip.c: update_call_counter(1223) - decrement call limit counter
Feb 28 12:32:49 DEBUG[23161] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sip_buddies WHERE name = '1223'
Feb 28 12:32:49 DEBUG[23161] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 12:32:50 DEBUG[23178] chan_sip.c: That's odd...  Got a response on a call we dont know about. Cseq 102 Cmd SIP/2.0
Feb 28 12:32:50 DEBUG[23178] chan_sip.c: That's odd...  Got a response on a call we dont know about. Cseq 102 Cmd SIP/2.0
Feb 28 12:32:50 DEBUG[23178] chan_sip.c: Stopping retransmission on '3c27ed9846cd-9of38cq5wa0m@192-168-1-170' of Response 1: Match Found
Feb 28 12:32:50 DEBUG[23178] chan_sip.c: That's odd...  Got a response on a call we dont know about. Cseq 102 Cmd SIP/2.0
Feb 28 12:32:50 DEBUG[23178] chan_sip.c: Stopping retransmission on '3c27ed9846cd-9of38cq5wa0m@192-168-1-170' of Request 102: Match Found

in my extensions_table i have the following

      25 incoming 600 1 Playback demo-echotest 
      26 incoming 600 2 Echo   
      27 incoming 600 3 Playback demo-echodone 
      28 incoming 600 4 Goto s|6 
      29 incoming 500 1 Playback demo-abouttotry 
      30 incoming 500 2 Dial IAX2/guest@misery.digium.com/s@default 
      31 incoming 500 3 Playback demo-nogo 
      32 incoming 500 4 Goto s|6 
      33 incoming 8500 1 VoicemailMain   
      34 incoming 8500 2 Hangup   

for some reason extension 500 and 8500 just close, but extension 600 does work, but i dont get the asterisk voice asking me to test the echo test it just goes straight to the test.

but for some reason the connection just closes

is there any reason for this

also when i try to ring one of my extensions it rings for about 5 rings and then goes dead. doesnt go to voicemail even though i have specified it to go to voicemail if its not picked up.

here is the dialplan for my 2 extensions, maybe i have some code wrong

      24 incoming 1231 102 Voicemail b1231 
      22 incoming 1231 1 Dial SIP/1231|20|tr 
      23 incoming 1231 2 Voicemail u1231 
      21 incoming 1223 102 Voicemail b1223 
      20 incoming 1223 1 Dial SIP/1223|20|tr 
      19 incoming 1223 2 Voicemail u1223 

any ideas dave whats wrong with that dialplan

Debug Log

Feb 28 13:01:19 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:19 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM extensions_table WHERE exten = '1231' AND context = 'incoming' AND priority = '1'
Feb 28 13:01:19 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:19 DEBUG[23784] channel.c: Driver for channel 'SIP/1223-c7ae' does not support indication 8, emulating it
Feb 28 13:01:19 DEBUG[23763] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:19 DEBUG[23763] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM sip_buddies WHERE name = '1223'
Feb 28 13:01:19 DEBUG[23763] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:19 DEBUG[23778] chan_sip.c: Stopping retransmission on '3c27f43e3a98-0vb7zjayhno8@192-168-1-170' of Response 1: Match Found
Feb 28 13:01:19 DEBUG[23778] chan_sip.c: That's odd...  Got a response on a call we dont know about. Cseq 102 Cmd SIP/2.0
Feb 28 13:01:19 DEBUG[23778] chan_sip.c: That's odd...  Got a response on a call we dont know about. Cseq 102 Cmd SIP/2.0
Feb 28 13:01:30 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM extensions_table WHERE exten = 'h' AND context = 'incoming' AND priority = '1'
Feb 28 13:01:30 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:30 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Retrieve SQL: SELECT * FROM extensions_table WHERE exten LIKE '\_%' AND context = 'incoming' AND priority = '1' ORDER BY exten
Feb 28 13:01:30 DEBUG[23784] res_config_mysql.c: MySQL RealTime: Everything is fine.
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '"Alan Sherlock" <1223>'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '1223'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '1231'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'incoming'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'SIP/1223-c7ae'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'SIP/1231-f5b4'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'VoiceMail'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'u1231'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '2006-02-28 13:01:11'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '2006-02-28 13:01:19'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '2006-02-28 13:01:30'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '19'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '11'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'FAILED'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is 'DOCUMENTATION'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '(null)'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '1141131671.0'
Feb 28 13:01:30 DEBUG[23784] pbx.c: Function result is '(null)'
Feb 28 13:01:30 DEBUG[23784] cdr_addon_mysql.c: cdr_mysql: inserting a CDR record.
Feb 28 13:01:30 DEBUG[23784] cdr_addon_mysql.c: cdr_mysql: SQL command as follows: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,userfield) VALUES ('2006-02-28 13:01:11','\"Alan Sherlock\" <1223>','1223','1231','incoming', 'SIP/1223-c7ae','SIP/1231-f5b4','VoiceMail','u1231',19,11,'FAILED',3,'','')

any help would be much apprciated

Alan

Try | not , for the separator in your app data field.