[Home]

Summary:ASTERISK-12496: dundi precache not working
Reporter:Tim Ferguson (crashhd)Labels:
Date Opened:2008-07-31 17:13:52Date Closed:2011-06-07 14:07:22
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/pbx_dundi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
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.

****** ADDITIONAL INFORMATION ******





Config on PEER A:
;PEERB
[00:00:00:00:00:0B]
model           = outbound
precache        = outbound
host            = #.#.#.#
inkey           = voip-internal
outkey          = (OMIT)
register        = yes
include         = private
permit          = private-pstn
qualify         = yes

Config on PEER B:
;PEER A
[00:00:00:00:00:0A]
model           = outbound
precache        = outbound
host            = #.#.#.#
inkey           = (OMIT)
outkey          = voip-internal
include         = private-pstn
permit          = private
qualify         = yes



OUTPUT ON PEER A on PEER B RELOAD:
DUNDi Debugging Enabled
Rx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 19196  DTrans: 00000 [70.103.254.20:4520]
  ENTITY IDENT    : 00:00:00:00:00:20
  KEYCRC32        : 2659271799
  ENCDATA         : [IV 77f4b058954509517fa2053ed8848101] 6 encrypted blocks

voipgw2*CLI>
   Erx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: PRECACHERQ   (Command)
         Flags: 00 STrans: 19196  DTrans: 00000 [70.103.254.20:4520]
       VERSION         : 1
       ENTITY IDENT    : 00:00:00:00:00:20
       CALLED NUMBER   : 19163587780
       CALLED CONTEXT  : private
       TTL             : 1
       ANSWER          : [EXISTS|CANMATCH|NOUNSLCTD|NOCOMUNSLTD] 1 <SIP/70.103.254.20/19163587780�> from [00:00:00:00:00:20]
       HINT            : [NONE]
       EXPIRATION      : 3600
voipgw2*CLI>
   ETx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: PRECACHERP   (Response)
         Flags: 00 STrans: 26709  DTrans: 19196 [70.103.254.20:4520] (Final)
       CAUSE           : NOAUTH: Unsupported DUNDI Context
voipgw2*CLI>
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 26709  DTrans: 19196 [70.103.254.20:4520]
  ENCDATA         : [IV cd02132b8f5ab23d9a88c8417a852b64] 4 encrypted blocks

voipgw2*CLI>
Rx-Frame Retry[No] -- OSeqno: 001 ISeqno: 001 Type: ACK          (Response)
    Flags: 00 STrans: 19196  DTrans: 26709 [70.103.254.20:4520] (Final)



OUTPUT ON PEER B ON PEER B RELOAD:

   ETx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: PRECACHERQ   (Command)
         Flags: 00 STrans: 19196  DTrans: 00000 [70.103.254.2:4520]
       VERSION         : 1
       ENTITY IDENT    : 00:00:00:00:00:20
       CALLED NUMBER   : 19163587780
       CALLED CONTEXT  : private
       TTL             : 1
       ANSWER          : [EXISTS|CANMATCH|NOUNSLCTD|NOCOMUNSLTD] 1 <SIP/70.103.254.20/19163587780�> from [00:00:00:00:00:20]
       HINT            : [NONE]
       EXPIRATION      : 3600

Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 19196  DTrans: 00000 [70.103.254.2:4520]
  ENTITY IDENT    : 00:00:00:00:00:20
  KEYCRC32        : 2659271799
  ENCDATA         : [IV 77f4b058954509517fa2053ed8848101] 6 encrypted blocks


Rx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 26709  DTrans: 19196 [70.103.254.2:4520]
  ENCDATA         : [IV cd02132b8f5ab23d9a88c8417a852b64] 4 encrypted blocks


   Erx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: PRECACHERP   (Response)
         Flags: 00 STrans: 26709  DTrans: 19196 [70.103.254.2:4520] (Final)
       CAUSE           : NOAUTH: Unsupported DUNDI Context

Tx-Frame Retry[No] -- OSeqno: 001 ISeqno: 001 Type: ACK          (Response)
    Flags: 00 STrans: 19196  DTrans: 26709 [70.103.254.2:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 14384  DTrans: 00000 [70.103.254.2:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 23017  DTrans: 00000 [65.74.161.236:4520] (Final)
Rx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ACK          (Response)
    Flags: 00 STrans: 08115  DTrans: 14384 [70.103.254.2:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 23017  DTrans: 00000 [65.74.161.236:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 23017  DTrans: 00000 [65.74.161.236:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 23017  DTrans: 00000 [65.74.161.236:4520] (Final)
Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: NULL         (Command)
    Flags: 00 STrans: 23017  DTrans: 00000 [65.74.161.236:4520] (Final)
Rx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 06348  DTrans: 00000 [70.103.254.2:4520]
  ENTITY IDENT    : 00:13:72:62:0e:17
  KEYCRC32        : 4088793660
  ENCDATA         : [IV 9aa4522419225026db41f077519c025b] 3 encrypted blocks


   Erx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: REQREQ       (Command)
         Flags: 00 STrans: 06348  DTrans: 00000 [70.103.254.2:4520]
       VERSION         : 1
       ENTITY IDENT    : 00:13:72:62:0e:17
       EXPIRATION      : 60

   ETx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: REGRESPONSE  (Response)
         Flags: 00 STrans: 13690  DTrans: 06348 [70.103.254.2:4520] (Final)
       CAUSE           : NOAUTH

Tx-Frame Retry[No] -- OSeqno: 000 ISeqno: 001 Type: ENCRYPT      (Command)
    Flags: 00 STrans: 13690  DTrans: 06348 [70.103.254.2:4520]
  ENCDATA         : [IV f22c5018b8861c341c519f0b41112668] 2 encrypted blocks


Rx-Frame Retry[No] -- OSeqno: 001 ISeqno: 001 Type: ACK          (Response)
    Flags: 00 STrans: 06348  DTrans: 13690 [70.103.254.2:4520] (Final)
Comments:By: Tim Ferguson (crashhd) 2008-07-31 17:21:46

Additionally I get the same problem when both PEERS use "all" for the permit and include options.

By: Leif Madsen (lmadsen) 2008-12-05 09:35:50.000-0600

Assigning this issue to myself as I will attempt to confirm the issue.

By: Leif Madsen (lmadsen) 2008-12-11 13:25:46.000-0600

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@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@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@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!

By: Leif Madsen (lmadsen) 2008-12-11 13:26:09.000-0600

Closing issue as this was a configuration issue.