Asterisk AMI getting call direction

I am wondering if there is a way to determine based on AMI events which direction a call is coming from, basically inbound or outbound? The only way I can see it done is based on the context and channel name if I parse them and look for the context that starts with from-trunk and a channel name with outbound in the name but that is all dependent on how I named the trunks. I am sure there is a better way to do this I am just not piecing together correctly.

If you can get the channel variables, then incoming calls should have a DIRECTION=INBOUND variable.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.