Soft Hangup Issue

I’m trying to upgrade a production system using Asterisk version 1.6.2.13 to version 11. The production system’s hardware is aging out and replacement hardware has been procured and I’ve installed the FreePBX distro 6.12.65 on it. I then setup a lab environment mimicking the productions systems as best I could. Upon testing I discovered an issue with Soft Hangup not identifying the resource the same way.

Configuration on current system:
/etc/asterisk/extensions_custom.conf

[custom-szeto-17]
exten => 17,1,MeetMe(logger-17,d1Fq)
exten => 17,2,MeetMe(logger-17,d1Fq)
exten => h,1,SoftHangup(DAHDI/25-1)
exten => h,n,Hangup

[custom-szeto-oper]
exten => s,1,Dial(local/${CALLERID(dnid):-2}@custom-szeto-oper/nj)
exten => 17,1,Dial(DAHDI/25/1000002017,,G(custom-szeto-17^${EXTEN}^1))

/etc/asterisk/dahdi-channels.conf

; Span 2: TE8/0/2 "T8XXP (PCI) Card 0 Span 2" B8ZS/ESF
group=0,12
context=from-internal
switchtype = national
signalling = pri_net
group=17
channel => 25

What’s supposed to happen is that when the call is hung up the channel on the PRI is hung up as well via Soft Hangup function referencing the channel number on the PRI. It seems that in newer versions of Asterisk the resource is referenced dynamically (the “g” example below changes with each call made).

Old Asterisk: DAHDI/25-1
New Asterisk: DAHDI/i1/1000002017-g

How do I grab this channel resource name so I can hang up this leg of the call when it’s dynamically named?