0

I am trying to use ExtensionState action to retrieve the status of a PSTN trunk via Asterisk AMI:

Action: ExtensionState
Context: trunks-hintcontext
Exten: pstn1

And the response I got is:

Response: Success Message: Extension Status Exten: pstn1 Context: trunks-hintcontext Hint: DAHDI/1 Status: 4

According the AMI documentation, status=4 means "unavailable" but the trunk should be "Idle" as it is available for user to dial and receiving calls.

No matter how I use the pstn trunk, dialing or answering. The Status value is always 1 (In-Use) or 4 (Unavailable).

I expect the status to be "Idle", "Unavailable", "In-Use".

Is there any other AMI action that allow me to retrieve the status of PSTN trunks?

Chau Chee Yang
  • 18,422
  • 16
  • 68
  • 132

2 Answers2

0

what's the Asterisk version? You should also be able to get channels status with DAHDIShowChannels or CoreShowChannels and basing on this info determine if trunks you are monitoring are busy or not.

shoen
  • 11,845
  • 4
  • 22
  • 27
0

The best way to have this information is to implement specific information method for each type of trunk you use. You can use Command action to get SIP information via "sip show peer " and "dahdi channels show" for TDM Dahdi hardware.

There are no other reliable way to get this kind of information with Asterisk.

guax
  • 383
  • 3
  • 7