[asterisk-bugs] [Asterisk 0011717]: Register statement works differently using the plain text file or the Asterisk Realtime Architecture

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jan 10 06:10:28 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11717 
====================================================================== 
Reported By:                AlexB
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   11717
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.2.26 
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             01-09-2008 12:23 CST
Last Modified:              01-10-2008 06:10 CST
====================================================================== 
Summary:                    Register statement works differently using the plain
text file or the Asterisk Realtime Architecture
Description: 
In Asterisk 1.2.26 there is a different behaviour for the following syntax
of register statement using the plain text file or the Asterisk Realtime
Architecture:

register = **user**:**password**@sip_proxy

Please have a look at sip.conf:

[general]
allowoverlap = yes
realm = *****
bindport = 5060
bindaddr = 0.0.0.0
srvlookup = yes
tos = lowdelay
disallow = all
allow = alaw
trustrpid = no
dtmfmode = auto
externip = ***.***.***.***
localnet = 192.168.0.0/255.255.0.0
canreinvite = yes
rtcachefriends = yes
qualify = yes
register = **user**:**password**@sip_proxy

[sip_proxy]
type=friend
context=provider_1
secret=**password**
username=**user**
fromdomain=123.123.123.123
fromuser==**user**
host=123.123.123.123
insecure=very

It looks like the example in sip.conf.sample (see below) and of course it
works like a charm in Asterisk 1.2.26 as well as previous versions.

;register => 2345:password at sip_proxy/1234
;
;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
;    connect to local extension 1234 in extensions.conf, default context,
;    unless you configure a [sip_proxy] section below, and configure a
;    context.
;    Tip 1: Avoid assigning hostname to a sip.conf section like
[provider.com]
;    Tip 2: Use separate type=peer and type=user sections for SIP
providers
;           (instead of type=friend) if you have calls in both directions

;[sip_proxy]
; For incoming calls only. Example: FWD (Free World Dialup)
; We match on IP address of the proxy for incoming calls
; since we can not match on username (caller id)
;type=peer
;context=from-fwd
;host=fwd.pulver.com

;[sip_proxy-out]
;type=peer                              ; we only want to call out, not be
called
;secret=guessit
;username=yourusername                  ; Authentication user for outbound
proxies
;fromuser=yourusername                  ; Many SIP providers require
this!
;fromdomain=provider.sip.domain
;host=box.provider.com
;usereqphone=yes                        ; This provider requires
";user=phone" on URI
;call-limit=5                           ; permit only 5 simultaneous
outgoing calls to this peer
;outboundproxy=proxy.provider.domain    ; send outbound signaling to this
proxy, not directly to the peer
;port=80                                ; The port number we want to
connect to on the remote side


Unfortunately, using ARA (see mappings below) of Asterisk 1.2.26, the
register statement doesn't work anymore.

extconfig.conf:
sip.conf => mysql,asterisk,ast_config
sipusers => mysql,asterisk,sip_buddies
sippeers => mysql,asterisk,sip_buddies

It is because the following query returns no rows:

[15:22] Alex: res_config_mysql.c:140 realtime_mysql: MySQL RealTime:
Retrieve SQL: SELECT * FROM sip_buddies WHERE name = 'sip_proxy' AND host =
'dynamic'

Since we're trying to register to a remote server, host can't be dynamic!
However no more queries are performed.

In Asterisk 1.2.25 the query was:
[15:21] Alex: res_config_mysql.c:140 realtime_mysql: MySQL RealTime:
Retrieve SQL: SELECT * FROM sip_buddies WHERE name = 'sip_proxy'

This way Asterisk 1.2.26 can't register to the remote server and/or dial
that peer.
====================================================================== 

---------------------------------------------------------------------- 
 AlexB - 01-10-08 06:10  
---------------------------------------------------------------------- 
snuffy I know Asterisk 1.2 is in security releases only, however I think
that security fixes shouldn't break existing working code - just to put it
simply, ARA doesn't work at all in Asterisk 1.2.26.

Anyway next week I'll try to reproduce this problem in 1.4 too and then
let you know. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-10-08 06:10  AlexB          Note Added: 0076630                          
======================================================================




More information about the asterisk-bugs mailing list