Router & Trunk help

Trying to use a Cisco 2851 ISR to be the PRI-to-SIP interface for my new FreePBX installation. Could someone who has done this please take a look at my setup and tell me if something is obviously wrong? I’ve been trying to follow the instructions at Basic setup from freepbx to cisco 28XX as voicegateway with PRI and at https://serverfault.com/questions/533858/how-to-configure-a-2821-isr-to-an-asterisk-pbx-on-a-pri-line Here is the router config:

Current configuration : 4112 bytes
!
! Last configuration change at 20:17:47 GMT Wed Sep 13 2017 by XX_admin
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname phonerouter
!
boot-start-marker
boot system flash:c2800nm-adventerprisek9_sna-mz.151-3.T4.bin
boot-end-marker
!
!
logging buffered 51200 warnings
!
no aaa new-model
!
clock timezone GMT -4 0
!
dot11 syslog
dot11 phone
ip source-route
!
!
ip cef
!
!
ip domain name xxx.local
ip name-server 192.168.0.20
ip name-server 192.168.0.21
no ipv6 cef
!
multilink bundle-name authenticated
!
!
voice rtp send-recv
!
voice service voip
 allow-connections h323 to h323
 allow-connections h323 to sip
 allow-connections sip to h323
 allow-connections sip to sip
 redirect ip2ip
 signaling forward unconditional
sip
  bind control source-interface GigabitEthernet0/1
  bind media source-interface GigabitEthernet0/1
!
!
voice-card 0
 dspfarm
!
crypto pki token default removal timeout 0
!
crypto pki trustpoint TP-self-signed-838144
 enrollment selfsigned
 subject-name cn=IOS-Self-Signed-Certificate-838144
 revocation-check none
!
!
crypto pki certificate chain TP-self-signed-838144
 certificate self-signed 01
  30820227 30820190 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
  ...
  F70D0101 04050003 8181004E 23883DD9 AA8320E4 5BDB9470 4E4B3BEC DAC313D9
  7835005D 37353FBC 77DC5CB9 7AE15796 2A05EC40 8F200F3C DF09F22D 76E49294
  A3A55790 2E150E7B 35EBAE4E 214BFAC1 B9EB0170 2BA26E0A 03C0E10F 420CA910
  2213413E 0D94ED34 BD8D8F5E 642E02C1 52120FFD B9BCD955 BD1BD5C6 CC8A601B
  5B05103C F71325AD B48AA6
    quit
!
!
license udi pid CISCO2851 sn FTX124XXX4Q
username XX_admin privilege 15 secret 5 $1$XGR3$zjan13hpDseun3DCYRonw0
!
redundancy
!
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 192.168.0.223 255.255.255.0
 duplex auto
 speed auto
!
interface Serial0/0/0
 no ip address
!
!
ip forward-protocol nd
ip http server
ip http access-class 23
ip http authentication local
ip http secure-server
ip http timeout-policy idle 60 life 86400 requests 10000
!
!
logging esm config
access-list 23 permit 192.168.0.0
!
!
control-plane
!
!
mgcp profile default
!
!
dial-peer voice 1 voip
 destination-pattern ^[2-9]......$
 session protocol sipv2
 session target ipv4:192.168.0.226:5160
 session transport udp
 dtmf-relay rtp-nte
 codec g711ulaw
!
!
gateway
 timer receive-rtp 1200
!
sip-ua
 no remote-party-id
 retry invite 3
 retry response 3
 retry bye 3
 retry cancel 3
 timers trying 1000
 sip-server ipv4:192.168.0.226
!
!
banner exec ^CC
 ---------------------------------------------------------
^C
banner login ^CC
Telephone traffic ONLY
---------------------------------------------------------
^C
!
line con 0
 login local
line aux 0
line vty 0 4
 access-class 23 in
 privilege level 15
 login local
 transport input telnet ssh
line vty 5 15
 access-class 23 in
 privilege level 15
 login local
 transport input telnet ssh
!
scheduler allocate 20000 1000
end

This is my trunk setup in FreePBX:
Outgoing

Trunk name: PRI
host=192.168.0.223
type=friend
context=from-internal
qualify=yes
nat=no
insecure=port,invite
dtmfmode=rfc2833
disallow=all
allow=ulaw

Incoming

User context: from-internal
type=friend
context=from-trunk
host=192.168.0.223
dtmfmode=rfc2833
disallow=all
allow=ulaw&alaw
nat=no
canreinvite=no
qualify=yes

SIP SHOW PEERS shows both “PRI” and “from-internal” as "OK"
SIP SHOW REGISTRY shows 0 SIP registrations

In FreePBX, Chan_SIP is on 5160 and PJ_SIP is on 5060. I tried connecting on both ports to no avail.

There is no need for both Outgoing and Incoming settings, everything should be in the Outgoing section. On top of that, the config is messed up in this format.

context <-- For incoming calls. Does not apply to Outbound.calls
insecure <-- Also for incoming calls. Does not apply to Outbound calls

So right now, all your incoming calls would be forced to AUTH with the system in order to make them. You generally don’t want your gateway to auth every inbound call to the server.

You can pretty much remove everything in the inbound section and you’ll be fine. Outside of that, debugs are going to be needed to actually see what is happening.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.