문제

I am developing a C#.NET Windows Application using Asterisk.NET Library. In my application NewState Event is triggered even when I originate the call (when it rings the source). I want only incoming calls to be shown as "Somebody is calling". Now it shows even for self-ringing calls (when originating),,, How can I check and avoid Originated calls from Newstate Event. Please Help..

도움이 되었습니까?

해결책

Simplest way:

1) create originate with

Channel: Local/1234@dialout

and

Set: id=1
Set: otherinfo="nice call"

2) create dialplan like this

[dialout]
exten =>_X.,1,UserEvent(CatchMe,number: ${EXTEN}, db_id: ${id}, otherinfo: ${otherinfo})
exten =>_X.,2,Dial(SIP/${EXTEN}@outtrunk,,)

Same will work for inbound!!!

But also you can check other events, not NewState(which is VERY common).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top