Monitor DAHDI FXO

hello everybody,
I’m trying to implement something I thought was pretty simple.
I wanted to monitor the state of an FXO port, so I can display on a sip phone its status.
so I added to my extensions.conf a row like this:

exten 987, hint, DAHDI/1

the resulting behaviour is unexpected:
[i][Oct 13 15:09:47] DEBUG[29181][C-00000000]: sig_analog.c:1183 analog_call: Dialing ‘187’
[Oct 13 15:09:47] DEBUG[29181][C-00000000]: sig_analog.c:1267 analog_call: Deferring dialing…
[Oct 13 15:09:47] DEBUG[29105]: devicestate.c:344 _ast_device_state: No provider found, checking channel drivers for DAHDI - 1
[Oct 13 15:09:47] DEBUG[29151]: manager.c:4787 match_filter: Examining event:
Event: Newstate
Privilege: call,all
Channel: DAHDI/1-1
ChannelState: 3
ChannelStateDesc: Dialing
CallerIDNum: 187
CallerIDName:
ConnectedLineNum: 205
ConnectedLineName: Studio
Uniqueid: 1381669787.1

[Oct 13 15:09:47] DEBUG[29105]: devicestate.c:467 do_state_change: Changing state for DAHDI/1 - state 2 (In use)
[Oct 13 15:09:47] DEBUG[29105]: devicestate.c:442 devstate_event: device ‘DAHDI/1’ state ‘2’
[Oct 13 15:09:47] DEBUG[29151]: manager.c:4787 match_filter: Examining event:
Event: Dial
Privilege: call,all
SubEvent: Begin
Channel: SCCP/205-00000001
Destination: DAHDI/1-1
CallerIDNum: 205
CallerIDName: Studio
ConnectedLineNum:
ConnectedLineName:
UniqueID: 1381669786.0
DestUniqueID: 1381669787.1
Dialstring: 1/187

[Oct 13 15:09:47] DEBUG[29142]: devicestate.c:666 handle_devstate_change: Processing device state change for ‘DAHDI/1’
[Oct 13 15:09:47] DEBUG[29142]: devicestate.c:619 process_collection: Aggregate devstate result is ‘Invalid’ for ‘DAHDI/1’
[Oct 13 15:09:47] DEBUG[29142]: devicestate.c:635 process_collection: Aggregate state for device ‘DAHDI/1’ has not changed from ‘Invalid’
– Called dahdi/1/187

[/i]
this behaviour sounds me strange, so I decided to take a look to the code; in chan_dahdi.c I found this function:

[i]static int dahdi_devicestate(const char *data)
{
#if defined(HAVE_PRI)
const char *device;
unsigned span;
int res;

    device = data;

    if (*device != 'I') {
            /* The request is not for an ISDN span device. */
            return AST_DEVICE_UNKNOWN;
    }
    res = sscanf(device, "I%30u", &span);
    if (res != 1 || !span || NUM_SPANS < span) {
            /* Bad format for ISDN span device name. */
            return AST_DEVICE_UNKNOWN;
    }
    device = strchr(device, '/');
    if (!device) {
            /* Bad format for ISDN span device name. */
            return AST_DEVICE_UNKNOWN;
    }
    device = strchr(device, '/');
    if (!device) {
            /* Bad format for ISDN span device name. */
            return AST_DEVICE_UNKNOWN;
    }

    /*
     * Since there are currently no other span devstate's defined,
     * it must be congestion.
     */

#if defined(THRESHOLD_DEVSTATE_PLACEHOLDER)
++device;
if (!strcmp(device, “congestion”))
#endif /* defined(THRESHOLD_DEVSTATE_PLACEHOLDER) /
{
return pris[span - 1].pri.congestion_devstate;
}
#if defined(THRESHOLD_DEVSTATE_PLACEHOLDER)
else if (!strcmp(device, “threshold”)) {
return pris[span - 1].pri.threshold_devstate;
}
return AST_DEVICE_UNKNOWN;
#endif /
defined(THRESHOLD_DEVSTATE_PLACEHOLDER) /
#else
return AST_DEVICE_UNKNOWN;
#endif /
defined(HAVE_PRI) */
}
[/i]
It seems me to read, that unless dahdi device is an ISDN device, device state is not implemented…
Do I read it correct?
If so is it possible to monitor from a sip device the status of an fxo port?

My Asterisk version is 11.5.0 and my dahdi version is 2.7.0.1; im using a Sangoma FXO card with wanpipe version 7.0.5

any help would be appreciated.
Alessandro