How to configure a 2821 ISR to an asterisk PBX on a PRI line?

The phone number you get from your telco is it 7 digits, and Plan:ISDN, Type:Subscriber(local)? If not what is it?

*Sep 19 16:36:41.361 GMT: ISDN Se0/1/0:23 Q931: RX <- SETUP pd = 8 callref = 0x71B7 Thu Sep 19 17:02:15 2013: <191>553: Bearer Capability i = 0x9090A2 Thu Sep 19 17:02:15 2013: <191>554: Standard = CCITT Thu Sep 19 17:02:15 2013: <191>555: Transfer Capability = 3.1kHz Audio Thu Sep 19 17:02:15 2013: <191>556: Transfer Mode = Circuit Thu Sep 19 17:02:15 2013: <191>557: Transfer Rate = 64 kbit/s Thu Sep 19 17:02:15 2013: <191>558: Channel ID i = 0xA98381 Thu Sep 19 17:02:15 2013: <191>559: Exclusive, Channel 1 Thu Sep 19 17:02:15 2013: <191>560: Facility i = 0x9F8B0100A10F02010106072A8648CE1500040A0100 Thu Sep 19 17:02:15 2013: <191>561: Protocol Profile = Networking Extensions Thu Sep 19 17:02:15 2013: <191>562: 0xA10F02010106072A8648CE1500040A0100 Thu Sep 19 17:02:15 2013: <191>563: Component = Invoke component Thu Sep 19 17:02:15 2013: <191>564: Invoke Id = 1 Thu Sep 19 17:02:15 2013: <191>565: Operation = InformationFollowing (calling_name) Thu Sep 19 17:02:15 2013: <191>566: Name information in subsequent FACILITY message Thu Sep 19 17:02:15 2013: <191>567: Progress Ind i = 0x8283 - Origination address is non-ISDN Thu Sep 19 17:02:15 2013: <191>568: Thu Sep 19 17:02:15 2013: <191>569: Calling Party Number i = 0x2183, '3162471029' Thu Sep 19 17:02:15 2013: <191>570: Plan:ISDN, Type:National Thu Sep 19 17:02:15 2013: <191>571: Called Party Number i = 0xC1, '7942200' Thu Sep 19 17:02:15 2013: <191>572: Plan:ISDN, Type:Subscriber(local) Thu Sep 19 17:02:15 2013: <191>573: *Sep 19 16:36:41.361 GMT: ISDN Se0/1/0:23 Q931: Received SETUP callref = 0xF1B7 callID = 0x0001 switch = primary-ni interface = User

This is to expand on what SkyKing noted later. the context=from-pstn is an internal context and would be used if you had a FXO/FXS or E1/T1 card in your Asterisk PBX. The context=from-trunk would be used as in the situation where you are receiving the channel from an external SIP or IAX trunk. The actual PSTN connection is at the router and the call is passed through a SIP trunk to Asterisk

Actually they are identical, or an aliax (sic), direct from /etc/asterisk/extensions.conf

;-------------------------------------------------------------------------------
; from-trunk:
;
; Context is really just an aliax of from-pstn
;
[from-trunk]
include => from-pstn
;-------------------------------------------------------------------------------

;-------------------------------------------------------------------------------
; from-pstn:
;
; Entry context for calls from the outside world to hit FreePBX
[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => ext-did-post-custom
include => from-did-direct
include => ext-did-catchall ; THIS MUST COME AFTER ext-did
;-------------------------------------------------------------------------------

OK there were two problems. The first one was every time I unplugged and replugged the PRI line the first phone call would not send data, and you couldn’t receive a phone call until you successfully made an outgoing call. I notice this because every time I plug the old system back in the first phone call would not connect.

The 2nd problem was the dial-peer.

dial-peer voice 1 pots incoming called-number . direct-inward-dial port 0/1/0:23 forward-digits all ! dial-peer voice 2 voip destination-pattern ^794....$ session protocol sipv2 session target ipv4:10.1.10.7:5060 session transport udp dtmf-relay rtp-nte codec g711ulaw ! dial-peer voice 9001 pots preference 1 destination-pattern [2-9]...... port 0/1/0:23 forward-digits 7 prefix 316 ! The "preference 1" was the bit that got it working. That was in the config for the CUCM.

The only thing missing now it the caller ID. It was showing DOCTYPEHTMLPUBLIC on the phone. Looking at the logs from asterisk it was sending the correct caller ID.

[2013-09-23 17:03:44] VERBOSE[2258] chan_sip.c: <--- SIP read from UDP:10.1.10.252:58592 ---> INFO sip:[email protected]:5060 SIP/2.0 Via: SIP/2.0/UDP 10.1.10.252:5060;branch=z9hG4bK2D01 From: ;tag=168A353C-EB6 To: ;tag=as66bc8d3e Date: Mon, 23 Sep 2013 22:38:03 GMT Call-ID: [email protected] User-Agent: Cisco-SIPGateway/IOS-12.x Max-Forwards: 70 Timestamp: 1379975883 CSeq: 102 INFO Contact: Remote-Party-ID: "Wichita KS" ;party=calling;screen=no;privacy=off Content-Type: multipart/mixed;boundary=uniqueBoundary Mime-Version: 1.0 Content-Length: 391

Any ideas on that?

I needed to add

sip-ua
no remote-party-id

I was able to redo my dial-peers to allow all calls out, and accept all the phone numbers we own.

dial-peer voice 1 pots
incoming called-number .
direct-inward-dial
port 0/1/0:23
forward-digits all
!
dial-peer voice 2 voip
destination-pattern ^[2-9]…$
session protocol sipv2
session target ipv4:10.1.10.7:5060
session transport udp
dtmf-relay rtp-nte
codec g711ulaw
!
dial-peer voice 9001 pots
preference 1
destination-pattern .
port 0/1/0:23
forward-digits all

Now I would like to setup authentication between the 2821 and the asterisk server. I think I know how to do the asterisk side but not sure about the 2821 side.