We're using the HDV-T1-24E card to do the same to Meridian PBX Opt 61 and 81. The trick here is that the PBX can only do "slave side(user side)" ISDN in the only mode we found compatible at the rev of X11 code on the PBX we run. We're running AT&T 5ESS switchtype on the PBX.
The magic comes that the 3640 (IOS) doesn't support "master side (network side)" ISDN in the 5ESS model (directly).
In your config do this:
interface Serial2/0:23
no ip address
no logging event link-status
isdn switch-type primary-5ess
isdn incoming-voice voice
no isdn T309-enable
isdn T321 0
isdn network <-- this is the magic
<-- command.
My local team is trying to get the business case to finish the official testing of 5ESS/network side.
#show isdn status
Global ISDN Switchtype = primary-5ess
ISDN Serial2/0:23 interface
******* Network side configuration *******
dsl 0, interface ISDN Switchtype = primary-5ess
Layer 1 Status:
ACTIVE
Layer 2 Status:
TEI = 0, Ces = 1, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED
Layer 3 Status:
0 Active Layer 3 Call(s)
Active dsl 0 CCBs = 0
The Free Channel Mask: 0x807FFFFF
Total Allocated ISDN CCBs = 0
The only other gotcha is that when you do a "wr mem" or "copy run start" the "isdn network" command doesn't get saved. The way around this is to load your config from a tftp server on boot and insert this command into the flat file on that server.