[from-signalwire]
; Inbound calls from SignalWire arrive here, ${EXTEN} = the DID that was dialed
exten => _X.,1,NoOp(Incoming call for ${EXTEN} from ${CALLERID(num)})
 same => n,AGI(/var/www/pbx-app/agi/inbound-router.php,${EXTEN},${CALLERID(num)})
 same => n,Hangup()

[from-internal]
; Registered extensions dial out through here (this is the context set on
; each ps_endpoints row created by ExtensionService)
;
; Two patterns: _X. matches plain-digit dialing (e.g. "101" or "17043905584"),
; _+X. matches numbers dialed with a leading + (common when a softphone dials
; a contact stored in international/E.164 format, e.g. "+17043905584") —
; without this second pattern, Asterisk rejects such calls with "extension
; not found" since the leading + isn't a digit.
exten => _X.,1,NoOp(Outbound call from ${CALLERID(num)} to ${EXTEN})
 same => n,AGI(/var/www/pbx-app/agi/outbound-router.php,${EXTEN},${CALLERID(num)})
 same => n,Hangup()

exten => _+X.,1,NoOp(Outbound call from ${CALLERID(num)} to ${EXTEN})
 same => n,AGI(/var/www/pbx-app/agi/outbound-router.php,${EXTEN},${CALLERID(num)})
 same => n,Hangup()
