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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -