c# - Method called by event not in scope -
i setting system accepts call through call server (asterisk) , triggers event
_manager.newstate += new newstateeventhandler(manager_newstateevent);
asteriskmanager.cs
here manager_newstateevent
private void manager_newstateevent(object sender, newstateevent e) { managerstate = e.channelstatedesc; if (onphonestatechange != null) onphonestatechange(e); console.writeline("new state : " + e.channelstatedesc); switch (e.channelstatedesc) { case "down": case "offhook": case "dialing": case "ring": case "ringing": case "up": case "busy": break; } }
form1.cs
void _manager_onphonestatechange(asterisk.net.manager.event.newstateevent e) { statelabel.text = e.channelstatedesc; this.refresh(); }
_manager.newstate event gets called when call incoming. inside of c# form attempting change label based on response get, label not updating.
(i have tried force method '_manager_onphonestatechange' through button click , works fine)
Comments
Post a Comment