2
votes

First I have a correct conection with database mysql so the problem is the following:

I want to configure in realtime the sip.conf so:

First into my database I put into schema asterisk and table ast_sipfriends :

id      name    host     type  callerid contexto     secret    username
1   80  dynamic friend  80  internal    80  80
2   81  dynamic friend  81  internal    81  81

And in the sip.conf I have the general context like that:

[general]
context=default 
bindaddr=0.0.0.0
bindport = 5060
videosupport=yes
disallow=all
allow=gsm       
allow=alaw                      
allow=ulaw
allow=speex
allow=h264
allow=h261
allow=h263
allow=h263p                     
language=es
allowsubscribe=yes
asterisk sip allowoverlap=yes
caninvite=no ; These setting confirm we want the PBX handling the audio
canreinvite=no
nat=yes
dtmfmode=rfc2833
jbenable=yes
maxcallbitrate=384

And in my extensions.conf the following:

[internal]
exten => 80,1,Dial(SIP/80,26)
exten => 80,n,Hangup()

exten => 81,1,Dial(SIP/81,26)
exten => 81,n,Hangup()

Into my extconfig.conf :

sippeers => odbc,asterisk,ast_sipfriends
sipusers => odbc,asterisk,ast_sipfriends

The problem is that 80 and 81 are registered but when I try to make a call the asterisk console show:

-- Executing [81@internal:1] Dial("SIP/80-00000000", "SIP/81,26") in new stack
[Jun 11 11:13:57] WARNING[2887][C-00000000]: app_dial.c:2437 dial_exec_full: Unable to   create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [81@internal:2] Hangup("SIP/80-00000000", "") in new stack
== Spawn extension (internal, 81, 2) exited non-zero on 'SIP/80-00000000'

And when execute sip show peers 80 and 81 were not in there so this users are registered but can not establish a channel because asterisk does not see them so help me please!

1

1 Answers

4
votes

It will show peers only when you have rtpcachefriends=yes and only after first (success or unsuccess) registration attempt to that peer

Asterisk do not load peers from db(becuase can be millions of availible peers on some installation), it load peer only when it requested.

If rtpcachefriends=no, peer will be loaded on use and not be shown in "sip show peers"