亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ua_appprobe.cpp

?? 改進后的SIP SERVICE API
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
             content.expires.delta_seconds == 0) {
            VB_unsubscribe = 1;
          }
        } else {
          VP_expires_header = NULL;
          if (G_trace >= 1) {
            fprintf(stderr, "== No Expires header.\n", 
                    VP_expires_header -> structured_header ->
                    content.expires.delta_seconds);
          }
        }
	  
        // Send a 200 OK response 
        VP_Message_rsp = sip_msg_new_response(200,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL);
	    
	  
        // Expires header is mandatory for a reply to a 
        // subscription
        if(!VP_expires_header) {
          //	  if(!VB_unsubscribe) {
          VP_expires_header = sip_msg_new_expires_header(10, NULL, NULL);
          // }
          sip_msg_insert_header(VP_Message_rsp -> headers,
                                VP_expires_header,
                                -1);
          sip_msg_free_header(VP_expires_header);
          if (G_trace >= 1) {
            fprintf(stderr, "== Adding Expires: 10 to 200 OK reponse\n");
          }
	    
        } else {
          sip_msg_insert_header(VP_Message_rsp -> headers,
                                VP_expires_header,
                                -1);
        }
	  
        if (G_trace >= 1) {
          fprintf(stderr, "== Sending 200 OK for SUBSCRIBE\n");
        }
        L_response = buildRsp(VP_RecvEvent,VP_Message_rsp);
	  
	  
        if((status = getProbe().send(P_service,
                                     P_session,
                                     *L_response)) != SIP_SUCCESS) {
	    
          fprintf(stderr, 
                  "== Error %d returned by getProbe().send\n", status);
        }
	  
        // Send a notify
        if((!G_snn_option) || (VB_unsubscribe))
          {
            sip_msg_message_t * VP_msg_notify;
            char value[20];
	      
            sleep(1);
	    
            if(!VB_unsubscribe) {
              if (G_trace >= 1) {
                fprintf(stderr, "== Sending NOTIFY\n");
              }
              sprintf(value, "status_%d");
            } else {

              if (G_trace >= 1) {
                fprintf(stderr, "== Sending NOTIFY terminated\n");
              }
              if(G_destroy_on_unsubscribe) {
                if (G_trace >= 1) {
                  fprintf(stderr, 
                          "== Destroying Session (-std option enabled)\n");
                }
                getProbe().destroySession(P_session,SIP_CAUSE_NORMAL);
                return 1;
              }

              if(G_Buggy_terminated) {
                sprintf(value, "state_not_terminated");
              } else {
                sprintf(value, "terminated");
              }
            }
	    
            VP_msg_notify = sip_msg_new_request
              (SIP_MSG_NOTIFY,
               sip_msg_new_empty_uri(),
               NULL, NULL, NULL, NULL, NULL, NULL);
	    
            if(!VP_msg_notify) {
              fprintf(stderr, "== Error creating new NOTIFY message\n");
            }
	    
            VP_subscription_state = sip_msg_new_subscription_state_header
              (value, NULL, -1, -1, NULL, NULL);	    
            sip_msg_insert_header(VP_msg_notify -> headers,
                                  VP_subscription_state,
                                  -1);
            sip_msg_free_header(VP_subscription_state);
            L_response = buildReqInDialog(VP_RecvEvent,VP_msg_notify);
	    
            getProbe().send(P_service,
                            P_session,
                            *L_response);
          }
	  
      } break;
	
      case SIP_MSG_NOTIFY: {
	
        if (G_trace >= 1) {
          std::cerr << "== Received a NOTIFY Request"<<std::endl;
        }
        VB_message_processed = 1;
		
		// Send a 200 OK response 
        VP_Message_rsp = sip_msg_new_response(200,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL,
                                              NULL);
		 if (G_trace >= 1) {
          fprintf(stderr, "== Sending 200 OK for NOTIFY\n");
        }
        L_response = buildRsp(VP_RecvEvent,VP_Message_rsp);
	  
	  
        if((status = getProbe().send(P_service,
                                     P_session,
                                     *L_response)) != SIP_SUCCESS) {
	    
          fprintf(stderr, 
                  "== Error %d returned by getProbe().send\n", status);
        }

      } break;
      } // switch
    } else {
      // This is a reply
      sip_msg_header_t * cseq_header  = VP_Message_recv -> headers -> 
        vector[sip_msg_find_and_parse_header
               (VP_Message_recv -> headers,
                SIP_MSG_HDR_CSEQ,
                0, NULL)];

      if(cseq_header -> structured_header -> content.cseq.method 
         == SIP_MSG_SUBSCRIBE) {
        VB_message_processed = 1;
        if (G_trace >= 1) {
          fprintf(stderr, "== %d %s for SUBSCRIBE transaction received\n",
                  VP_Message_recv -> start_line.response.status_code,
                  VP_Message_recv -> start_line.response.reason_phrase);
			}
			
          if (G_subscribe && G_new_call)
            {
              UA_Session&   L_session   
                = dynamic_cast <UA_Session&> (P_session);
              FF_SipMessageContainer& L_RecvEvent = 
                dynamic_cast <FF_SipMessageContainer&>(P_message);
              
              L_session.setState(UA_Session::CALL_CONFIRMED);
              L_session.storeProviderId(L_RecvEvent);
              L_session.setService(P_service);
              callQueue.push_back(&L_session);
            }  
			 
      } 
      if(cseq_header -> structured_header -> content.cseq.method 
         == SIP_MSG_NOTIFY) {
        VB_message_processed = 1;
        if (G_trace >= 1) {
          fprintf(stderr, "== %d %s for NOTIFY transaction received\n",
                  VP_Message_recv -> start_line.response.status_code,
                  VP_Message_recv -> start_line.response.reason_phrase);
        }
      } 

    }
  }
  catch (std::exception& e)
    {
      std::cerr << "== UASAppProbe::ProcessSubscriptionMessage, exception ["
                <<e.what()<<"]"<<std::endl;
      return -1;
    }

  return VB_message_processed;
}

SIP_Status UA_AppProbe::receive (SIP_Service& P_service, 
                                 SIP_Session& P_session, 
                                 SIP_Event&   P_message) throw ()
{
  // Declarations
  // ------------   
  SIP_Event*		         L_response = 0;
  sip_msg_message_t*         L_Message_recv = 0;
  sip_msg_message_t*         L_Message_rsp = 0;
  sip_msg_error_t            L_error;
  bool                       L_isStatelessMessage = false;

  // will be automatically cleaned at the end of the method
  std::auto_ptr<SIP_Event>   L_message (&P_message); 
try 
	{
    
    FF_SipMessageContainer& L_RecvEvent = 
      dynamic_cast <FF_SipMessageContainer&>(P_message);
    
    if(L_RecvEvent.getCallId().getProviderIdentifier() 
       == SIP_SRVC_NO_CALL) {
      L_isStatelessMessage = true;
    }
    
    if (G_trace >= 1) {
      fprintf(stderr, 
              "== ----------------------------------\n"
              "== %s%s received for session 0x%p:\n"
              "==   Type            = %d,\n"
              "==   Probe Name      = %s,\n"
              "==   Probe copy Name = %s,\n"
              "==   Service name    = %s,\n"
              "==   Call-ID         = %d,\n"
              "==   Dialog-ID       = %d,\n"
              "==   Trans-ID        = %d,\n"
              "==   Sub-ID          = %d,\n"
              "==   LP-ID           = %d.\n",
              (L_isStatelessMessage) ? "Call-stateless " : "",
              (L_RecvEvent.getType() == 1) ? "SIP message" : "Control-event",
              (void *)&P_session,
              L_RecvEvent.getType(),
              getName().c_str(),
              getCopyName().c_str(),
              P_service.getName().c_str(),
              L_RecvEvent.getCallId().getProviderIdentifier(),
              L_RecvEvent.getDialogId().getProviderIdentifier(),
              L_RecvEvent.getTransactionId().
              getProviderIdentifier(),
              L_RecvEvent.getSubscriptionId().
              getProviderIdentifier(),
              L_RecvEvent.getLPId());      
    }
    
    if (L_RecvEvent.getType() ==  2)
      {
        if (!G_silent) { 
          printf("Control event received : %s.\n",
                 VP_control_event_to_string(L_RecvEvent.getEvent()));
        }

        if (G_trace >= 1)
          fprintf(stderr, 
                  "== UA_AppProbe::receive ctrl message [%s] received\n",
                  VP_control_event_to_string(L_RecvEvent.getEvent()));
        if(   (L_RecvEvent.getEvent()==FF_SESS_MUST_BE_DELETED) 
              || (L_RecvEvent.getEvent()==FF_SESS_MUST_BE_DELETED_ON_ERR)){
          if (G_trace >= 1) {
	  
            fprintf(stderr, 
                    "== %s => calling getProbe().destroySession...\n",
                    VP_control_event_to_string(L_RecvEvent.getEvent()));
          }

          getProbe().destroySession(P_session,SIP_CAUSE_NORMAL);
        }
        return SIP_SUCCESS;
	  }

    L_Message_recv = L_RecvEvent.getPayload();
    
    if (L_RecvEvent.getPayload() == 0)
      {
        if (G_trace >= 1)
          std::cerr <<"== UA_AppProbe::receive there is no SIP PDU !!" 
                    << std::endl;
        return SIP_INTERNAL_FAILURE;
      }

    print_message_info(L_Message_recv, "Receiving");
    
    if(ProcessSubscriptionMessage(P_service, 
                                  P_session, 
                                  P_message) >= 0) {
      return SIP_SUCCESS;      
    }
    
    UA_Session&   L_session   = dynamic_cast <UA_Session&> (P_session);
		
    // Message analysis
    // ----------------
    switch (L_session.getState())	
		{
		case UA_Session::CALL_INITIAL:
			{
		       printf("in UA_Session::CALL_INITIAL!!\n");
			if (L_Message_recv->kind!=SIP_MSG_REQUEST)
				{
				throw std::runtime_error
					("UA_AppProbe::receive unexpected response");
				}

			switch(L_Message_recv->start_line.request.method) 
				{
				case SIP_MSG_INVITE: 
					{
						printf("in receive SIP_MSG_INVITE!!\n");
					sip_msg_body_t * L_body = sip_msg_new_body_copy
					(L_Message_recv->body,
					SIP_MSG_PHYSICAL_COPY, 
					0);
		            
					if (G_trace >= 1)
					std::cerr << "== Received a INVITE Request"<<std::endl;
		                   
					switch (G_reply)
						{
						case 0:
						case 1:
							if (!L_isStatelessMessage) {
							// Send a RINGING response 
							L_Message_rsp = sip_msg_new_response(180,
																NULL,
																NULL,
																NULL,
																NULL,
																NULL,
																&L_error);
							L_response = buildRsp(L_RecvEvent,L_Message_rsp);
							getProbe().send(P_service,P_session,*L_response);
							}
						case 2:
							{
			                  
							// Send a 200 OK response 
							L_Message_rsp = sip_msg_new_response(200,
																NULL,
																NULL,
																NULL,
																L_body,
																NULL,
																&L_error);

							sip_msg_free_body(L_body);
			                  
							// If the application (or its backup for lazy High-Availability
							// purpose) plans to receive stateless messages, we need to
							// specify the username in the contact header of the first 200 OK
							// response. 
							//
							// This username will be used in the backup application to find
							// the LP when a stateless message will arrive.
							if(G_stateless_messages) {
			                    
								if(sip_msg_insert_header
								(L_Message_rsp -> headers, 
									sip_msg_new_contact_header
									(sip_msg_new_sip_url(G_service_username, 
														(char *)""))) != SIP_NORMAL){
								std::cerr << "==  Unable to insert the contact header"<<std::endl;
								break ;
								}
							}
			                  
							L_response = buildRsp(L_RecvEvent,L_Message_rsp);
							getProbe().send(P_service,P_session,*L_response);
							L_session.setState(UA_Session::CALL_SUCCESS);
							}
							break;
							
						case 3: 
                          {
							// Send a 302 OK response 
							L_Message_rsp = sip_msg_new_response
                              (302,
                               L_Message_recv->start_line.request.version,
                               NULL,
                               NULL,
                               L_body,
                               NULL,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久久久久| 欧美色欧美亚洲另类二区| 亚洲精品高清视频在线观看| 日韩久久久久久| 91视频一区二区| 国产在线播放一区二区三区| 亚洲国产视频a| 国产精品免费视频一区| 欧美一区二区三区不卡| 色吧成人激情小说| 国产69精品久久777的优势| 日本亚洲视频在线| 亚洲一区二区三区四区五区黄| 久久久久久免费| 91精品国产高清一区二区三区| 一本大道久久a久久综合| 国产91在线观看丝袜| 久久99精品久久久| 日韩精品电影在线| 亚洲网友自拍偷拍| 亚洲你懂的在线视频| 国产精品私人影院| 久久精品这里都是精品| 欧美xxxxxxxxx| 欧美一区二区三区在线看| 在线精品视频一区二区三四| 一本一道综合狠狠老| 99re视频这里只有精品| 成人精品视频一区二区三区尤物| 国产一区二区三区免费在线观看| 日本免费在线视频不卡一不卡二| 亚洲成av人片www| 亚洲国产精品久久人人爱| 亚洲精品欧美二区三区中文字幕| 国产精品美女一区二区三区| 日本一区二区免费在线| 国产欧美精品日韩区二区麻豆天美| 精品国产免费人成在线观看| 精品日韩一区二区三区免费视频| 日韩一区国产二区欧美三区| 日韩欧美第一区| 欧美成人福利视频| 久久这里只有精品首页| 久久女同性恋中文字幕| 欧美国产一区二区在线观看| 中文字幕av在线一区二区三区| 国产嫩草影院久久久久| 国产精品丝袜在线| 亚洲精品精品亚洲| 亚洲国产成人porn| 另类的小说在线视频另类成人小视频在线| 日韩中文字幕91| 久久99精品久久只有精品| 精品一区二区免费| 成人午夜电影小说| 色老综合老女人久久久| 欧美日韩不卡一区二区| 日韩欧美国产精品一区| 国产偷v国产偷v亚洲高清| 国产精品二三区| 亚洲主播在线观看| 三级欧美韩日大片在线看| 韩国欧美国产1区| 成人免费视频视频在线观看免费| 成人av第一页| 欧美精品xxxxbbbb| 久久嫩草精品久久久久| 亚洲人123区| 久久99久久精品欧美| 成人午夜看片网址| 欧美日韩国产一级| 亚洲精品一区二区在线观看| 亚洲天堂久久久久久久| 日本视频一区二区| 99久久久国产精品| 日韩一区二区三区观看| 中文字幕欧美区| 日韩国产欧美视频| 成人综合婷婷国产精品久久免费| 在线亚洲免费视频| 精品电影一区二区| 洋洋av久久久久久久一区| 另类综合日韩欧美亚洲| 91亚洲国产成人精品一区二区三| 欧美高清视频在线高清观看mv色露露十八 | 久久综合综合久久综合| 成人一区二区三区中文字幕| 欧美日韩亚洲综合| 中文字幕高清不卡| 美女脱光内衣内裤视频久久网站| 成人网在线播放| 日韩一区二区三区四区五区六区| 中文字幕一区二区三区在线播放 | 亚洲区小说区图片区qvod| 老司机精品视频一区二区三区| 97久久精品人人做人人爽50路| 欧美一区二区三级| 悠悠色在线精品| 国产精品影音先锋| 51精品视频一区二区三区| 亚洲欧洲国产专区| 韩国午夜理伦三级不卡影院| 欧美精品自拍偷拍| 亚洲免费观看高清完整| 国产福利一区在线观看| 91精品国产综合久久久久| 亚洲综合激情网| av亚洲精华国产精华精华| wwwwww.欧美系列| 免费看日韩a级影片| 欧美视频在线一区二区三区| 国产精品你懂的在线欣赏| 国产精品亚洲一区二区三区在线| 欧美一级欧美一级在线播放| 亚洲综合激情小说| 91麻豆国产精品久久| 中文一区二区在线观看| 黄色小说综合网站| 日韩午夜在线观看| 日韩黄色免费网站| 欧美日产在线观看| 亚洲超碰精品一区二区| 在线亚洲欧美专区二区| 中文字幕日韩av资源站| 国产91精品免费| 国产亚洲污的网站| 国产精品综合一区二区| 久久久久综合网| 国产乱色国产精品免费视频| 欧美一区二区观看视频| 美国一区二区三区在线播放| 欧美精品一卡二卡| 男人操女人的视频在线观看欧美| 欧美日韩欧美一区二区| 爽好久久久欧美精品| 3d成人h动漫网站入口| 日韩二区在线观看| 日韩欧美中文字幕精品| 美国毛片一区二区| 欧美精品一区二区蜜臀亚洲| 极品销魂美女一区二区三区| 久久综合九色综合欧美亚洲| 韩国av一区二区| 国产农村妇女毛片精品久久麻豆| 国产精品白丝av| 中文字幕成人av| 色狠狠色狠狠综合| 日韩精品成人一区二区在线| 日韩欧美一级二级三级| 国产精品中文字幕一区二区三区| 国产午夜精品福利| 91色九色蝌蚪| 亚洲成a人在线观看| 欧美一区二区三区思思人| 黄色成人免费在线| 国产精品网站一区| 在线免费亚洲电影| 日产欧产美韩系列久久99| 欧美mv日韩mv国产网站| 国产91丝袜在线观看| 亚洲精品日韩专区silk| 日韩三级在线观看| 国产69精品久久99不卡| 亚洲欧洲av另类| 欧美裸体bbwbbwbbw| 国产精品一二三四| 一区二区三区资源| 日韩三级在线观看| 97久久精品人人澡人人爽| 日韩中文字幕1| 中文av一区二区| 欧美日韩精品电影| 国产成人免费视频一区| 亚洲自拍欧美精品| 久久久久久9999| 在线观看www91| 国产一区二区在线影院| 亚洲蜜臀av乱码久久精品| 日韩三级.com| 色菇凉天天综合网| 国产一区二区网址| 亚洲午夜电影在线观看| 久久亚洲春色中文字幕久久久| 色综合久久久久综合| 久久成人免费网| 亚洲综合成人网| 中文字幕巨乱亚洲| 日韩一级二级三级| 色哟哟国产精品| 国产精品系列在线观看| 五月天一区二区| 中文字幕一区二区三区av| 欧美一级xxx| 欧美日韩在线综合| 99视频超级精品| 精品一区二区影视| 五月天亚洲精品| 亚洲日本免费电影| 国产丝袜在线精品| 日韩一区二区三区视频|