[asterisk-bugs] [Asterisk 0013212]: dundi precache not working

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Dec 11 13:25:47 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13212 
====================================================================== 
Reported By:                CrashHD
Assigned To:                blitzrage
====================================================================== 
Project:                    Asterisk
Issue ID:                   13212
Category:                   PBX/pbx_dundi
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.4.21.2 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-07-31 17:13 CDT
Last Modified:              2008-12-11 13:25 CST
====================================================================== 
Summary:                    dundi precache not working
Description: 
When setting up the dundi pre-cache in an inbound / outbound model->

PEER-A <----Pre Cache--------< PEER B

PEER-A <-----Lookups---------< PEER B

I see a noauth error referring to the context, which from my configs I'll
include you'll see is clearly not the case.
====================================================================== 

---------------------------------------------------------------------- 
 (0096229) blitzrage (administrator) - 2008-12-11 13:25
 http://bugs.digium.com/view.php?id=13212#c96229 
---------------------------------------------------------------------- 
Aha!

This is a configuration issue. And the nuances are subtle because I got
caught by it too.

You need to read these two sections a bit more carefully (as I did too!)
from dundi.conf:



; include - Includes this peer when searching a particular context
;           for lookup (set "all" to perform all lookups with that
;           host.  This is also the context in which peers are permitted
;           to precache.


; permit - Permits this peer to search a given DUNDi context on
;          the local system.  Set "all" to permit this host to
;          lookup all contexts.  This is also a context for which
;          we will create/forward PRECACHE commands.


; model - inbound, outbound, or symmetric for whether we receive 
;         requests only, transmit requests only, or do both.
;


; precache - Utilize/Permit precaching with this peer (to pre
;            cache means to provide an answer when no request
;            was made and is used so that machines with few
;            routes can push those routes up a to a higher level).
;            outgoing means we send precache routes to this peer,
;            incoming means we permit this peer to send us
;            precache routes.  symmetric means we do both.
;
; Note: You cannot mix symmetric/outbound model with symmetric/inbound
; precache, nor can you mix symmetric/inbound model with
symmetric/outbound
; precache.


Here is a working configuration for pre-caching in one direction. I will
leave it as an exercise for the original reporter to get it working
bi-directionally (I think you just need to change the model and precache to
symmetric and configure out permits and includes appropriately):

(NOTE: as writing this, I learned that permit is what you SEND via
precache, and include is what you RECEIVE via precache.)


; This peer will receive pre-caching from the other peer
[00:00:00:00:00:02]
model = inbound
precache = inbound
host = 192.168.128.52
inkey = ClusterTestTwo
outkey = ClusterTestOne
include = private-pstn
qualify = yes



; This peer will sent pre-caching to the other peer
[00:00:00:00:00:01]
model = outbound
precache = outbound
host = 192.168.128.51
inkey = ClusterTestOne
outkey = ClusterTestTwo
permit = private-pstn
qualify = yes

On this same server that is sending the pre-cache, I configured this
mapping:

private-pstn => private-pstn,0,SIP,remote_server/${NUMBER},nopartial


Then in the dialplan (extensions.conf), I setup these numbers for
precaching:

[private-pstn]
exten => 5195915119,1,NoOp()
exten => 4166289921,1,NoOp()


Then when I had both servers up and running, and reloaded the DUNDi module
(pbx_dundi.so), I get this in my database on the other server:

*CLI> database show
/dundi/cache/000000000002/4166289921/private-pstn/e00000000:
1228994035|1/0/2/remote_server/4166289921/000000000002|
/dundi/cache/000000000002/4166289921/private-pstn/r000000000000:
1228994035|1/0/2/remote_server/4166289921/000000000002|
/dundi/cache/000000000002/5195915119/private-pstn/e00000000:
1228994035|1/0/2/remote_server/5195915119/000000000002|
/dundi/cache/000000000002/5195915119/private-pstn/r000000000000:
1228994035|1/0/2/remote_server/5195915119/000000000002|

This shows the precaching being done successfully.

You can verify this with 'dundi debug' on the CLI (or dundi set debug
{on|off} in Asterisk trunk and Asterisk 1.6.2 and beyond):

[Dec 11 05:13:45] DEBUG[27152]: pbx_dundi.c:1571 handle_command_response:
Got canonical message 13 (0), 128 bytes data
    Erx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: PRECACHERQ  
(Command)
          Flags: 00 STrans: 16008  DTrans: 00000 [192.168.128.52:4520]
        VERSION         : 1
        ENTITY IDENT    : 00:00:00:00:00:02
        CALLED NUMBER   : 5195915119
        CALLED CONTEXT  : private-pstn
        TTL             : 32
        ANSWER          : [EXISTS] 0 <SIP/remote_server/5195915119> from
[00:00:00:00:00:02]
        HINT            : [NONE] 
        EXPIRATION      : 3600

[Dec 11 05:13:45] DEBUG[27152]: pbx_dundi.c:1571 handle_command_response:
Got canonical message 5 (0), 87 bytes data
[Dec 11 05:13:45] DEBUG[27152]: pbx_dundi.c:1014 dundi_prop_precache:
Forwarding precache for '5195915119 at private-pstn'!
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ACK         
(Response)
     Flags: 00 STrans: 30345  DTrans: 16008 [192.168.128.52:4520]
[Dec 11 05:13:45] DEBUG[27178]: pbx_dundi.c:671 dundi_precache_thread:
Whee, precaching '5195915119 at private-pstn' for '00:00:00:00:00:02'
[Dec 11 05:13:45] DEBUG[27178]: pbx_dundi.c:3690 dundi_precache_internal:
Precache internal (5195915119 at private-pstn)!
    ETx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: PRECACHERP  
(Response)
          Flags: 00 STrans: 30345  DTrans: 16008 [192.168.128.52:4520]
(Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ENCRYPT     
(Command)
     Flags: 00 STrans: 30345  DTrans: 16008 [192.168.128.52:4520]
   ENCDATA         : [IV f7dbb733abd916259bf4d652a2154f01] 2 encrypted
blocks


Hope that helps! 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-11 13:25 blitzrage      Note Added: 0096229                          
======================================================================




More information about the asterisk-bugs mailing list