sigstatus.txt 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FreeTDM can both notify and set signaling status changes in the different protocols thru a unified interface. More
  2. specific details on the C data types and function prototypes are found in freetdm.h
  3. The API provides the following functions and data types to do it:
  4. The signaling status in any channel/span is represented thru ftdm_signaling_status_t
  5. /* The signaling link is down (no d-chans up in the span/group, MFC-R2 bit pattern unidentified) */
  6. FTDM_SIG_STATE_DOWN,
  7. /* The signaling link is suspended (MFC-R2 bit pattern blocked, PRI maintenance, ss7 blocked?) */
  8. FTDM_SIG_STATE_SUSPENDED,
  9. /* The signaling link is ready and calls can be placed (ie: d-chan up, MFC-R2 both rx and tx in IDLE) */
  10. FTDM_SIG_STATE_UP,
  11. /* Invalid status */
  12. FTDM_SIG_STATE_INVALID
  13. Changes in the signaling status are notified to the user using the standard callback notification function provided
  14. during configuration using the sigevent type FTDM_SIGEVENT_SIGSTATUS_CHANGED which is sent when the line status changes.
  15. On startup the signalling status default is FTDM_SIG_STATE_DOWN, and no notification is provided until the state change,
  16. so applications must assume the status is down unless told otherwise.
  17. When ftdm_span_start is called, the signaling stack takes care of attempting to bring the status to UP
  18. but it will ultimately depend on the other side too.
  19. == Setting the signaling status ==
  20. Users can set the signaling status on a given channel/span thru FreeTDM the following API functions:
  21. ftdm_channel_set_sig_status
  22. ftdm_span_set_sig_status
  23. If the user calls ftdm_channel_set_sig_status(chan, FTDM_SIG_STATE_SUSPENDED), the signaling stack will try to set
  24. the status of the line to the one requested, if successful, it will result in a SIGEVENT_SIGSTATUS_CHANGED notification
  25. being sent with status FTDM_SIG_STATE_SUSPENDED.
  26. ** MFC-R2 Signaling Notes **
  27. For MFC-R2, calling ftdm_span_start() results in setting the tx CAS bits to IDLE. However, if the rx bits are in BLOCKED state
  28. the signaling status will be reported as SUSPENDED.
  29. If the user calls ftdm_channel_set_sig_status(chan, SUSPENDED), the tx CAS bits will be set to BLOCKED and, if, the current rx bits
  30. are IDLE then a SIGEVENT_SIGSTATUS_CHANGED with state SUSPENDED will be sent. If the rx bits are already in blocked then no further
  31. SIGEVENT_SIGSTATUS_CHANGED notification is needed (because it was already sent when the rx bits were initially detected as BLOCKED).
  32. If the user calls ftdm_channel_set_sig_status(chan, UP), the tx CAS bits will be set to IDLE and, if, the current rx bits
  33. are IDLE, then SIGEVENT_SIGSTATUS_CHANGED with state UP will be sent. If the rx bits are BLOCKED, then no notification is
  34. sent at all until the rx bits change.
  35. Bottom line is, for MFC-R2, SIGEVENT_SIGSTATUS_CHANGED UP is only sent to the user when both the rx and tx bits are in IDLE, and
  36. SIGEVENT_SIGSTATUS_CHANGED SUSPENDED is only sent to the user when any of the rx or tx bits are in BLOCKED.
  37. == Getting the signaling status ==
  38. Users can get the signaling status on a given channel/span thru FreeTDM the following API functions:
  39. ftdm_channel_get_sig_status
  40. ftdm_span_get_sig_status
  41. The line status returned should be the same as the last time a SIGEVENT_SIGSTATUS_CHANGED was reported.