public override int OnOptionsEvent(OptionsEvent e) { short code = e.getCode(); tsip_options_event_type_t type = e.getType(); OptionsSession session = e.getSession(); SipMessage message = e.getSipMessage(); if (message != null) { Console.WriteLine("call-id={0}", message.getSipHeaderValue("call-id")); //byte[] bytes = message.getContent(); } switch (type) { case tsip_options_event_type_t.tsip_ao_options: String rport = message.getSipHeaderParamValue("v", "rport"); String received_ip = message.getSipHeaderParamValue("v", "received"); if (rport == null) { /* Ericsson SDS */ rport = message.getSipHeaderParamValue("v", "received_port_ext"); } Console.WriteLine("Via(rport, received)=({0}, {1})", rport, received_ip); break; case tsip_options_event_type_t.tsip_i_options: break; } Console.WriteLine("OnRegistrationChanged() ==> {0}:{1}", code, e.getPhrase()); return(0); }
public OptionsWindow() { this.InitializeComponent(); ok = new OptionsEvent(); ok.value = OptionsWindow.OK; cancel = new OptionsEvent(); cancel.value = OptionsWindow.CANCEL; register = new OptionsEvent(); register.value = OptionsWindow.REGISTER; Closing += OnWindowClosing; setData(); }
/// <summary> /// Option events /// </summary> /// <param name="e"></param> /// <returns></returns> public override int OnOptionsEvent(OptionsEvent e) { return(0); }