├── GB28181_Stress_Tools.sln ├── GB28181_Stress_Tools ├── Device.cpp ├── Device.h ├── GB28181StressTools.aps ├── GB28181StressTools.rc ├── GB28181_Stress_Tools.cpp ├── GB28181_Stress_Tools.h ├── GB28181_Stress_Tools.vcxproj ├── GB28181_Stress_Tools.vcxproj.filters ├── GB28181_Stress_Tools.vcxproj.user ├── GB28181_Stress_ToolsDlg.cpp ├── GB28181_Stress_ToolsDlg.h ├── H264Parser.vcxproj ├── H264Parser.vcxproj.filters ├── H264Parser.vcxproj.user ├── HexStringUtils.cpp ├── HexStringUtils.h ├── LoadH264.cpp ├── LoadH264.h ├── Message.h ├── Nalu.h ├── NaluProvider.cpp ├── NaluProvider.h ├── NaluType.h ├── Test.cpp ├── UDPClient.cpp ├── UDPClient.h ├── bigbuckbunnynoB_480x272.h264 ├── bits.h ├── framework.h ├── gb28181_header_maker.cpp ├── gb28181_header_maker.h ├── h264_parser.c ├── h264_parser.h ├── pch.cpp ├── pch.h ├── pugiconfig.hpp ├── pugixml.cpp ├── pugixml.hpp ├── res │ ├── GB28181StressTools.rc2 │ ├── GB28181_Stress_Tools.ico │ ├── page.png │ └── video_preview.png ├── resource.h ├── targetver.h └── tmp.264 ├── README.md ├── include ├── eXosip2 │ ├── Makefile.am │ ├── Makefile.in │ ├── eX_call.h │ ├── eX_message.h │ ├── eX_options.h │ ├── eX_publish.h │ ├── eX_register.h │ ├── eX_setup.h │ ├── eX_subscribe.h │ └── eXosip.h ├── osip2 │ ├── Makefile.am │ ├── Makefile.in │ ├── doxygen.dox.in │ ├── internal.h │ ├── osip.h │ ├── osip_condv.h │ ├── osip_dialog.h │ ├── osip_fifo.h │ ├── osip_mt.h │ └── osip_time.h └── osipparser2 │ ├── Makefile.am │ ├── Makefile.in │ ├── headers │ ├── Makefile.am │ ├── Makefile.in │ ├── osip_accept.h │ ├── osip_accept_encoding.h │ ├── osip_accept_language.h │ ├── osip_alert_info.h │ ├── osip_allow.h │ ├── osip_authentication_info.h │ ├── osip_authorization.h │ ├── osip_call_id.h │ ├── osip_call_info.h │ ├── osip_contact.h │ ├── osip_content_disposition.h │ ├── osip_content_encoding.h │ ├── osip_content_length.h │ ├── osip_content_type.h │ ├── osip_cseq.h │ ├── osip_error_info.h │ ├── osip_from.h │ ├── osip_header.h │ ├── osip_mime_version.h │ ├── osip_proxy_authenticate.h │ ├── osip_proxy_authentication_info.h │ ├── osip_proxy_authorization.h │ ├── osip_record_route.h │ ├── osip_route.h │ ├── osip_to.h │ ├── osip_via.h │ └── osip_www_authenticate.h │ ├── internal.h │ ├── osip_body.h │ ├── osip_const.h │ ├── osip_headers.h │ ├── osip_list.h │ ├── osip_md5.h │ ├── osip_message.h │ ├── osip_parser.h │ ├── osip_port.h │ ├── osip_uri.h │ └── sdp_message.h ├── lib ├── eXosip.lib ├── libcares.lib ├── osip2.lib └── osipparser2.lib └── x64 └── Release ├── GB28181_Stress_Tools.exe └── bigbuckbunnynoB_480x272.h264 /GB28181_Stress_Tools.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.1062 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GB28181_Stress_Tools", "GB28181_Stress_Tools\GB28181_Stress_Tools.vcxproj", "{DA88DF0E-058E-4C93-B78D-013926819EA1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Debug|x64.ActiveCfg = Debug|x64 17 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Debug|x64.Build.0 = Debug|x64 18 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Debug|x86.ActiveCfg = Debug|Win32 19 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Debug|x86.Build.0 = Debug|Win32 20 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Release|x64.ActiveCfg = Release|x64 21 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Release|x64.Build.0 = Release|x64 22 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Release|x86.ActiveCfg = Release|Win32 23 | {DA88DF0E-058E-4C93-B78D-013926819EA1}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {ECC2850E-933F-4E9A-944C-244513D9A5B4} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/Device.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/Device.cpp -------------------------------------------------------------------------------- /GB28181_Stress_Tools/Device.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define WIN32_INTEROP_TYPES_H 3 | extern "C" { 4 | //#include 5 | #include 6 | } 7 | #include 8 | #include "UDPClient.h" 9 | #include "NaluProvider.h" 10 | #include 11 | #include 12 | #include 13 | #include "Message.h" 14 | 15 | 16 | //----exosip----// 17 | 18 | #pragma comment(lib, "eXosip.lib") 19 | #pragma comment(lib, "libcares.lib") 20 | #pragma comment(lib, "osip2.lib") 21 | #pragma comment(lib, "osipparser2.lib") 22 | 23 | #pragma comment(lib, "ws2_32.lib") 24 | #pragma comment(lib, "Dnsapi.lib") 25 | #pragma comment(lib, "Iphlpapi.lib") 26 | #pragma comment(lib, "Qwave.lib") 27 | #pragma comment(lib, "delayimp.lib") 28 | 29 | 30 | 31 | class Device { 32 | 33 | char deviceId[128] = { 0 }; 34 | 35 | char videoChannelId[128] = { 0 }; 36 | 37 | char server_sip_id[128] = { 0 }; 38 | 39 | char server_sip_realm[10] = { 0 }; 40 | 41 | char server_ip[128] = { 0 }; 42 | 43 | int server_port; 44 | 45 | char password[128] = { 0 }; 46 | 47 | char local_ip[128] = { 0 }; 48 | 49 | int local_port; 50 | 51 | eXosip_t * sip_context = nullptr; 52 | 53 | NaluProvider* nalu_provider = nullptr; 54 | 55 | 56 | public: 57 | Device(const char * deviceId, const char * server_sip_id, const char * server_ip, int server_port, const char * password, 58 | NaluProvider* nalu_provider) { 59 | memcpy(this->deviceId, deviceId, strlen(deviceId)); 60 | memcpy(this->videoChannelId, deviceId, strlen(deviceId)); 61 | memcpy(this->server_sip_id, server_sip_id, strlen(server_sip_id)); 62 | memcpy(server_sip_realm, server_sip_id, 10); 63 | memcpy(this->server_ip, server_ip, strlen(server_ip)); 64 | this->server_port = server_port; 65 | memcpy(this->password, password, strlen(password)); 66 | this->nalu_provider = nalu_provider; 67 | } 68 | void start_sip_client(int local_port); 69 | 70 | void stop_sip_client(); 71 | 72 | int list_index = 0; 73 | 74 | void set_callback(std::function callback); 75 | 76 | ~Device() { 77 | } 78 | private: 79 | 80 | void process_request(); 81 | 82 | void send_response_ok(eXosip_event_t *evt); 83 | 84 | void send_response(eXosip_event_t *evt, osip_message_t * message); 85 | 86 | osip_message_t * create_request(); 87 | 88 | void send_request(osip_message_t * request); 89 | 90 | bool register_success; 91 | 92 | bool is_tcp; 93 | 94 | const char * target_ip; 95 | 96 | int target_port; 97 | 98 | int listen_port; 99 | 100 | UDPClient* udp_client = nullptr; 101 | 102 | bool is_pushing; 103 | 104 | bool is_runing; 105 | 106 | int callId = -1; 107 | 108 | int dialogId = -1; 109 | 110 | void push_task(); 111 | 112 | void heartbeat_task(); 113 | 114 | std::function callback; 115 | 116 | }; 117 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181StressTools.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/GB28181StressTools.aps -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181StressTools.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/GB28181StressTools.rc -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_Tools.cpp: -------------------------------------------------------------------------------- 1 | 2 | // GB28181_Stress_Tools.cpp : Defines the class behaviors for the application. 3 | // 4 | 5 | #include "pch.h" 6 | #include "framework.h" 7 | #include "GB28181_Stress_Tools.h" 8 | #include "GB28181_Stress_ToolsDlg.h" 9 | 10 | #ifdef _DEBUG 11 | #define new DEBUG_NEW 12 | #endif 13 | 14 | 15 | // CGB28181StressToolsApp 16 | 17 | BEGIN_MESSAGE_MAP(CGB28181StressToolsApp, CWinApp) 18 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp) 19 | END_MESSAGE_MAP() 20 | 21 | 22 | // CGB28181StressToolsApp construction 23 | 24 | CGB28181StressToolsApp::CGB28181StressToolsApp() 25 | { 26 | // support Restart Manager 27 | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; 28 | 29 | // TODO: add construction code here, 30 | // Place all significant initialization in InitInstance 31 | } 32 | 33 | 34 | // The one and only CGB28181StressToolsApp object 35 | 36 | CGB28181StressToolsApp theApp; 37 | 38 | 39 | // CGB28181StressToolsApp initialization 40 | 41 | BOOL CGB28181StressToolsApp::InitInstance() 42 | { 43 | // InitCommonControlsEx() is required on Windows XP if an application 44 | // manifest specifies use of ComCtl32.dll version 6 or later to enable 45 | // visual styles. Otherwise, any window creation will fail. 46 | INITCOMMONCONTROLSEX InitCtrls; 47 | InitCtrls.dwSize = sizeof(InitCtrls); 48 | // Set this to include all the common control classes you want to use 49 | // in your application. 50 | InitCtrls.dwICC = ICC_WIN95_CLASSES; 51 | InitCommonControlsEx(&InitCtrls); 52 | 53 | CWinApp::InitInstance(); 54 | 55 | 56 | AfxEnableControlContainer(); 57 | 58 | // Create the shell manager, in case the dialog contains 59 | // any shell tree view or shell list view controls. 60 | CShellManager *pShellManager = new CShellManager; 61 | 62 | // Activate "Windows Native" visual manager for enabling themes in MFC controls 63 | CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows)); 64 | 65 | // Standard initialization 66 | // If you are not using these features and wish to reduce the size 67 | // of your final executable, you should remove from the following 68 | // the specific initialization routines you do not need 69 | // Change the registry key under which our settings are stored 70 | // TODO: You should modify this string to be something appropriate 71 | // such as the name of your company or organization 72 | SetRegistryKey(_T("Local AppWizard-Generated Applications")); 73 | 74 | CGB28181StressToolsDlg dlg; 75 | m_pMainWnd = &dlg; 76 | INT_PTR nResponse = dlg.DoModal(); 77 | if (nResponse == IDOK) 78 | { 79 | // TODO: Place code here to handle when the dialog is 80 | // dismissed with OK 81 | } 82 | else if (nResponse == IDCANCEL) 83 | { 84 | // TODO: Place code here to handle when the dialog is 85 | // dismissed with Cancel 86 | } 87 | else if (nResponse == -1) 88 | { 89 | TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n"); 90 | TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n"); 91 | } 92 | 93 | // Delete the shell manager created above. 94 | if (pShellManager != nullptr) 95 | { 96 | delete pShellManager; 97 | } 98 | 99 | #if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS) 100 | ControlBarCleanUp(); 101 | #endif 102 | 103 | // Since the dialog has been closed, return FALSE so that we exit the 104 | // application, rather than start the application's message pump. 105 | return FALSE; 106 | } 107 | 108 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_Tools.h: -------------------------------------------------------------------------------- 1 | 2 | // GB28181_Stress_Tools.h : main header file for the PROJECT_NAME application 3 | // 4 | 5 | #pragma once 6 | 7 | #ifndef __AFXWIN_H__ 8 | #error "include 'pch.h' before including this file for PCH" 9 | #endif 10 | 11 | #include "resource.h" // main symbols 12 | 13 | 14 | // CGB28181StressToolsApp: 15 | // See GB28181_Stress_Tools.cpp for the implementation of this class 16 | // 17 | 18 | class CGB28181StressToolsApp : public CWinApp 19 | { 20 | public: 21 | CGB28181StressToolsApp(); 22 | 23 | // Overrides 24 | public: 25 | virtual BOOL InitInstance(); 26 | 27 | // Implementation 28 | 29 | DECLARE_MESSAGE_MAP() 30 | }; 31 | 32 | extern CGB28181StressToolsApp theApp; 33 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_Tools.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | Header Files 53 | 54 | 55 | Header Files 56 | 57 | 58 | Header Files 59 | 60 | 61 | Header Files 62 | 63 | 64 | Header Files 65 | 66 | 67 | Header Files 68 | 69 | 70 | Header Files 71 | 72 | 73 | Header Files 74 | 75 | 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | Source Files 91 | 92 | 93 | Source Files 94 | 95 | 96 | Source Files 97 | 98 | 99 | Source Files 100 | 101 | 102 | Source Files 103 | 104 | 105 | Source Files 106 | 107 | 108 | Source Files 109 | 110 | 111 | 112 | 113 | Resource Files 114 | 115 | 116 | 117 | 118 | Resource Files 119 | 120 | 121 | 122 | 123 | Resource Files 124 | 125 | 126 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_Tools.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | GB28181StressTools.rc 5 | 6 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_ToolsDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/GB28181_Stress_ToolsDlg.cpp -------------------------------------------------------------------------------- /GB28181_Stress_Tools/GB28181_Stress_ToolsDlg.h: -------------------------------------------------------------------------------- 1 | 2 | // GB28181_Stress_ToolsDlg.h : header file 3 | // 4 | 5 | #pragma once 6 | #include "Message.h" 7 | #include 8 | 9 | // CGB28181StressToolsDlg dialog 10 | class CGB28181StressToolsDlg : public CDialogEx 11 | { 12 | // Construction 13 | public: 14 | CGB28181StressToolsDlg(CWnd* pParent = nullptr); // standard constructor 15 | 16 | // Dialog Data 17 | #ifdef AFX_DESIGN_TIME 18 | enum { IDD = IDD_GB28181_STRESS_TOOLS_DIALOG }; 19 | #endif 20 | 21 | protected: 22 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 23 | 24 | 25 | // Implementation 26 | protected: 27 | HICON m_hIcon; 28 | 29 | // Generated message map functions 30 | virtual BOOL OnInitDialog(); 31 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 32 | afx_msg void OnPaint(); 33 | afx_msg HCURSOR OnQueryDragIcon(); 34 | DECLARE_MESSAGE_MAP() 35 | public: 36 | CListCtrl m_device_list; 37 | afx_msg void OnBnClickedButton1(); 38 | private: 39 | CButton m_btn_start; 40 | CString m_edit_server_sip_id; 41 | CString m_edit_server_ip; 42 | int m_edit_server_port; 43 | int m_edit_device_count; 44 | 45 | bool CheckParams(); 46 | 47 | void Start(); 48 | 49 | void Stop(); 50 | 51 | void update_item(int index, Message msg); 52 | 53 | std::function callback; 54 | public: 55 | afx_msg void OnEnChangeEdit1(); 56 | private: 57 | CString m_edit_password; 58 | }; 59 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/H264Parser.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {13CEE293-F025-458C-9C32-C0874C8C12FD} 24 | H264Parser 25 | 10.0.17763.0 26 | 27 | 28 | 29 | Application 30 | true 31 | v141 32 | MultiByte 33 | 34 | 35 | Application 36 | false 37 | v141 38 | true 39 | MultiByte 40 | 41 | 42 | Application 43 | true 44 | v141 45 | MultiByte 46 | 47 | 48 | Application 49 | false 50 | v141 51 | true 52 | MultiByte 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Level3 76 | Disabled 77 | true 78 | true 79 | _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 80 | ..\include;%(AdditionalIncludeDirectories) 81 | 82 | 83 | Console 84 | ..\lib;%(AdditionalLibraryDirectories) 85 | 86 | 87 | 88 | 89 | Level3 90 | Disabled 91 | true 92 | true 93 | 94 | 95 | Console 96 | 97 | 98 | 99 | 100 | Level3 101 | MaxSpeed 102 | true 103 | true 104 | true 105 | true 106 | 107 | 108 | Console 109 | true 110 | true 111 | 112 | 113 | 114 | 115 | Level3 116 | MaxSpeed 117 | true 118 | true 119 | true 120 | true 121 | _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 122 | ..\include;%(AdditionalIncludeDirectories) 123 | 124 | 125 | Console 126 | true 127 | true 128 | ..\lib;%(AdditionalLibraryDirectories) 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/H264Parser.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | Header Files 41 | 42 | 43 | Header Files 44 | 45 | 46 | Header Files 47 | 48 | 49 | Header Files 50 | 51 | 52 | Header Files 53 | 54 | 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/H264Parser.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/HexStringUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "HexStringUtils.h" 2 | 3 | std::string binToHex(unsigned char *data, size_t size) { 4 | std::ostringstream strHex; 5 | strHex << std::hex << std::setfill('0'); 6 | for (size_t i = 0; i < size; ++i) { 7 | strHex << std::setw(2) << static_cast(data[i]); 8 | } 9 | return strHex.str(); 10 | } -------------------------------------------------------------------------------- /GB28181_Stress_Tools/HexStringUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | std::string binToHex(unsigned char *data, size_t size); -------------------------------------------------------------------------------- /GB28181_Stress_Tools/LoadH264.cpp: -------------------------------------------------------------------------------- 1 | #include "LoadH264.h" 2 | extern "C" { 3 | #include "h264_parser.h" 4 | } 5 | 6 | std::vector nalu_vector; 7 | 8 | char sps_data[128] = { 0 }; 9 | int sps_data_length = 0; 10 | 11 | char pps_data[128] = { 0 }; 12 | int pps_data_length = 0; 13 | 14 | void out_nalu(char * buffer, int size, NaluType naluType) { 15 | 16 | //std::cout << "rtp_packet >>> " << binToHex((unsigned char *)buffer, size); 17 | 18 | if (NALU_TYPE_SPS == naluType) { 19 | memcpy(sps_data, buffer, size); 20 | sps_data_length = size; 21 | return; 22 | } 23 | 24 | if (NALU_TYPE_PPS == naluType) { 25 | memcpy(pps_data, buffer, size); 26 | pps_data_length = size; 27 | return; 28 | } 29 | Nalu * nalu = new Nalu; 30 | 31 | bool is_i_frame = (NALU_TYPE_IDR == naluType); 32 | 33 | char * packet = (char *)malloc(is_i_frame ? (size + sps_data_length + pps_data_length) : size * sizeof(char)); 34 | if (is_i_frame) { 35 | 36 | memcpy(packet, sps_data, sps_data_length); 37 | 38 | memcpy(packet + sps_data_length, pps_data, pps_data_length); 39 | 40 | memcpy(packet + sps_data_length + pps_data_length, buffer, size); 41 | 42 | size += (sps_data_length + pps_data_length); 43 | } 44 | else { 45 | memcpy(packet, buffer, size); 46 | } 47 | nalu->packet = packet; 48 | nalu->length = size; 49 | nalu->type = naluType; 50 | 51 | nalu_vector.push_back(nalu); 52 | } 53 | 54 | int load(const char * path) { 55 | return simplest_h264_parser(path, out_nalu); 56 | } -------------------------------------------------------------------------------- /GB28181_Stress_Tools/LoadH264.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Nalu.h" 4 | 5 | extern std::vector nalu_vector; 6 | 7 | int load(const char *path); -------------------------------------------------------------------------------- /GB28181_Stress_Tools/Message.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum { 4 | STATUS_TYPE, 5 | PULL_STREAM_PORT_TYPE, 6 | PULL_STREAM_PROTOCOL_TYPE, 7 | } MESSAGE_TYPE; 8 | 9 | struct Message { 10 | MESSAGE_TYPE type; 11 | const char * content; 12 | }; 13 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/Nalu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "NaluType.h" 3 | class Nalu { 4 | public: 5 | char * packet; 6 | int length; 7 | NaluType type; 8 | 9 | ~Nalu() { 10 | if (packet != nullptr) { 11 | delete packet; 12 | packet = nullptr; 13 | } 14 | } 15 | }; -------------------------------------------------------------------------------- /GB28181_Stress_Tools/NaluProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "NaluProvider.h" 2 | 3 | 4 | NaluProvider::NaluProvider(std::vector* nalu_vector) :nalu_vector(nalu_vector){ 5 | InitializeCriticalSection(&lock); 6 | 7 | }; 8 | 9 | bool NaluProvider::get_nalu(int index, Nalu* target) { 10 | 11 | EnterCriticalSection(&lock); 12 | if (nalu_vector != nullptr && index >= nalu_vector->size()) { 13 | return false; 14 | } 15 | Nalu * nalu = nalu_vector->at(index); 16 | 17 | memcpy(target->packet,nalu->packet,nalu->length); 18 | 19 | target->length = nalu->length; 20 | target->type = nalu->type; 21 | LeaveCriticalSection(&lock); 22 | return true; 23 | 24 | } -------------------------------------------------------------------------------- /GB28181_Stress_Tools/NaluProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Nalu.h" 3 | #include 4 | #include 5 | 6 | class NaluProvider { 7 | 8 | private : 9 | 10 | std::vector* nalu_vector; 11 | 12 | 13 | CRITICAL_SECTION lock; 14 | 15 | public: 16 | NaluProvider(std::vector* nalu_vector); 17 | bool get_nalu(int index, Nalu* target); 18 | } 19 | ; 20 | 21 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/NaluType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | typedef enum { 3 | NALU_TYPE_SLICE = 1, 4 | NALU_TYPE_DPA = 2, 5 | NALU_TYPE_DPB = 3, 6 | NALU_TYPE_DPC = 4, 7 | NALU_TYPE_IDR = 5, 8 | NALU_TYPE_SEI = 6, 9 | NALU_TYPE_SPS = 7, 10 | NALU_TYPE_PPS = 8, 11 | NALU_TYPE_AUD = 9, 12 | NALU_TYPE_EOSEQ = 10, 13 | NALU_TYPE_EOSTREAM = 11, 14 | NALU_TYPE_FILL = 12, 15 | }NaluType; -------------------------------------------------------------------------------- /GB28181_Stress_Tools/Test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/Test.cpp -------------------------------------------------------------------------------- /GB28181_Stress_Tools/UDPClient.cpp: -------------------------------------------------------------------------------- 1 | #include "UDPClient.h" 2 | 3 | int UDPClient::bind(const char * ip,int port) { 4 | return bind(ip,port,"",0); 5 | } 6 | 7 | int UDPClient::bind(const char * ip, int port, const char * connect_ip, int connect_port) { 8 | 9 | WORD socketVersion = MAKEWORD(2, 2); 10 | WSADATA wsaData; 11 | if (WSAStartup(socketVersion, &wsaData) != 0) 12 | { 13 | create_client_status = -1; 14 | return create_client_status; 15 | } 16 | client = socket(AF_INET, is_tcp ? SOCK_STREAM:SOCK_DGRAM, is_tcp ? IPPROTO_TCP : IPPROTO_UDP); 17 | 18 | sockaddr_in bind_address; 19 | bind_address.sin_family = AF_INET; 20 | bind_address.sin_port = htons(port); 21 | bind_address.sin_addr.s_addr = inet_addr(ip); 22 | create_client_status = ::bind(client, (sockaddr*)&bind_address, sizeof(bind_address)); 23 | if (0 != create_client_status) { 24 | WSACleanup(); 25 | } 26 | if(!is_tcp){ 27 | return create_client_status; 28 | } 29 | sockaddr_in serAddr; 30 | serAddr.sin_family = AF_INET; 31 | serAddr.sin_port = htons(connect_port); 32 | serAddr.sin_addr.S_un.S_addr = inet_addr(connect_ip); 33 | if (connect(client, (sockaddr *)&serAddr, sizeof(serAddr)) < 0) 34 | { 35 | printf("connect error !"); 36 | closesocket(client); 37 | WSACleanup(); 38 | return -1; 39 | } 40 | return 0; 41 | } 42 | 43 | void UDPClient::release() { 44 | if (0 == create_client_status ) { 45 | closesocket(client); 46 | WSACleanup(); 47 | } 48 | create_client_status = -1; 49 | } 50 | 51 | void UDPClient::send_packet(const char * target_ip, int target_port, const char * data, int data_length) { 52 | if(!is_tcp){ 53 | sockaddr_in sin; 54 | sin.sin_family = AF_INET; 55 | sin.sin_port = htons(target_port); 56 | sin.sin_addr.S_un.S_addr = inet_addr(target_ip); 57 | sendto(client, data, data_length, 0, (sockaddr *)&sin, sizeof(sin)); 58 | } 59 | else { 60 | send(client, data, data_length, 0); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/UDPClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define _WINSOCK_DEPRECATED_NO_WARNINGS 3 | #include 4 | #include 5 | 6 | #pragma comment(lib,"ws2_32.lib") 7 | 8 | class UDPClient { 9 | int create_client_status = -1; 10 | SOCKET client; 11 | bool is_tcp; 12 | 13 | public: 14 | 15 | UDPClient(bool is_tcp) { 16 | this->is_tcp = is_tcp; 17 | } 18 | 19 | int bind(const char * ip,int port); 20 | 21 | int bind(const char * ip, int port, const char * connect_ip,int connect_port); 22 | 23 | void send_packet(const char * target_ip, int target_port, const char * data, int data_length); 24 | 25 | void release(); 26 | }; 27 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/bigbuckbunnynoB_480x272.h264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/bigbuckbunnynoB_480x272.h264 -------------------------------------------------------------------------------- /GB28181_Stress_Tools/bits.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef BITS_H 4 | #define BITS_H 5 | 6 | #include 7 | #include 8 | 9 | struct bits_buffer_t 10 | { 11 | int i_size; 12 | 13 | int i_data; 14 | uint8_t i_mask; 15 | uint8_t *p_data; 16 | 17 | }; 18 | typedef struct bits_buffer_t bits_buffer_t; 19 | 20 | static int bits_initwrite(struct bits_buffer_t *p_buffer, int i_size, void *p_data) 21 | { 22 | p_buffer->i_size = i_size; 23 | p_buffer->i_data = 0; 24 | p_buffer->i_mask = 0x80; 25 | p_buffer->p_data = (uint8_t *)p_data; 26 | p_buffer->p_data[0] = 0; 27 | if (!p_buffer->p_data) 28 | { 29 | if (!(p_buffer->p_data = (uint8_t *)malloc(i_size))) 30 | { 31 | return(-1); 32 | } 33 | else 34 | { 35 | return(0); 36 | } 37 | } 38 | else 39 | { 40 | return(0); 41 | } 42 | } 43 | 44 | static void bits_align(struct bits_buffer_t * p_buffer) 45 | { 46 | if (p_buffer->i_mask != 0x80 && p_buffer->i_data < p_buffer->i_size) 47 | { 48 | p_buffer->i_mask = 0x80; 49 | p_buffer->i_data++; 50 | p_buffer->p_data[p_buffer->i_data] = 0x00; 51 | } 52 | } 53 | 54 | static void bits_write(struct bits_buffer_t *p_buffer, int i_count, uint64_t i_bits) 55 | { 56 | while (i_count > 0) 57 | { 58 | i_count--; 59 | 60 | if ((i_bits >> i_count) & 0x01) 61 | { 62 | p_buffer->p_data[p_buffer->i_data] |= p_buffer->i_mask; 63 | } 64 | else 65 | { 66 | p_buffer->p_data[p_buffer->i_data] &= ~p_buffer->i_mask; 67 | } 68 | p_buffer->i_mask >>= 1; 69 | if (p_buffer->i_mask == 0) 70 | { 71 | p_buffer->i_data++; 72 | p_buffer->i_mask = 0x80; 73 | } 74 | } 75 | } 76 | 77 | #endif //BITS_H 78 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef VC_EXTRALEAN 4 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 5 | #endif 6 | 7 | #include "targetver.h" 8 | 9 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 10 | 11 | // turns off MFC's hiding of some common and often safely ignored warning messages 12 | #define _AFX_ALL_WARNINGS 13 | 14 | #include // MFC core and standard components 15 | #include // MFC extensions 16 | 17 | 18 | #include // MFC Automation classes 19 | 20 | 21 | 22 | #ifndef _AFX_NO_OLE_SUPPORT 23 | #include // MFC support for Internet Explorer 4 Common Controls 24 | #endif 25 | #ifndef _AFX_NO_AFXCMN_SUPPORT 26 | #include // MFC support for Windows Common Controls 27 | #endif // _AFX_NO_AFXCMN_SUPPORT 28 | 29 | #include // MFC support for ribbons and control bars 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | #ifdef _UNICODE 40 | #if defined _M_IX86 41 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 42 | #elif defined _M_X64 43 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 44 | #else 45 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 46 | #endif 47 | #endif 48 | 49 | 50 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/gb28181_header_maker.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/gb28181_header_maker.cpp -------------------------------------------------------------------------------- /GB28181_Stress_Tools/gb28181_header_maker.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/gb28181_header_maker.h -------------------------------------------------------------------------------- /GB28181_Stress_Tools/h264_parser.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // 3 | // h264_parser.h 4 | // H264_Parser 5 | // 6 | // Created by Ternence on 2019/3/22. 7 | // Copyright © 2019 Ternence. All rights reserved. 8 | // 9 | 10 | #ifndef h264_parser_h 11 | #define h264_parser_h 12 | 13 | #include 14 | #include "NaluType.h" 15 | int simplest_h264_parser(const char *url,void(*out_nalu)(char * buffer,int size, NaluType type)); 16 | //int simplest_h264_parser(const char *url); 17 | 18 | #endif /* h264_parser_h */ 19 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: source file corresponding to the pre-compiled header 2 | 3 | #include "pch.h" 4 | 5 | // When you are using pre-compiled headers, this source file is necessary for compilation to succeed. 6 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: This is a precompiled header file. 2 | // Files listed below are compiled only once, improving build performance for future builds. 3 | // This also affects IntelliSense performance, including code completion and many code browsing features. 4 | // However, files listed here are ALL re-compiled if any one of them is updated between builds. 5 | // Do not add files here that you will be updating frequently as this negates the performance advantage. 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // add headers that you want to pre-compile here 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/pugiconfig.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * pugixml parser - version 1.8 3 | * -------------------------------------------------------- 4 | * Copyright (C) 2006-2016, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) 5 | * Report bugs and download new versions at http://pugixml.org/ 6 | * 7 | * This library is distributed under the MIT License. See notice at the end 8 | * of this file. 9 | * 10 | * This work is based on the pugxml parser, which is: 11 | * Copyright (C) 2003, by Kristen Wegner (kristen@tima.net) 12 | */ 13 | 14 | #ifndef HEADER_PUGICONFIG_HPP 15 | #define HEADER_PUGICONFIG_HPP 16 | 17 | // Uncomment this to enable wchar_t mode 18 | // #define PUGIXML_WCHAR_MODE 19 | 20 | // Uncomment this to enable compact mode 21 | // #define PUGIXML_COMPACT 22 | 23 | // Uncomment this to disable XPath 24 | // #define PUGIXML_NO_XPATH 25 | 26 | // Uncomment this to disable STL 27 | // #define PUGIXML_NO_STL 28 | 29 | // Uncomment this to disable exceptions 30 | // #define PUGIXML_NO_EXCEPTIONS 31 | 32 | // Set this to control attributes for public classes/functions, i.e.: 33 | // #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL 34 | // #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL 35 | // #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall 36 | // In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead 37 | 38 | // Tune these constants to adjust memory-related behavior 39 | // #define PUGIXML_MEMORY_PAGE_SIZE 32768 40 | // #define PUGIXML_MEMORY_OUTPUT_STACK 10240 41 | // #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096 42 | 43 | // Uncomment this to switch to header-only version 44 | // #define PUGIXML_HEADER_ONLY 45 | 46 | // Uncomment this to enable long long support 47 | // #define PUGIXML_HAS_LONG_LONG 48 | 49 | #endif 50 | 51 | /** 52 | * Copyright (c) 2006-2016 Arseny Kapoulkine 53 | * 54 | * Permission is hereby granted, free of charge, to any person 55 | * obtaining a copy of this software and associated documentation 56 | * files (the "Software"), to deal in the Software without 57 | * restriction, including without limitation the rights to use, 58 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 59 | * copies of the Software, and to permit persons to whom the 60 | * Software is furnished to do so, subject to the following 61 | * conditions: 62 | * 63 | * The above copyright notice and this permission notice shall be 64 | * included in all copies or substantial portions of the Software. 65 | * 66 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 67 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 68 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 69 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 70 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 71 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 72 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 73 | * OTHER DEALINGS IN THE SOFTWARE. 74 | */ 75 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/res/GB28181StressTools.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/res/GB28181StressTools.rc2 -------------------------------------------------------------------------------- /GB28181_Stress_Tools/res/GB28181_Stress_Tools.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/res/GB28181_Stress_Tools.ico -------------------------------------------------------------------------------- /GB28181_Stress_Tools/res/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/res/page.png -------------------------------------------------------------------------------- /GB28181_Stress_Tools/res/video_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/res/video_preview.png -------------------------------------------------------------------------------- /GB28181_Stress_Tools/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by GB28181StressTools.rc 4 | // 5 | #define IDM_ABOUTBOX 0x0010 6 | #define IDD_ABOUTBOX 100 7 | #define IDS_ABOUTBOX 101 8 | #define IDD_GB28181_STRESS_TOOLS_DIALOG 102 9 | #define IDR_MAINFRAME 128 10 | #define IDC_LIST2 1001 11 | #define IDC_EDIT1 1002 12 | #define IDC_EDIT2 1003 13 | #define IDC_EDIT3 1004 14 | #define IDC_EDIT4 1005 15 | #define IDC_BUTTON1 1006 16 | #define IDC_EDIT5 1007 17 | 18 | // Next default values for new objects 19 | // 20 | #ifdef APSTUDIO_INVOKED 21 | #ifndef APSTUDIO_READONLY_SYMBOLS 22 | #define _APS_NEXT_RESOURCE_VALUE 130 23 | #define _APS_NEXT_COMMAND_VALUE 32771 24 | #define _APS_NEXT_CONTROL_VALUE 1007 25 | #define _APS_NEXT_SYMED_VALUE 101 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /GB28181_Stress_Tools/tmp.264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/GB28181_Stress_Tools/tmp.264 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gb28181_client 2 | 3 | 国标 gb28181 模拟客户端 4 | 5 | - 支持 windows 6 | -------------------------------------------------------------------------------- /include/eXosip2/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | 3 | eXosip_includedir=$(includedir)/eXosip2 4 | 5 | eXosip_include_HEADERS= eXosip.h eX_setup.h \ 6 | eX_register.h eX_call.h eX_options.h \ 7 | eX_subscribe.h eX_publish.h eX_message.h 8 | 9 | -------------------------------------------------------------------------------- /include/eXosip2/eX_message.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | eXosip is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | eXosip is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | In addition, as a special exception, the copyright holders give 20 | permission to link the code of portions of this program with the 21 | OpenSSL library under certain conditions as described in each 22 | individual source file, and distribute linked combinations 23 | including the two. 24 | You must obey the GNU General Public License in all respects 25 | for all of the code used other than OpenSSL. If you modify 26 | file(s) with this exception, you may extend this exception to your 27 | version of the file(s), but you are not obligated to do so. If you 28 | do not wish to do so, delete this exception statement from your 29 | version. If you delete this exception statement from all source 30 | files in the program, then also delete it here. 31 | */ 32 | 33 | 34 | #ifdef ENABLE_MPATROL 35 | #include 36 | #endif 37 | 38 | #ifndef __EX_MESSAGE_H__ 39 | #define __EX_MESSAGE_H__ 40 | 41 | #include 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | /** 49 | * @file eX_message.h 50 | * @brief eXosip request API 51 | * 52 | * This file provide the API needed to control requests. You can 53 | * use it to: 54 | * 55 | *
    56 | *
  • build any requests.
  • 57 | *
  • send any requests.
  • 58 | *
  • build any answers.
  • 59 | *
  • send any answers.
  • 60 | *
61 | */ 62 | 63 | /** 64 | * @defgroup eXosip2_message eXosip2 request outside of dialog 65 | * @ingroup eXosip2_msg 66 | * @{ 67 | */ 68 | 69 | /** 70 | * Build a default request message. 71 | * 72 | * This method will be updated to send any message outside of dialog 73 | * In this later case, you'll specify the method to use in the second 74 | * argument. 75 | * 76 | * 77 | * @param excontext eXosip_t instance. 78 | * @param message Pointer for the SIP request to build. 79 | * @param method request method. (like "MESSAGE" or "PING"...) 80 | * @param to SIP url for callee. 81 | * @param from SIP url for caller. 82 | * @param route Route header for request. (optional) 83 | */ 84 | int eXosip_message_build_request (struct eXosip_t *excontext, osip_message_t ** message, const char *method, const char *to, const char *from, const char *route); 85 | 86 | /** 87 | * Send an request. 88 | * 89 | * @param excontext eXosip_t instance. 90 | * @param message SIP request to send. 91 | */ 92 | int eXosip_message_send_request (struct eXosip_t *excontext, osip_message_t * message); 93 | 94 | /** 95 | * Build answer for a request. 96 | * 97 | * @param excontext eXosip_t instance. 98 | * @param tid id of transaction. 99 | * @param status status for SIP answer to build. 100 | * @param answer The SIP answer to build. 101 | */ 102 | int eXosip_message_build_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t ** answer); 103 | 104 | /** 105 | * Send answer for a request. 106 | * 107 | * @param excontext eXosip_t instance. 108 | * @param tid id of transaction. 109 | * @param status status for SIP answer to send. 110 | * @param answer The SIP answer to send. (default will be sent if NULL) 111 | */ 112 | int eXosip_message_send_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t * answer); 113 | 114 | /** @} */ 115 | 116 | 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | #endif 121 | -------------------------------------------------------------------------------- /include/eXosip2/eX_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | eXosip is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | eXosip is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | In addition, as a special exception, the copyright holders give 20 | permission to link the code of portions of this program with the 21 | OpenSSL library under certain conditions as described in each 22 | individual source file, and distribute linked combinations 23 | including the two. 24 | You must obey the GNU General Public License in all respects 25 | for all of the code used other than OpenSSL. If you modify 26 | file(s) with this exception, you may extend this exception to your 27 | version of the file(s), but you are not obligated to do so. If you 28 | do not wish to do so, delete this exception statement from your 29 | version. If you delete this exception statement from all source 30 | files in the program, then also delete it here. 31 | */ 32 | 33 | 34 | #ifdef ENABLE_MPATROL 35 | #include 36 | #endif 37 | 38 | #ifndef MINISIZE 39 | 40 | #ifndef __EX_OPTIONS_H__ 41 | #define __EX_OPTIONS_H__ 42 | 43 | #include 44 | #include 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | /** 51 | * @file eX_options.h 52 | * @brief eXosip options request API 53 | * 54 | * This file provide the API needed to control OPTIONS requests. You can 55 | * use it to: 56 | * 57 | *
    58 | *
  • build OPTIONS requests.
  • 59 | *
  • send OPTIONS requests.
  • 60 | *
  • build OPTIONS answers.
  • 61 | *
  • send OPTIONS answers.
  • 62 | *
63 | */ 64 | 65 | /** 66 | * @defgroup eXosip2_options eXosip2 OPTIONS and UA capabilities Management 67 | * @ingroup eXosip2_msg 68 | * @{ 69 | */ 70 | 71 | /** 72 | * Build a default OPTIONS message. 73 | * 74 | * @param excontext eXosip_t instance. 75 | * @param options Pointer for the SIP request to build. 76 | * @param to SIP url for callee. 77 | * @param from SIP url for caller. 78 | * @param route Route header for INVITE. (optional) 79 | */ 80 | int eXosip_options_build_request (struct eXosip_t *excontext, osip_message_t ** options, const char *to, const char *from, const char *route); 81 | 82 | /** 83 | * Send an OPTIONS request. 84 | * 85 | * @param excontext eXosip_t instance. 86 | * @param options SIP OPTIONS message to send. 87 | */ 88 | int eXosip_options_send_request (struct eXosip_t *excontext, osip_message_t * options); 89 | 90 | /** 91 | * Build answer for an OPTIONS request. 92 | * 93 | * @param excontext eXosip_t instance. 94 | * @param tid id of OPTIONS transaction. 95 | * @param status status for SIP answer to build. 96 | * @param answer The SIP answer to build. 97 | */ 98 | int eXosip_options_build_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t ** answer); 99 | 100 | /** 101 | * Send answer for an OPTIONS request. 102 | * 103 | * @param excontext eXosip_t instance. 104 | * @param tid id of OPTIONS transaction. 105 | * @param status status for SIP answer to send. 106 | * @param answer The SIP answer to send. (default will be sent if NULL) 107 | */ 108 | int eXosip_options_send_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t * answer); 109 | 110 | /** @} */ 111 | 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | #endif 117 | #endif 118 | -------------------------------------------------------------------------------- /include/eXosip2/eX_publish.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | eXosip is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | eXosip is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | In addition, as a special exception, the copyright holders give 20 | permission to link the code of portions of this program with the 21 | OpenSSL library under certain conditions as described in each 22 | individual source file, and distribute linked combinations 23 | including the two. 24 | You must obey the GNU General Public License in all respects 25 | for all of the code used other than OpenSSL. If you modify 26 | file(s) with this exception, you may extend this exception to your 27 | version of the file(s), but you are not obligated to do so. If you 28 | do not wish to do so, delete this exception statement from your 29 | version. If you delete this exception statement from all source 30 | files in the program, then also delete it here. 31 | */ 32 | 33 | 34 | #ifdef ENABLE_MPATROL 35 | #include 36 | #endif 37 | 38 | #ifndef MINISIZE 39 | 40 | #ifndef __EX_PUBLISH_H__ 41 | #define __EX_PUBLISH_H__ 42 | 43 | #include 44 | #include 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | /** 51 | * @file eX_publish.h 52 | * @brief eXosip publish request API 53 | * 54 | * This file provide the API needed to control PUBLISH requests. You can 55 | * use it to: 56 | * 57 | *
    58 | *
  • build PUBLISH requests.
  • 59 | *
  • send PUBLISH requests.
  • 60 | *
61 | */ 62 | 63 | /** 64 | * @defgroup eXosip2_publish eXosip2 Publication Management 65 | * @ingroup eXosip2_msg 66 | * @{ 67 | */ 68 | 69 | /** 70 | * build publication for a user. (PUBLISH request) 71 | * 72 | * @param excontext eXosip_t instance. 73 | * @param message returned published request. 74 | * @param to SIP url for callee. 75 | * @param from SIP url for caller. 76 | * @param route Route used for publication. 77 | * @param event SIP Event header. 78 | * @param expires SIP Expires header. 79 | * @param ctype Content-Type of body. 80 | * @param body body for publication. 81 | */ 82 | int eXosip_build_publish (struct eXosip_t *excontext, osip_message_t ** message, const char *to, const char *from, const char *route, const char *event, const char *expires, const char *ctype, const char *body); 83 | 84 | /** 85 | * Send an Publication Message (PUBLISH request). 86 | * 87 | * @param excontext eXosip_t instance. 88 | * @param message is a ready to be sent publish message . 89 | * @param to the aor of the publish request 90 | */ 91 | int eXosip_publish (struct eXosip_t *excontext, osip_message_t * message, const char *to); 92 | 93 | 94 | /** @} */ 95 | 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | #endif 101 | #endif 102 | -------------------------------------------------------------------------------- /include/eXosip2/eX_register.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | eXosip is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | eXosip is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | In addition, as a special exception, the copyright holders give 20 | permission to link the code of portions of this program with the 21 | OpenSSL library under certain conditions as described in each 22 | individual source file, and distribute linked combinations 23 | including the two. 24 | You must obey the GNU General Public License in all respects 25 | for all of the code used other than OpenSSL. If you modify 26 | file(s) with this exception, you may extend this exception to your 27 | version of the file(s), but you are not obligated to do so. If you 28 | do not wish to do so, delete this exception statement from your 29 | version. If you delete this exception statement from all source 30 | files in the program, then also delete it here. 31 | */ 32 | 33 | 34 | #ifdef ENABLE_MPATROL 35 | #include 36 | #endif 37 | 38 | #ifndef __EX_REGISTER_H__ 39 | #define __EX_REGISTER_H__ 40 | 41 | #include 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /** 50 | * @file eX_register.h 51 | * @brief eXosip registration API 52 | * 53 | * This file provide the API needed to control registrations. You can 54 | * use it to: 55 | * 56 | *
    57 | *
  • build initial REGISTER.
  • 58 | *
  • build REGISTER.
  • 59 | *
  • send REGISTER.
  • 60 | *
61 | */ 62 | 63 | /** 64 | * @defgroup eXosip2_registration eXosip2 REGISTER and Registration Management 65 | * @ingroup eXosip2_msg 66 | * @{ 67 | */ 68 | 69 | struct eXosip_reg_t; 70 | 71 | /** 72 | * Build initial REGISTER request. 73 | * 74 | * @param excontext eXosip_t instance. 75 | * @param from SIP url for caller. 76 | * @param proxy Proxy used for registration. 77 | * @param contact Contact address. (optional) 78 | * @param expires The expires value for registration. 79 | * @param reg The SIP request to build. 80 | */ 81 | int eXosip_register_build_initial_register (struct eXosip_t *excontext, const char *from, const char *proxy, const char *contact, int expires, osip_message_t ** reg); 82 | 83 | /** 84 | * Build initial REGISTER request with qvalue for contact. 85 | * 86 | * @param excontext eXosip_t instance. 87 | * @param from SIP url for caller. 88 | * @param proxy Proxy used for registration. 89 | * @param contact Contact address. (optional) 90 | * @param expires The expires value for registration. 91 | * @param qvalue The qvalue value for contact header. 92 | * @param reg The SIP request to build. 93 | */ 94 | int eXosip_register_build_initial_register_withqvalue (struct eXosip_t *excontext, const char *from, const char *proxy, const char *contact, int expires, const char *qvalue, osip_message_t ** reg); 95 | 96 | /** 97 | * Build a new REGISTER request for an existing registration. 98 | * 99 | * @param excontext eXosip_t instance. 100 | * @param rid A unique identifier for the registration context 101 | * @param expires The expires value for registration. 102 | * @param reg The SIP request to build. 103 | */ 104 | int eXosip_register_build_register (struct eXosip_t *excontext, int rid, int expires, osip_message_t ** reg); 105 | 106 | /** 107 | * Send a REGISTER request for an existing registration. 108 | * 109 | * @param excontext eXosip_t instance. 110 | * @param rid A unique identifier for the registration context 111 | * @param reg The SIP request to build. (NULL for default REGISTER) 112 | */ 113 | int eXosip_register_send_register (struct eXosip_t *excontext, int rid, osip_message_t * reg); 114 | 115 | /** 116 | * Remove existing registration without sending REGISTER. 117 | * 118 | * @param excontext eXosip_t instance. 119 | * @param rid A unique identifier for the registration context 120 | */ 121 | int eXosip_register_remove (struct eXosip_t *excontext, int rid); 122 | 123 | /** @} */ 124 | 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | #endif 130 | -------------------------------------------------------------------------------- /include/osip2/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = internal.h doxygen.dox.in 3 | 4 | osip2_includedir=$(includedir)/osip2 5 | 6 | osip2_include_HEADERS= \ 7 | osip.h osip_dialog.h \ 8 | osip_mt.h osip_fifo.h osip_condv.h \ 9 | osip_time.h 10 | 11 | -------------------------------------------------------------------------------- /include/osip2/doxygen.dox.in: -------------------------------------------------------------------------------- 1 | /** 2 | * @mainpage 3 | * Project Website: http://www.fsf.org/software/osip 4 | * 5 | * @verbinclude README 6 | * 7 | * @verbinclude HISTORY 8 | * 9 | * @verbinclude FEATURES 10 | * 11 | */ 12 | 13 | /** 14 | * @defgroup libosip2 The GNU oSIP stack 15 | * @brief libosip2 Version @OSIP_VERSION@ 16 | * 17 | * @see http://www.fsf.org/software/osip 18 | * 19 | * @section what_is_it What is oSIP 20 | * 21 | * libosip2 implements the Session Initiation Protocol (SIP -rfc3261-) 22 | * libosip2 is LGPL (COPYING). Please understand the licencing details 23 | * before using it! 24 | * 25 | * @section what_is_sip What is SIP 26 | * 27 | * SIP is an IP telephony protocol made by the IETF. 28 | * It is an effort to create a simple (telephony is never 29 | * simple) and powerfull protocol for next generation 30 | * telephony systems. 31 | * 32 | * @section what_features SIP features 33 | * 34 | * SIP is not just about telephony. It's much more 35 | * that what you expect from phones. SIP means mobility, 36 | * video, textual call informations, file exchange, 37 | * instant messaging, presence support and much more! 38 | * 39 | * @section what_freesoftware oSIP is free software 40 | * 41 | * As oSIP is LGPL, you still have the choice to implement 42 | * propriatory application and link with oSIP. For the 43 | * benefit of the community (and for your own benefit), 44 | * please consider implementing your application in GPL. 45 | * 46 | * @section what_thanks Thanks 47 | * 48 | * Thanks to all the contributors and to all bug reporters. 49 | * Enjoy osip! 50 | * 51 | */ 52 | 53 | /** 54 | * @defgroup osip2_parser The parser modules 55 | * @brief Parser APIs. 56 | * 57 | * XXX 58 | */ 59 | 60 | /** 61 | * @defgroup osip2_port The OS port modules 62 | * @brief Thread/Semaphore/Mutex APIs. 63 | * 64 | * XXX 65 | */ 66 | 67 | /** 68 | * @defgroup osip2_fsm State Machines 69 | * @brief SIP transaction management APIs 70 | * 71 | * XXX 72 | */ 73 | 74 | /** 75 | * @page osip2_readme README 76 | * @verbinclude README 77 | */ 78 | 79 | /** 80 | * @page osip2_install INSTALL 81 | * @verbinclude INSTALL 82 | */ 83 | 84 | /** 85 | * @page osip2_features FEATURES 86 | * @verbinclude FEATURES 87 | */ 88 | 89 | /** 90 | * @page osip2_license COPYING 91 | * @verbinclude COPYING 92 | */ 93 | 94 | /** 95 | * @page osip2_changelog ChangeLog 96 | * @verbinclude ChangeLog 97 | */ 98 | -------------------------------------------------------------------------------- /include/osip2/osip_condv.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef __OSIP_CONDV_H__ 21 | #define __OSIP_CONDV_H__ 22 | 23 | #include 24 | 25 | #ifndef OSIP_MONOTHREAD 26 | 27 | /** 28 | * @file osip_condv.h 29 | * @brief oSIP condition variables definitions 30 | * 31 | * Those methods are only available if the library is compile 32 | * in multi threaded mode. This is the default for oSIP. 33 | */ 34 | 35 | /** 36 | * @defgroup oSIP_COND oSIP condition variables definitions 37 | * @ingroup osip2_port 38 | * @{ 39 | */ 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #if defined(__PSOS__) 46 | 47 | /* TODO */ 48 | 49 | #else 50 | 51 | 52 | /* condv implementation */ 53 | #if defined(WIN32) || defined(_WIN32_WCE) 54 | /* Prevent struct redefinition if Pthreads for Win32 is used */ 55 | #if (_MSC_VER < 1900) 56 | #ifndef HAVE_STRUCT_TIMESPEC 57 | #define HAVE_STRUCT_TIMESPEC 1 58 | /** 59 | * timespec structure 60 | * @struct timespec 61 | */ 62 | struct timespec { 63 | long tv_sec; 64 | long tv_nsec; 65 | }; 66 | #endif 67 | #endif 68 | #endif 69 | 70 | struct osip_cond; 71 | 72 | /** 73 | * Allocate and Initialise a condition variable 74 | */ 75 | struct osip_cond *osip_cond_init (void); 76 | /** 77 | * Destroy a condition variable 78 | * @param cond The condition variable to destroy. 79 | */ 80 | int osip_cond_destroy (struct osip_cond *cond); 81 | /** 82 | * Signal the condition variable. 83 | * @param cond The condition variable to signal. 84 | */ 85 | int osip_cond_signal (struct osip_cond *cond); 86 | 87 | /** 88 | * Wait on the condition variable. 89 | * @param cond The condition variable to wait on. 90 | * @param mut The external mutex 91 | */ 92 | int osip_cond_wait (struct osip_cond *cond, struct osip_mutex *mut); 93 | /** 94 | * Timed wait on the condition variable. 95 | * @param cond The condition variable to wait on. 96 | * @param mut The external mutex 97 | * @param abstime time to wait until 98 | */ 99 | int osip_cond_timedwait (struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime); 100 | 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | #endif 106 | /** @} */ 107 | #endif 108 | #endif 109 | -------------------------------------------------------------------------------- /include/osip2/osip_dialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef _DIALOG_H_ 21 | #define _DIALOG_H_ 22 | 23 | #include 24 | 25 | /** 26 | * @file osip_dialog.h 27 | * @brief oSIP dialog Routines 28 | * 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_DIALOG oSIP dialog Handling 33 | * @{ 34 | */ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | 41 | #ifndef DOXYGEN 42 | typedef enum _osip_dialog_type_t { 43 | CALLER, 44 | CALLEE 45 | } osip_dialog_type_t; 46 | #endif 47 | 48 | 49 | /** 50 | * Structure for referencing a dialog. 51 | * @var osip_dialog_t 52 | */ 53 | typedef struct osip_dialog osip_dialog_t; 54 | 55 | 56 | /** 57 | * Structure for referencing a dialog. 58 | * @struct osip_dialog 59 | */ 60 | struct osip_dialog { 61 | char *call_id; /**< Call-ID*/ 62 | char *local_tag; /**< local tag */ 63 | char *remote_tag; /**< remote tag */ 64 | char *line_param; /**< line param from request uri for incoming calls */ 65 | osip_list_t route_set; /**< route set */ 66 | int local_cseq; /**< last local cseq */ 67 | int remote_cseq; /**< last remote cseq*/ 68 | osip_to_t *remote_uri; /**< remote_uri */ 69 | osip_from_t *local_uri; /**< local_uri */ 70 | osip_contact_t *remote_contact_uri; 71 | /**< remote contact_uri */ 72 | int secure; /**< use secure transport layer */ 73 | 74 | osip_dialog_type_t type; /**< type of dialog (CALLEE or CALLER) */ 75 | state_t state; /**< DIALOG_EARLY || DIALOG_CONFIRMED || DIALOG_CLOSED */ 76 | void *your_instance; /**< for application data reference */ 77 | }; 78 | 79 | /** 80 | * Link osip dialog to application 81 | * @param dialog The osip dialog 82 | * @param instance The application instance 83 | */ 84 | #define osip_dialog_set_instance(dialog,instance) (dialog)->your_instance = (void*)(instance) 85 | 86 | /** 87 | * Retrieve application instance from dialog 88 | * @param dialog The osip dialog 89 | * @return instance The application instance 90 | */ 91 | #define osip_dialog_get_instance(dialog) (dialog)->your_instance 92 | 93 | /** 94 | * Allocate a osip_dialog_t element as a UAC. 95 | * NOTE1: The dialog should be created when the first response is received. 96 | * (except for a 100 Trying) 97 | * NOTE2: Remote UA should be compliant! If not (not tag in the to header?) 98 | * the old mechanism is used to match the request but if 2 uncompliant 99 | * UA both answer 200 OK for the same transaction, they won't be detected. 100 | * This is a major BUG in the old rfc. 101 | * @param dialog The element to allocate. 102 | * @param response The response containing the informations. 103 | */ 104 | int osip_dialog_init_as_uac (osip_dialog_t ** dialog, osip_message_t * response); 105 | /** 106 | * Allocate a osip_dialog_t element as a UAC. 107 | *
  • This could be used to initiate dialog with a NOTIFY coming 108 | * before the answer for a subscribe has reached us.
109 | * @param dialog The element to allocate. 110 | * @param next_request The response containing the informations. 111 | * @param local_cseq The local cseq 112 | */ 113 | int osip_dialog_init_as_uac_with_remote_request (osip_dialog_t ** dialog, osip_message_t * next_request, int local_cseq); 114 | 115 | /** 116 | * Allocate a osip_dialog_t element as a UAS. 117 | * NOTE1: The dialog should be created when the first response is sent. 118 | * (except for a 100 Trying) 119 | * @param dialog The element to allocate. 120 | * @param invite The INVITE request containing some informations. 121 | * @param response The response containing other informations. 122 | */ 123 | int osip_dialog_init_as_uas (osip_dialog_t ** dialog, osip_message_t * invite, osip_message_t * response); 124 | /** 125 | * Free all resource in a osip_dialog_t element. 126 | * @param dialog The element to free. 127 | */ 128 | void osip_dialog_free (osip_dialog_t * dialog); 129 | /** 130 | * Set the state of the dialog. 131 | * This is useful to keep information on who is the initiator of the call. 132 | * @param dialog The element to work on. 133 | * @param type The type of dialog (CALLEE or CALLER). 134 | */ 135 | void osip_dialog_set_state (osip_dialog_t * dialog, state_t type); 136 | /** 137 | * Update the Route-Set as UAS of a dialog. 138 | * NOTE: bis-09 says that only INVITE transactions can update the route-set. 139 | * NOTE: bis-09 says that updating the route-set means: update the contact 140 | * field only (AND NOT THE ROUTE-SET). This method follow this behaviour. 141 | * NOTE: This method should be called for each request 142 | * received for a dialog. 143 | * @param dialog The element to work on. 144 | * @param invite The invite received. 145 | */ 146 | int osip_dialog_update_route_set_as_uas (osip_dialog_t * dialog, osip_message_t * invite); 147 | /** 148 | * Update the CSeq (remote cseq) during a UAS transaction of a dialog. 149 | * NOTE: All INCOMING transactions MUST update the remote CSeq. 150 | * @param dialog The element to work on. 151 | * @param request The request received. 152 | */ 153 | int osip_dialog_update_osip_cseq_as_uas (osip_dialog_t * dialog, osip_message_t * request); 154 | 155 | /** 156 | * Match a response received with a dialog. 157 | * @param dialog The element to work on. 158 | * @param response The response received. 159 | */ 160 | int osip_dialog_match_as_uac (osip_dialog_t * dialog, osip_message_t * response); 161 | /** 162 | * Update the tag as UAC of a dialog?. (this could be needed if the 180 163 | * does not contains any tag, but the 200 contains one. 164 | * @param dialog The element to work on. 165 | * @param response The response received. 166 | */ 167 | int osip_dialog_update_tag_as_uac (osip_dialog_t * dialog, osip_message_t * response); 168 | /** 169 | * Update the Route-Set as UAC of a dialog. 170 | * NOTE: bis-09 says that only INVITE transactions can update the route-set. 171 | * NOTE: bis-09 says that updating the route-set means: update the contact 172 | * field only (AND NOT THE ROUTE-SET). This method follow this behaviour. 173 | * NOTE: This method should be called for each request (except 100 Trying) 174 | * received for a dialog. 175 | * @param dialog The element to work on. 176 | * @param response The response received. 177 | */ 178 | int osip_dialog_update_route_set_as_uac (osip_dialog_t * dialog, osip_message_t * response); 179 | 180 | /** 181 | * Match a request (response sent?) received with a dialog. 182 | * @param dialog The element to work on. 183 | * @param request The request received. 184 | */ 185 | int osip_dialog_match_as_uas (osip_dialog_t * dialog, osip_message_t * request); 186 | 187 | /** 188 | * Is dialog initiated by as CALLER 189 | * @param dialog The element to work on. 190 | */ 191 | int osip_dialog_is_originator (osip_dialog_t * dialog); 192 | /** 193 | * Is dialog initiated by as CALLEE 194 | * @param dialog The element to work on. 195 | */ 196 | int osip_dialog_is_callee (osip_dialog_t * dialog); 197 | 198 | 199 | #ifdef __cplusplus 200 | } 201 | #endif 202 | /** @} */ 203 | #endif 204 | -------------------------------------------------------------------------------- /include/osip2/osip_fifo.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef _FIFO_H_ 21 | #define _FIFO_H_ 22 | 23 | #ifndef OSIP_MONOTHREAD 24 | #include 25 | #endif 26 | #include 27 | 28 | /** 29 | * @file osip_fifo.h 30 | * @brief oSIP fifo Routines 31 | * 32 | * This is a very simple implementation of a fifo. 33 | *
There is not much to say about it... 34 | */ 35 | 36 | /** 37 | * @defgroup oSIP_FIFO oSIP fifo Handling 38 | * @ingroup osip2_port 39 | * @{ 40 | */ 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | 47 | #ifndef DOXYGEN 48 | 49 | typedef enum { osip_ok, osip_empty } osip_fifo_state; 50 | 51 | #endif 52 | 53 | /** 54 | * Structure for referencing a fifo. 55 | * @var osip_fifo_t 56 | */ 57 | typedef struct osip_fifo osip_fifo_t; 58 | 59 | /** 60 | * Structure for referencing a fifo. 61 | * @struct osip_fifo 62 | */ 63 | struct osip_fifo { 64 | #ifndef OSIP_MONOTHREAD 65 | struct osip_mutex *qislocked; /**< mutex for fifo */ 66 | struct osip_sem *qisempty; /**< semaphore for fifo */ 67 | #endif 68 | osip_list_t queue; /**< list of nodes containing elements */ 69 | int nb_elt; /**< nb of elements */ 70 | osip_fifo_state state; /**< state of the fifo */ 71 | }; 72 | 73 | /** 74 | * Initialise a osip_fifo_t element. 75 | * NOTE: this element MUST be previously allocated with 76 | * osip_malloc(). The osip_free() call on the fifo is 77 | * still automatically done by osip_fifo_free(). This 78 | * also means you can't use a static osip_fifo_t variable 79 | * if you want to use osip_fifo_free(). 80 | * @param ff The element to initialise. 81 | */ 82 | void osip_fifo_init (osip_fifo_t * ff); 83 | /** 84 | * Free a fifo element. 85 | * @param ff The element to work on. 86 | */ 87 | void osip_fifo_free (osip_fifo_t * ff); 88 | /** 89 | * Insert an element in a fifo (at the beginning). 90 | * @param ff The element to work on. 91 | * @param element The pointer on the element to insert. 92 | */ 93 | int osip_fifo_insert (osip_fifo_t * ff, void *element); 94 | /** 95 | * Add an element in a fifo. 96 | * @param ff The element to work on. 97 | * @param element The pointer on the element to add. 98 | */ 99 | int osip_fifo_add (osip_fifo_t * ff, void *element); 100 | /** 101 | * Get the number of element in a fifo. 102 | * @param ff The element to work on. 103 | */ 104 | int osip_fifo_size (osip_fifo_t * ff); 105 | #ifndef OSIP_MONOTHREAD 106 | /** 107 | * Get an element from a fifo or block until one is added. 108 | * @param ff The element to work on. 109 | */ 110 | void *osip_fifo_get (osip_fifo_t * ff); 111 | #endif 112 | /** 113 | * Try to get an element from a fifo, but do not block if there is no element. 114 | * @param ff The element to work on. 115 | */ 116 | void *osip_fifo_tryget (osip_fifo_t * ff); 117 | 118 | 119 | /** @} */ 120 | 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | #endif 126 | -------------------------------------------------------------------------------- /include/osip2/osip_mt.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef _OSIP_MT_H_ 21 | #define _OSIP_MT_H_ 22 | 23 | #ifndef OSIP_MONOTHREAD 24 | 25 | #include 26 | 27 | /** 28 | * @file osip_mt.h 29 | * @brief oSIP Thread, Mutex and Semaphore definitions 30 | * 31 | * Those methods are only available if the library is compile 32 | * in multi threaded mode. This is the default for oSIP. 33 | */ 34 | 35 | /** 36 | * @defgroup oSIP_THREAD oSIP Thread Routines 37 | * @ingroup osip2_port 38 | * @{ 39 | */ 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * Structure for referencing a thread 47 | * @struct osip_thread 48 | */ 49 | struct osip_thread; 50 | 51 | /** 52 | * Allocate (or initialise if a thread address is given) 53 | * @param stacksize The stack size of the thread. (20000 is a good value) 54 | * @param func The method where the thread start. 55 | * @param arg A pointer on the argument given to the method 'func'. 56 | */ 57 | struct osip_thread *osip_thread_create (int stacksize, void *(*func) (void *), void *arg); 58 | 59 | /** 60 | * Join a thread. 61 | * @param thread The thread to join. 62 | */ 63 | int osip_thread_join (struct osip_thread *thread); 64 | 65 | /** 66 | * Set the priority of a thread. (NOT IMPLEMENTED ON ALL SYSTEMS) 67 | * @param thread The thread to work on. 68 | * @param priority The priority value to set. 69 | */ 70 | int osip_thread_set_priority (struct osip_thread *thread, int priority); 71 | /** 72 | * Exit from a thread. 73 | */ 74 | void osip_thread_exit (void); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | /** @} 80 | * @defgroup oSIP_SEMA oSIP semaphore definitions 81 | * @ingroup osip2_port 82 | * @{ 83 | */ 84 | #ifdef __cplusplus 85 | extern "C" { 86 | #endif 87 | 88 | /** 89 | * Structure for referencing a semaphore element. 90 | * @struct osip_sem 91 | */ 92 | struct osip_sem; 93 | 94 | /** 95 | * Allocate and Initialise a semaphore. 96 | * @param value The initial value for the semaphore. 97 | */ 98 | struct osip_sem *osip_sem_init (unsigned int value); 99 | /** 100 | * Destroy a semaphore. 101 | * @param sem The semaphore to destroy. 102 | */ 103 | int osip_sem_destroy (struct osip_sem *sem); 104 | /** 105 | * Post operation on a semaphore. 106 | * @param sem The semaphore to destroy. 107 | */ 108 | int osip_sem_post (struct osip_sem *sem); 109 | /** 110 | * Wait operation on a semaphore. 111 | * NOTE: this call will block if the semaphore is at 0. 112 | * @param sem The semaphore to destroy. 113 | */ 114 | int osip_sem_wait (struct osip_sem *sem); 115 | /** 116 | * Wait operation on a semaphore. 117 | * NOTE: if the semaphore is at 0, this call won't block. 118 | * @param sem The semaphore to destroy. 119 | */ 120 | int osip_sem_trywait (struct osip_sem *sem); 121 | 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | /** @} 127 | * @defgroup oSIP_MUTEX oSIP mutex definitions 128 | * @ingroup osip2_port 129 | * @{ 130 | */ 131 | #ifdef __cplusplus 132 | extern "C" { 133 | #endif 134 | 135 | /** 136 | * Structure for referencing a mutex element. 137 | * @struct osip_mutex 138 | */ 139 | struct osip_mutex; 140 | 141 | /** 142 | * Allocate and Initialise a mutex. 143 | */ 144 | struct osip_mutex *osip_mutex_init (void); 145 | /** 146 | * Destroy the mutex. 147 | * @param mut The mutex to destroy. 148 | */ 149 | void osip_mutex_destroy (struct osip_mutex *mut); 150 | /** 151 | * Lock the mutex. 152 | * @param mut The mutex to lock. 153 | */ 154 | int osip_mutex_lock (struct osip_mutex *mut); 155 | /** 156 | * Unlock the mutex. 157 | * @param mut The mutex to unlock. 158 | */ 159 | int osip_mutex_unlock (struct osip_mutex *mut); 160 | 161 | #ifdef __cplusplus 162 | } 163 | #endif 164 | /** @} */ 165 | #endif /* OSIP_MONOTHREAD */ 166 | #endif /* end of _THREAD_H_ */ 167 | -------------------------------------------------------------------------------- /include/osip2/osip_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef _OSIP_TIME_H_ 21 | #define _OSIP_TIME_H_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | /* Common time-related functions and data types */ 28 | 29 | #if defined(_WIN32_WCE) 30 | struct _timeb { 31 | time_t time; 32 | unsigned short millitm; 33 | short timezone; 34 | short dstflag; 35 | }; 36 | 37 | #endif 38 | 39 | /* struct timeval, as defined in , or */ 40 | struct timeval; 41 | 42 | /* Time manipulation functions */ 43 | void add_gettimeofday (struct timeval *atv, int ms); 44 | void min_timercmp (struct timeval *tv1, struct timeval *tv2); 45 | 46 | /* Operations on struct timeval */ 47 | #if !defined(timerisset) 48 | #define osip_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 49 | #else 50 | #define osip_timerisset(tvp) timerisset(tvp) 51 | #endif 52 | 53 | #if !defined(timercmp) 54 | #define osip_timercmp(a, b, CMP) \ 55 | (((a)->tv_sec == (b)->tv_sec) ? \ 56 | ((a)->tv_usec CMP (b)->tv_usec) : \ 57 | ((a)->tv_sec CMP (b)->tv_sec)) 58 | #else 59 | #define osip_timercmp(tvp, uvp, cmp) timercmp(tvp,uvp,cmp) 60 | #endif 61 | 62 | #if !defined(timerclear) 63 | #define osip_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 64 | #else 65 | #define osip_timerclear(tvp) timerclear(tvp) 66 | #endif 67 | 68 | int osip_gettimeofday (struct timeval *tp, void *tz); 69 | time_t osip_getsystemtime (time_t * t); 70 | void osip_compensatetime (void); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif 76 | -------------------------------------------------------------------------------- /include/osipparser2/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = headers 3 | 4 | EXTRA_DIST = internal.h 5 | 6 | osipparser2_includedir=$(includedir)/osipparser2 7 | 8 | osipparser2_include_HEADERS=\ 9 | osip_const.h osip_md5.h osip_parser.h osip_uri.h \ 10 | osip_list.h osip_message.h osip_port.h sdp_message.h \ 11 | osip_headers.h osip_body.h 12 | -------------------------------------------------------------------------------- /include/osipparser2/headers/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | osipparser2_headers_includedir=$(includedir)/osipparser2/headers 3 | 4 | osipparser2_headers_include_HEADERS= \ 5 | osip_accept.h osip_contact.h osip_mime_version.h \ 6 | osip_accept_encoding.h osip_content_disposition.h osip_proxy_authenticate.h \ 7 | osip_accept_language.h osip_content_encoding.h osip_proxy_authorization.h\ 8 | osip_alert_info.h osip_content_length.h osip_record_route.h \ 9 | osip_allow.h osip_content_type.h osip_route.h \ 10 | osip_authorization.h osip_cseq.h osip_to.h \ 11 | osip_call_info.h osip_error_info.h osip_via.h \ 12 | osip_call_id.h osip_from.h osip_www_authenticate.h \ 13 | osip_header.h osip_authentication_info.h \ 14 | osip_proxy_authentication_info.h 15 | 16 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_accept.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ACCEPT_H_ 22 | #define _OSIP_ACCEPT_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_accept.h 28 | * @brief oSIP osip_accept header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ACCEPT oSIP accept header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for accept headers. 39 | * @var osip_accept_t 40 | */ 41 | typedef osip_content_type_t osip_accept_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | 49 | /** 50 | * Allocate an Accept element. 51 | * @param header The element to work on. 52 | */ 53 | #define accept_init(header) osip_content_type_init(header) 54 | /** 55 | * Free an Accept element. 56 | * @param header The element to work on. 57 | */ 58 | #define osip_accept_free osip_content_type_free 59 | /** 60 | * Parse an Accept element. 61 | * @param header The element to work on. 62 | * @param hvalue The string to parse. 63 | */ 64 | #define osip_accept_parse(header, hvalue) osip_content_type_parse(header, hvalue) 65 | /** 66 | * Get a string representation of an Accept element. 67 | * @param header The element to work on. 68 | * @param dest A pointer on the new allocated string. 69 | */ 70 | int osip_accept_to_str (const osip_accept_t * header, char **dest); 71 | /** 72 | * Clone an Accept element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_accept_clone osip_content_type_clone 77 | /** 78 | * Allocate and add a header parameter in an Accept element. 79 | * @param header The element to work on. 80 | * @param name The token name. 81 | * @param value The token value. 82 | */ 83 | #define osip_accept_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 84 | /** 85 | * Find a header parameter in an Accept element. 86 | * @param header The element to work on. 87 | * @param name The token name to search. 88 | * @param dest A pointer on the element found. 89 | */ 90 | #define osip_accept_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 91 | 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | /** @} */ 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_accept_encoding.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ACCEPT_ENCONDING_H_ 22 | #define _OSIP_ACCEPT_ENCONDING_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_accept_encoding.h 28 | * @brief oSIP osip_accept_encoding header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ACCEPT_ENCODING oSIP accept-encoding header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Accept-Encoding header. 39 | * @var osip_accept_encoding_t 40 | */ 41 | typedef struct osip_accept_encoding osip_accept_encoding_t; 42 | 43 | /** 44 | * Definition of the Accept-Encoding header. 45 | * @struct osip_accept_encoding 46 | */ 47 | struct osip_accept_encoding 48 | { 49 | char *element; /**< accept encoding main value */ 50 | osip_list_t gen_params; /**< accept encoding parameters */ 51 | }; 52 | 53 | 54 | #ifdef __cplusplus 55 | extern "C" 56 | { 57 | #endif 58 | 59 | /** 60 | * Allocate a Accept-Encoding element. 61 | * @param header The element to work on. 62 | */ 63 | int osip_accept_encoding_init (osip_accept_encoding_t ** header); 64 | /** 65 | * Parse a Accept-Encoding element. 66 | * @param header The element to work on. 67 | * @param hvalue The string to parse. 68 | */ 69 | int osip_accept_encoding_parse (osip_accept_encoding_t * header, const char *hvalue); 70 | /** 71 | * Get a string representation of a Accept-Encoding element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the new allocated string. 74 | */ 75 | int osip_accept_encoding_to_str (const osip_accept_encoding_t * header, char **dest); 76 | /** 77 | * Free a Accept-Encoding element. 78 | * @param header The element to work on. 79 | */ 80 | void osip_accept_encoding_free (osip_accept_encoding_t * header); 81 | /** 82 | * Clone a Accept-Encoding element. 83 | * @param header The element to work on. 84 | * @param dest A pointer on the copy of the element. 85 | */ 86 | int osip_accept_encoding_clone (const osip_accept_encoding_t * header, 87 | osip_accept_encoding_t ** dest); 88 | 89 | /** 90 | * Set the value of an Accept-Encoding element. 91 | * @param header The element to work on. 92 | * @param value The token value to set. 93 | */ 94 | void osip_accept_encoding_set_element (osip_accept_encoding_t * header, 95 | char *value); 96 | /** 97 | * Get the value of an Accept-Encoding element. 98 | * @param header The element to work on. 99 | */ 100 | char *osip_accept_encoding_get_element (const osip_accept_encoding_t * header); 101 | /** 102 | * Allocate and Add a header parameter in an Accept-Encoding element. 103 | * @param header The element to work on. 104 | * @param name The token name for the new parameter. 105 | * @param value The token value for the new parameter. 106 | */ 107 | #define osip_accept_encoding_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 108 | /** 109 | * Find a header parameter in an Accept-Encoding element. 110 | * @param header The element to work on. 111 | * @param name The token name to search. 112 | * @param dest A pointer on the element found. 113 | */ 114 | #define osip_accept_encoding_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 115 | 116 | 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | 121 | /** @} */ 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_accept_language.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ACCEPT_LANGUAGE_H_ 22 | #define _OSIP_ACCEPT_LANGUAGE_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_accept_language.h 28 | * @brief oSIP osip_accept_language header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ACCEPT_LANGUAGE oSIP accept-language header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Accept-Language headers. 39 | * @var osip_accept_language_t 40 | */ 41 | typedef osip_accept_encoding_t osip_accept_language_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate an Accept-Language element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_accept_language_init(header) osip_accept_encoding_init(header) 53 | /** 54 | * Parse an Accept-Language element. 55 | * @param header The element to work on. 56 | * @param hvalue The string to parse. 57 | */ 58 | #define osip_accept_language_parse(header, hvalue) osip_accept_encoding_parse(header, hvalue) 59 | /** 60 | * Get a string representation of an Accept-Language element. 61 | * @param header The element to work on. 62 | * @param dest A pointer on the new allocated string. 63 | */ 64 | #define osip_accept_language_to_str osip_accept_encoding_to_str 65 | /** 66 | * Free an Accept-Language element. 67 | * @param header The element to work on. 68 | */ 69 | #define osip_accept_language_free osip_accept_encoding_free 70 | /** 71 | * Clone an Accept-Language element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the copy of the element. 74 | */ 75 | #define osip_accept_language_clone osip_accept_encoding_clone 76 | 77 | /** 78 | * Get the value of an Accept-Language element. 79 | * @param header The element to work on. 80 | */ 81 | #define osip_accept_language_get_element(header) osip_accept_encoding_get_element(header) 82 | /** 83 | * Set the value of an Accept-Language element. 84 | * @param header The element to work on. 85 | * @param value The value to set. 86 | */ 87 | #define osip_accept_language_set_element(header, value) osip_accept_encoding_set_element(header, value) 88 | /** 89 | * Allocate and add a generic parameter element in an Accept-Language element. 90 | * @param header The element to work on. 91 | * @param name The token name. 92 | * @param value The token value. 93 | */ 94 | #define osip_accept_language_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 95 | /** 96 | * Find a header parameter in a Accept-Language element. 97 | * @param header The element to work on. 98 | * @param name The token name to search. 99 | * @param dest A pointer on the element found. 100 | */ 101 | #define osip_accept_language_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 102 | 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | /** @} */ 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_alert_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ALERT_INFO_H_ 22 | #define _OSIP_ALERT_INFO_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_alert_info.h 28 | * @brief oSIP osip_alert_info header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ALERT_INFO oSIP alert-info definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Alert-Info headers. 39 | * @var osip_alert_info_t 40 | */ 41 | typedef osip_call_info_t osip_alert_info_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Alert-Info element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_alert_info_init(header) osip_call_info_init(header) 53 | /** 54 | * Free a Alert-Info element. 55 | * @param header The element to work on. 56 | */ 57 | #define osip_alert_info_free osip_call_info_free 58 | /** 59 | * Parse a Alert-Info element. 60 | * @param header The element to work on. 61 | * @param hvalue The string to parse. 62 | */ 63 | #define osip_alert_info_parse(header, hvalue) osip_call_info_parse(header, hvalue) 64 | /** 65 | * Get a string representation of a Alert-Info element. 66 | * @param header The element to work on. 67 | * @param dest A pointer on the new allocated string. 68 | */ 69 | #define osip_alert_info_to_str(header,dest) osip_call_info_to_str(header,dest) 70 | /** 71 | * Clone a Alert-Info element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the copy of the element. 74 | */ 75 | #define osip_alert_info_clone osip_call_info_clone 76 | /** 77 | * Get uri from an Alert-Info element. 78 | * @param header The element to work on. 79 | */ 80 | #define osip_alert_info_get_uri(header) osip_call_info_get_uri(header) 81 | /** 82 | * Set the uri of an Alert-Info element. 83 | * @param header The element to work on. 84 | * @param uri The value of the new parameter. 85 | */ 86 | #define osip_alert_info_set_uri(header, uri) osip_call_info_set_uri(header, uri) 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | /** @} */ 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_allow.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ALLOW_H_ 22 | #define _OSIP_ALLOW_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_allow.h 28 | * @brief oSIP osip_allow header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ALLOW oSIP allow header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Allow headers. 39 | * @var osip_allow_t 40 | */ 41 | typedef osip_content_length_t osip_allow_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Allow element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_allow_init(header) osip_content_length_init(header) 53 | /** 54 | * Parse a Allow element. 55 | * @param header The element to work on. 56 | * @param hvalue The string to parse. 57 | */ 58 | #define osip_allow_parse(header, hvalue) osip_content_length_parse(header, hvalue) 59 | /** 60 | * Get a string representation of a Allow element. 61 | * @param header The element to work on. 62 | * @param dest A pointer on the new allocated string. 63 | */ 64 | #define osip_allow_to_str osip_content_length_to_str 65 | /** 66 | * Free a Allow element. 67 | * @param header The element to work on. 68 | */ 69 | #define osip_allow_free osip_content_length_free 70 | /** 71 | * Clone a Allow element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the copy of the element. 74 | */ 75 | #define osip_allow_clone osip_content_length_clone 76 | 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | /** @} */ 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_authentication_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_AUTHENTICATION_INFO_H_ 22 | #define _OSIP_AUTHENTICATION_INFO_H_ 23 | 24 | 25 | /** 26 | * @file osip_authentication_info.h 27 | * @brief oSIP osip_authentication_info header definition. 28 | */ 29 | 30 | /** 31 | * @defgroup oSIP_AUTH_INFO oSIP authentication-info header definition. 32 | * @ingroup oSIP_HEADERS 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Structure for Authentication-Info headers. 38 | * @var osip_authentication_info_t 39 | */ 40 | typedef struct osip_authentication_info osip_authentication_info_t; 41 | 42 | /** 43 | * Definition of the Authentication-Info header. 44 | * @struct osip_authentication_info 45 | */ 46 | struct osip_authentication_info 47 | { 48 | char *auth_type; /**< Authentication Type (Basic or Digest) */ 49 | char *nextnonce; /**< nextnonce value */ 50 | char *qop_options; /**< qop options value */ 51 | char *rspauth; /**< rspauth value */ 52 | char *cnonce; /**< cnonce value */ 53 | char *nonce_count; /**< noncecount value */ 54 | char *snum; /**< snum value */ 55 | char *srand; /**< srand value */ 56 | char *realm; /**< realm value */ 57 | char *targetname; /**< targetname value */ 58 | char *opaque; /**< opaque value */ 59 | }; 60 | 61 | 62 | #ifdef __cplusplus 63 | extern "C" 64 | { 65 | #endif 66 | 67 | /** 68 | * Allocate a Authenication-Info element. 69 | * @param header The element to work on. 70 | */ 71 | int osip_authentication_info_init (osip_authentication_info_t ** header); 72 | /** 73 | * Parse a Authenication-Info element. 74 | * @param header The element to work on. 75 | * @param hvalue The string to parse. 76 | */ 77 | int osip_authentication_info_parse (osip_authentication_info_t * header, const char *hvalue); 78 | /** 79 | * Get a string representation of a Authenication-Info element. 80 | * @param header The element to work on. 81 | * @param dest A pointer on the new allocated string. 82 | */ 83 | int osip_authentication_info_to_str (const osip_authentication_info_t * header, char **dest); 84 | /** 85 | * Free a Authenication-Info element. 86 | * @param header The element to work on. 87 | */ 88 | void osip_authentication_info_free (osip_authentication_info_t * header); 89 | /** 90 | * Clone a Authenication-Info element. 91 | * @param header The element to work on. 92 | * @param dest A pointer on the copy of the element. 93 | */ 94 | int osip_authentication_info_clone (const osip_authentication_info_t * header, 95 | osip_authentication_info_t ** dest); 96 | 97 | 98 | /** 99 | * Get value of the auth_type parameter from a Authenication-Info element. 100 | * @param header The element to work on. 101 | */ 102 | char *osip_authentication_info_get_auth_type (osip_authentication_info_t * header); 103 | /** 104 | * Add the auth_type parameter from a Authenication-Info element. 105 | * @param header The element to work on. 106 | * @param value The value of the new parameter. 107 | */ 108 | void osip_authentication_info_set_auth_type (osip_authentication_info_t * header, char *value); 109 | /** 110 | * Get value of the nextnonce parameter from a Authenication-Info element. 111 | * @param header The element to work on. 112 | */ 113 | char *osip_authentication_info_get_nextnonce (osip_authentication_info_t * header); 114 | /** 115 | * Add the nextnonce parameter from a Authenication-Info element. 116 | * @param header The element to work on. 117 | * @param value The value of the new parameter. 118 | */ 119 | void osip_authentication_info_set_nextnonce (osip_authentication_info_t * header, char *value); 120 | /** 121 | * Get value of the cnonce parameter from a Authenication-Info element. 122 | * @param header The element to work on. 123 | */ 124 | char *osip_authentication_info_get_cnonce (osip_authentication_info_t * header); 125 | /** 126 | * Add the cnonce parameter from a Authenication-Info element. 127 | * @param header The element to work on. 128 | * @param value The value of the new parameter. 129 | */ 130 | void osip_authentication_info_set_cnonce (osip_authentication_info_t * header, char *value); 131 | /** 132 | * Get value of the qop_options parameter from a Authenication-Info element. 133 | * @param header The element to work on. 134 | */ 135 | char *osip_authentication_info_get_qop_options (osip_authentication_info_t * header); 136 | /** 137 | * Add the qop_options parameter from a Authenication-Info element. 138 | * @param header The element to work on. 139 | * @param value The value of the new parameter. 140 | */ 141 | void osip_authentication_info_set_qop_options (osip_authentication_info_t * header, 142 | char *value); 143 | /** 144 | * Get value of the rspauth parameter from a Authenication-Info element. 145 | * @param header The element to work on. 146 | */ 147 | char *osip_authentication_info_get_rspauth (osip_authentication_info_t * header); 148 | /** 149 | * Add the rspauth parameter from a Authenication-Info element. 150 | * @param header The element to work on. 151 | * @param value The value of the new parameter. 152 | */ 153 | void osip_authentication_info_set_rspauth (osip_authentication_info_t * header, char *value); 154 | /** 155 | * Get value of the nc parameter from a Authenication-Info element. 156 | * @param header The element to work on. 157 | */ 158 | char *osip_authentication_info_get_nonce_count (osip_authentication_info_t * header); 159 | /** 160 | * Add the nc parameter from a Authenication-Info element. 161 | * @param header The element to work on. 162 | * @param value The value of the new parameter. 163 | */ 164 | void osip_authentication_info_set_nonce_count (osip_authentication_info_t * header, char *value); 165 | /** 166 | * Get value of the snum parameter from a Authenication-Info element. 167 | * @param header The element to work on. 168 | */ 169 | char *osip_authentication_info_get_snum (osip_authentication_info_t * header); 170 | /** 171 | * Add the snum parameter from a Authenication-Info element. 172 | * @param header The element to work on. 173 | * @param value The value of the new parameter. 174 | */ 175 | void osip_authentication_info_set_snum (osip_authentication_info_t * header, char *value); 176 | /** 177 | * Get value of the srand parameter from a Authenication-Info element. 178 | * @param header The element to work on. 179 | */ 180 | char *osip_authentication_info_get_srand (osip_authentication_info_t * header); 181 | /** 182 | * Add the srand parameter from a Authenication-Info element. 183 | * @param header The element to work on. 184 | * @param value The value of the new parameter. 185 | */ 186 | void osip_authentication_info_set_srand (osip_authentication_info_t * header, char *value); 187 | /** 188 | * Get value of the targetname parameter from a Authenication-Info element. 189 | * @param header The element to work on. 190 | */ 191 | char *osip_authentication_info_get_targetname (osip_authentication_info_t * header); 192 | /** 193 | * Add the targetname parameter from a Authenication-Info element. 194 | * @param header The element to work on. 195 | * @param value The value of the new parameter. 196 | */ 197 | void osip_authentication_info_set_targetname (osip_authentication_info_t * header, char *value); 198 | /** 199 | * Get value of the realm parameter from a Authenication-Info element. 200 | * @param header The element to work on. 201 | */ 202 | char *osip_authentication_info_get_realm (osip_authentication_info_t * header); 203 | /** 204 | * Add the realm parameter from a Authenication-Info element. 205 | * @param header The element to work on. 206 | * @param value The value of the new parameter. 207 | */ 208 | void osip_authentication_info_set_realm (osip_authentication_info_t * header, char *value); 209 | /** 210 | * Get value of the opaque parameter from a Authenication-Info element. 211 | * @param header The element to work on. 212 | */ 213 | char *osip_authentication_info_get_opaque (osip_authentication_info_t * header); 214 | /** 215 | * Add the opaque parameter from a Authenication-Info element. 216 | * @param header The element to work on. 217 | * @param value The value of the new parameter. 218 | */ 219 | void osip_authentication_info_set_opaque (osip_authentication_info_t * header, char *value); 220 | 221 | #ifdef __cplusplus 222 | } 223 | #endif 224 | 225 | /** @} */ 226 | 227 | #endif 228 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_call_id.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CALL_ID_H_ 22 | #define _OSIP_CALL_ID_H_ 23 | 24 | /** 25 | * @file osip_call_id.h 26 | * @brief oSIP osip_call_id header definition. 27 | */ 28 | 29 | /** 30 | * @defgroup oSIP_CALL_ID oSIP call-id header definition. 31 | * @ingroup oSIP_HEADERS 32 | * @{ 33 | */ 34 | 35 | /** 36 | * Structure for Call-Id headers. 37 | * @var osip_call_id_t 38 | */ 39 | typedef struct osip_call_id osip_call_id_t; 40 | 41 | /** 42 | * Definition of the Call-Id header. 43 | * @struct osip_call_id 44 | */ 45 | struct osip_call_id 46 | { 47 | char *number; /**< Call-ID number */ 48 | char *host; /**< Call-ID host information */ 49 | }; 50 | 51 | #ifdef __cplusplus 52 | extern "C" 53 | { 54 | #endif 55 | 56 | /** 57 | * Allocate a Call-id element. 58 | * @param header The element to work on. 59 | */ 60 | int osip_call_id_init (osip_call_id_t ** header); 61 | /** 62 | * Free a Call-id element. 63 | * @param header The element to work on. 64 | */ 65 | void osip_call_id_free (osip_call_id_t * header); 66 | /** 67 | * Parse a Call-id element. 68 | * @param header The element to work on. 69 | * @param hvalue The string to parse. 70 | */ 71 | int osip_call_id_parse (osip_call_id_t * header, const char *hvalue); 72 | /** 73 | * Get a string representation of a Call-id element. 74 | * @param header The element to work on. 75 | * @param dest A pointer on the new allocated string. 76 | */ 77 | int osip_call_id_to_str (const osip_call_id_t * header, char **dest); 78 | /** 79 | * Clone a Call-id element. 80 | * @param header The element to work on. 81 | * @param dest A pointer on the copy of the element. 82 | */ 83 | int osip_call_id_clone (const osip_call_id_t * header, osip_call_id_t ** dest); 84 | /** 85 | * Set the number in the Call-Id element. 86 | * @param header The element to work on. 87 | * @param value The value of the element. 88 | */ 89 | void osip_call_id_set_number (osip_call_id_t * header, char *value); 90 | /** 91 | * Get the number from a Call-Id header. 92 | * @param header The element to work on. 93 | */ 94 | char *osip_call_id_get_number (osip_call_id_t * header); 95 | /** 96 | * Set the host in the Call-Id element. 97 | * @param header The element to work on. 98 | * @param value The value of the element. 99 | */ 100 | void osip_call_id_set_host (osip_call_id_t * header, char *value); 101 | /** 102 | * Get the host from a Call-Id header. 103 | * @param header The element to work on. 104 | */ 105 | char *osip_call_id_get_host (osip_call_id_t * header); 106 | 107 | /** 108 | * Check if the Call-Id headers match. 109 | * NOTE: THIS IS AN INTERNAL METHOD ONLY 110 | * @param callid1 The initial Call-Id header. 111 | * @param callid2 The new Call-Id header. 112 | */ 113 | int osip_call_id_match (osip_call_id_t * callid1, osip_call_id_t * callid2); 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | /** @} */ 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_call_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CALL_INFO_H_ 22 | #define _OSIP_CALL_INFO_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_call_info.h 28 | * @brief oSIP osip_call_info header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_CALL_INFO oSIP call-info header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Call-Info headers. 39 | * @var osip_call_info_t 40 | */ 41 | typedef struct osip_call_info osip_call_info_t; 42 | 43 | /** 44 | * Definition of the Call-Info header. 45 | * @struct osip_call_info 46 | */ 47 | struct osip_call_info 48 | { 49 | char *element; /**< Call-Info main value */ 50 | osip_list_t gen_params; /**< Parameters for Call-Info header */ 51 | }; 52 | 53 | #ifdef __cplusplus 54 | extern "C" 55 | { 56 | #endif 57 | 58 | /** 59 | * Allocate a Call-Info element. 60 | * @param header The element to work on. 61 | */ 62 | int osip_call_info_init (osip_call_info_t ** header); 63 | /** 64 | * Free a Call-Info element. 65 | * @param header The element to work on. 66 | */ 67 | void osip_call_info_free (osip_call_info_t * header); 68 | /** 69 | * Parse a Call-Info element. 70 | * @param header The element to work on. 71 | * @param hvalue The string to parse. 72 | */ 73 | int osip_call_info_parse (osip_call_info_t * header, const char *hvalue); 74 | /** 75 | * Get a string representation of a Call-Info element. 76 | * @param header The element to work on. 77 | * @param dest A pointer on the new allocated string. 78 | */ 79 | int osip_call_info_to_str (const osip_call_info_t * header, char **dest); 80 | /** 81 | * Clone a Call-Info element. 82 | * @param header The element to work on. 83 | * @param dest A pointer on the copy of the element. 84 | */ 85 | int osip_call_info_clone (const osip_call_info_t * header, osip_call_info_t ** dest); 86 | /** 87 | * Get the uri from a Call_Info header. 88 | * @param header The element to work on. 89 | */ 90 | char *osip_call_info_get_uri (osip_call_info_t * header); 91 | /** 92 | * Set the uri in the Call_Info element. 93 | * @param header The element to work on. 94 | * @param uri The value of the element. 95 | */ 96 | void osip_call_info_set_uri (osip_call_info_t * header, char *uri); 97 | 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | /** @} */ 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_contact.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONTACT_H_ 22 | #define _OSIP_CONTACT_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_contact.h 28 | * @brief oSIP osip_contact header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_CONTACT oSIP contact header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Contact headers. 39 | * @var osip_contact_t 40 | */ 41 | typedef osip_from_t osip_contact_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | #ifndef MINISIZE 49 | /** 50 | * Allocate a Contact element. 51 | * @param header The element to work on. 52 | */ 53 | int osip_contact_init (osip_contact_t ** header); 54 | /** 55 | * Free a Contact element. 56 | * @param header The element to work on. 57 | */ 58 | void osip_contact_free (osip_contact_t * header); 59 | #endif 60 | /** 61 | * Parse a Contact element. 62 | * @param header The element to work on. 63 | * @param hvalue The string to parse. 64 | */ 65 | int osip_contact_parse (osip_contact_t * header, const char *hvalue); 66 | /** 67 | * Get a string representation of a Contact element. 68 | * @param header The element to work on. 69 | * @param dest A pointer on the new allocated string. 70 | */ 71 | int osip_contact_to_str (const osip_contact_t * header, char **dest); 72 | #ifndef MINISIZE 73 | /** 74 | * Clone a Contact element. 75 | * @param header The element to work on. 76 | * @param dest A pointer on the copy of the element. 77 | */ 78 | int osip_contact_clone (const osip_contact_t * header, osip_contact_t ** dest); 79 | #else 80 | #define osip_contact_init osip_from_init 81 | #define osip_contact_free osip_from_free 82 | #define osip_contact_clone osip_from_clone 83 | #endif 84 | /** 85 | * Get the displayname from a Contact header. 86 | * @param header The element to work on. 87 | */ 88 | #define osip_contact_get_displayname(header) osip_from_get_displayname((osip_from_t*)header) 89 | /** 90 | * Set the displayname in the Contact element. 91 | * @param header The element to work on. 92 | * @param value The value of the element. 93 | */ 94 | #define osip_contact_set_displayname(header,value) osip_from_set_displayname((osip_from_t*)header, value) 95 | /** 96 | * Get the url from a Contact header. 97 | * @param header The element to work on. 98 | */ 99 | #define osip_contact_get_url(header) osip_from_get_url((osip_from_t*)header) 100 | /** 101 | * Set the url in the Contact element. 102 | * @param header The element to work on. 103 | * @param url The value of the element. 104 | */ 105 | #define osip_contact_set_url(header,url) osip_from_set_url((osip_from_t*)header,url) 106 | /** 107 | * Get a header parameter from a Contact element. 108 | * @param header The element to work on. 109 | * @param pos The index of the element to get. 110 | * @param dest A pointer on the element found. 111 | */ 112 | #define osip_contact_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest) 113 | /** 114 | * Allocate and add a generic parameter element in a list. 115 | * @param header The element to work on. 116 | * @param name The token name. 117 | * @param value The token value. 118 | */ 119 | #define osip_contact_param_add(header,name, value) osip_generic_param_add((&(header)->gen_params), name,value) 120 | /** 121 | * Find a header parameter in a Contact element. 122 | * @param header The element to work on. 123 | * @param name The token name to search. 124 | * @param dest A pointer on the element found. 125 | */ 126 | #define osip_contact_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 127 | 128 | 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | 133 | /** @} */ 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_content_disposition.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONTENT_DISPOSITION_H_ 22 | #define _OSIP_CONTENT_DISPOSITION_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_content_disposition.h 28 | * @brief oSIP osip_content_disposition header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_CONTENT_DISPOSITION oSIP content-disposition definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Content-Disposition headers. 39 | * @var osip_content_disposition_t 40 | */ 41 | typedef osip_call_info_t osip_content_disposition_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Content-Disposition element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_content_disposition_init(header) osip_call_info_init(header) 53 | /** 54 | * Free a Content-Disposition element. 55 | * @param header The element to work on. 56 | */ 57 | #define osip_content_disposition_free(header) osip_call_info_free(header) 58 | /** 59 | * Parse a Content-Disposition element. 60 | * @param header The element to work on. 61 | * @param hvalue The string to parse. 62 | */ 63 | int osip_content_disposition_parse (osip_content_disposition_t * header, 64 | const char *hvalue); 65 | /** 66 | * Get a string representation of a Content-Disposition element. 67 | * @param header The element to work on. 68 | * @param dest A pointer on the new allocated string. 69 | */ 70 | #define osip_content_disposition_to_str(header,dest) osip_call_info_to_str(header,dest) 71 | /** 72 | * Clone a Content-Disposition element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_content_disposition_clone osip_call_info_clone 77 | 78 | /* type is of: "render" | "session" | "icon" | "alert" */ 79 | /** 80 | * Set the type in the Content-Disposition element. 81 | * @param header The element to work on. 82 | * @param value The value of the element. 83 | */ 84 | #define osip_content_disposition_set_type(header, value) osip_call_info_set_uri(header, value) 85 | /** 86 | * Get the type from a Content-Disposition header. 87 | * @param header The element to work on. 88 | */ 89 | #define osip_content_disposition_get_type(header) osip_call_info_get_uri(header) 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | /** @} */ 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_content_encoding.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONTENT_ENCODING_H_ 22 | #define _OSIP_CONTENT_ENCODING_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_content_encoding.h 28 | * @brief oSIP osip_content_encoding header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_CONTENT_ENCODING oSIP content-encoding header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Content-Encoding headers. 39 | * @var osip_content_encoding_t 40 | */ 41 | typedef osip_content_length_t osip_content_encoding_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | 49 | /** 50 | * Allocate a Content-Encoding element. 51 | * @param header The element to work on. 52 | */ 53 | #define osip_content_encoding_init(header) osip_content_length_init(header) 54 | /** 55 | * Parse a Content-Encoding element. 56 | * @param header The element to work on. 57 | * @param hvalue The string to parse. 58 | */ 59 | #define osip_content_encoding_parse(header, hvalue) osip_content_length_parse(header, hvalue) 60 | /** 61 | * Get a string representation of a Content-Encoding element. 62 | * @param header The element to work on. 63 | * @param dest A pointer on the new allocated string. 64 | */ 65 | #define osip_content_encoding_to_str osip_content_length_to_str 66 | /** 67 | * Free a Content-Encoding element. 68 | * @param header The element to work on. 69 | */ 70 | #define osip_content_encoding_free osip_content_length_free 71 | /** 72 | * Clone a Content-Encoding element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_content_encoding_clone osip_content_length_clone 77 | 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | /** @} */ 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_content_length.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONTENT_LENGTH_H_ 22 | #define _OSIP_CONTENT_LENGTH_H_ 23 | 24 | 25 | /** 26 | * @file osip_content_length.h 27 | * @brief oSIP osip_content_length header definition. 28 | */ 29 | 30 | /** 31 | * @defgroup oSIP_CONTENT_LENGTH oSIP content-length definition. 32 | * @ingroup oSIP_HEADERS 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Structure for Content-Length headers. 38 | * @var osip_content_length_t 39 | */ 40 | typedef struct osip_content_length osip_content_length_t; 41 | 42 | /** 43 | * Definition of the Content-Length header. 44 | * @struct osip_content_length 45 | */ 46 | struct osip_content_length 47 | { 48 | char *value; /**< value for Content-Length (size of attachments) */ 49 | }; 50 | 51 | #ifdef __cplusplus 52 | extern "C" 53 | { 54 | #endif 55 | 56 | /** 57 | * Allocate a Content-Length element. 58 | * @param header The element to work on. 59 | */ 60 | int osip_content_length_init (osip_content_length_t ** header); 61 | /** 62 | * Free a Content-Length element. 63 | * @param header The element to work on. 64 | */ 65 | void osip_content_length_free (osip_content_length_t * header); 66 | /** 67 | * Parse a Content-Length element. 68 | * @param header The element to work on. 69 | * @param hvalue The string to parse. 70 | */ 71 | int osip_content_length_parse (osip_content_length_t * header, const char *hvalue); 72 | /** 73 | * Get a string representation of a Content-Length element. 74 | * @param header The element to work on. 75 | * @param dest A pointer on the new allocated string. 76 | */ 77 | int osip_content_length_to_str (const osip_content_length_t * header, char **dest); 78 | /** 79 | * Clone a Content-Length element. 80 | * @param header The element to work on. 81 | * @param dest A pointer on the copy of the element. 82 | */ 83 | int osip_content_length_clone (const osip_content_length_t * header, 84 | osip_content_length_t ** dest); 85 | 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | /** @} */ 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_content_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONTENT_TYPE_H_ 22 | #define _OSIP_CONTENT_TYPE_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_content_type.h 28 | * @brief oSIP osip_content_type header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_CONTENT_TYPE oSIP content-type header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Content-Type headers. 39 | * @var osip_content_type_t 40 | */ 41 | typedef struct osip_content_type osip_content_type_t; 42 | 43 | /** 44 | * Definition of the Content-Type header. 45 | * @struct osip_content_type 46 | */ 47 | struct osip_content_type 48 | { 49 | char *type; /**< Type of attachement */ 50 | char *subtype; /**< Sub-Type of attachement */ 51 | osip_list_t gen_params; /**< Content-Type parameters */ 52 | }; 53 | 54 | #ifdef __cplusplus 55 | extern "C" 56 | { 57 | #endif 58 | 59 | /** 60 | * Allocate a Content-Type element. 61 | * @param header The element to work on. 62 | */ 63 | int osip_content_type_init (osip_content_type_t ** header); 64 | /** 65 | * Free a Content-Type element. 66 | * @param header The element to work on. 67 | */ 68 | void osip_content_type_free (osip_content_type_t * header); 69 | /** 70 | * Parse a Content-Type element. 71 | * @param header The element to work on. 72 | * @param hvalue The string to parse. 73 | */ 74 | int osip_content_type_parse (osip_content_type_t * header, const char *hvalue); 75 | /** 76 | * Get a string representation of a Content-Type element. 77 | * @param header The element to work on. 78 | * @param dest A pointer on the new allocated string. 79 | */ 80 | int osip_content_type_to_str (const osip_content_type_t * header, char **dest); 81 | /** 82 | * Clone a Content-Type element. 83 | * @param header The element to work on. 84 | * @param dest A pointer on the copy of the element. 85 | */ 86 | int osip_content_type_clone (const osip_content_type_t * header, 87 | osip_content_type_t ** dest); 88 | 89 | /** 90 | * Allocate and add a generic parameter element in a list. 91 | * @param header The element to work on. 92 | * @param name The token name. 93 | * @param value The token value. 94 | */ 95 | #define osip_content_type_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 96 | /** 97 | * Find a header parameter in a Content-Type element. 98 | * @param header The element to work on. 99 | * @param name The token name to search. 100 | * @param dest A pointer on the element found. 101 | */ 102 | #define osip_content_type_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 103 | 104 | 105 | #ifdef __cplusplus 106 | } 107 | #endif 108 | 109 | /** @} */ 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_cseq.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CSEQ_H_ 22 | #define _OSIP_CSEQ_H_ 23 | 24 | /** 25 | * @file osip_cseq.h 26 | * @brief oSIP osip_cseq header definition. 27 | */ 28 | 29 | /** 30 | * @defgroup oSIP_CSEQ oSIP cseq header definition. 31 | * @ingroup oSIP_HEADERS 32 | * @{ 33 | */ 34 | 35 | /** 36 | * Structure for CSeq headers. 37 | * @var osip_cseq_t 38 | */ 39 | typedef struct osip_cseq osip_cseq_t; 40 | 41 | /** 42 | * Definition of the CSeq header. 43 | * @struct osip_cseq 44 | */ 45 | struct osip_cseq 46 | { 47 | char *method; /**< CSeq method */ 48 | char *number; /**< CSeq number */ 49 | }; 50 | 51 | #ifdef __cplusplus 52 | extern "C" 53 | { 54 | #endif 55 | 56 | /** 57 | * Allocate a CSeq element. 58 | * @param header The element to work on. 59 | */ 60 | int osip_cseq_init (osip_cseq_t ** header); 61 | /** 62 | * Free a CSeq element. 63 | * @param header The element to work on. 64 | */ 65 | void osip_cseq_free (osip_cseq_t * header); 66 | /** 67 | * Parse a CSeq element. 68 | * @param header The element to work on. 69 | * @param hvalue The string to parse. 70 | */ 71 | int osip_cseq_parse (osip_cseq_t * header, const char *hvalue); 72 | /** 73 | * Get a string representation of a CSeq element. 74 | * @param header The element to work on. 75 | * @param dest A pointer on the new allocated string. 76 | */ 77 | int osip_cseq_to_str (const osip_cseq_t * header, char **dest); 78 | /** 79 | * Clone a CSeq element. 80 | * @param header The element to work on. 81 | * @param dest A pointer on the copy of the element. 82 | */ 83 | int osip_cseq_clone (const osip_cseq_t * header, osip_cseq_t ** dest); 84 | /** 85 | * Set the number in the CSeq element. 86 | * @param header The element to work on. 87 | * @param value The value of the element. 88 | */ 89 | void osip_cseq_set_number (osip_cseq_t * header, char *value); 90 | /** 91 | * Get the number from a CSeq header. 92 | * @param header The element to work on. 93 | */ 94 | char *osip_cseq_get_number (osip_cseq_t * header); 95 | /** 96 | * Set the method in the CSeq element. 97 | * @param header The element to work on. 98 | * @param value The value of the element. 99 | */ 100 | void osip_cseq_set_method (osip_cseq_t * header, char *value); 101 | /** 102 | * Get the method from a CSeq header. 103 | * @param header The element to work on. 104 | */ 105 | char *osip_cseq_get_method (osip_cseq_t * header); 106 | 107 | /** 108 | * Check if the CSeq headers match. 109 | * NOTE: THIS IS AN INTERNAL METHOD ONLY 110 | * @param cseq1 The initial CSeq header. 111 | * @param cseq2 The new CSeq header. 112 | */ 113 | int osip_cseq_match (osip_cseq_t * cseq1, osip_cseq_t * cseq2); 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | /** @} */ 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_error_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_ERROR_INFO_H_ 22 | #define _OSIP_ERROR_INFO_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_error_info.h 28 | * @brief oSIP osip_error_info header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ERROR_INFO oSIP error-info definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Error-Info headers. 39 | * @var osip_error_info_t 40 | */ 41 | typedef osip_call_info_t osip_error_info_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Error-Info element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_error_info_init(header) osip_call_info_init(header) 53 | /** 54 | * Free a Error-Info element. 55 | * @param header The element to work on. 56 | */ 57 | #define osip_error_info_free osip_call_info_free 58 | /** 59 | * Parse a Error-Info element. 60 | * @param header The element to work on. 61 | * @param hvalue The string to parse. 62 | */ 63 | #define osip_error_info_parse(header, hvalue) osip_call_info_parse(header, hvalue) 64 | /** 65 | * Get a string representation of a Error-Info element. 66 | * @param header The element to work on. 67 | * @param dest A pointer on the new allocated string. 68 | */ 69 | #define osip_error_info_to_str(header,dest) osip_call_info_to_str(header,dest) 70 | /** 71 | * Clone a Error-Info element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the copy of the element. 74 | */ 75 | #define osip_error_info_clone osip_call_info_clone 76 | 77 | /** 78 | * Set the uri in the Error-Info element. 79 | * @param header The element to work on. 80 | * @param uri The uri of the element. 81 | */ 82 | #define osip_error_info_set_uri(header, uri) osip_call_info_set_uri(header, uri) 83 | /** 84 | * Get the uri from a Error-Info header. 85 | * @param header The element to work on. 86 | */ 87 | #define osip_error_info_get_uri(header) osip_call_info_get_uri(header) 88 | 89 | 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | /** @} */ 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_from.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_FROM_H_ 22 | #define _OSIP_FROM_H_ 23 | 24 | #include 25 | #include 26 | 27 | /** 28 | * @file osip_from.h 29 | * @brief oSIP osip_from header definition. 30 | */ 31 | 32 | /** 33 | * @defgroup oSIP_FROM oSIP from header definition. 34 | * @ingroup oSIP_HEADERS 35 | * @{ 36 | */ 37 | 38 | /** 39 | * Structure for From headers. 40 | * @var osip_from_t 41 | */ 42 | typedef struct osip_from osip_from_t; 43 | 44 | /** 45 | * Definition of the From header. 46 | * @struct osip_from 47 | */ 48 | struct osip_from 49 | { 50 | char *displayname; /**< Display Name */ 51 | osip_uri_t *url; /**< url */ 52 | osip_list_t gen_params; /**< other From parameters */ 53 | }; 54 | 55 | #ifdef __cplusplus 56 | extern "C" 57 | { 58 | #endif 59 | 60 | /** 61 | * Allocate a From element. 62 | * @param header The element to work on. 63 | */ 64 | int osip_from_init (osip_from_t ** header); 65 | /** 66 | * Free a From element. 67 | * @param header The element to work on. 68 | */ 69 | void osip_from_free (osip_from_t * header); 70 | /** 71 | * Parse a From element. 72 | * @param header The element to work on. 73 | * @param hvalue The string to parse. 74 | */ 75 | int osip_from_parse (osip_from_t * header, const char *hvalue); 76 | /** 77 | * Get a string representation of a From element. 78 | * @param header The element to work on. 79 | * @param dest A pointer on the new allocated string. 80 | */ 81 | int osip_from_to_str (const osip_from_t * header, char **dest); 82 | /** 83 | * Clone a From element. 84 | * @param header The element to work on. 85 | * @param dest A pointer on the copy of the element. 86 | */ 87 | int osip_from_clone (const osip_from_t * header, osip_from_t ** dest); 88 | /** 89 | * Set the displayname in the From element. 90 | * @param header The element to work on. 91 | * @param value The value of the element. 92 | */ 93 | void osip_from_set_displayname (osip_from_t * header, char *value); 94 | /** 95 | * Get the displayname from a From header. 96 | * @param header The element to work on. 97 | */ 98 | char *osip_from_get_displayname (osip_from_t * header); 99 | /** 100 | * Set the url in the From element. 101 | * @param header The element to work on. 102 | * @param url The value of the element. 103 | */ 104 | void osip_from_set_url (osip_from_t * header, osip_uri_t * url); 105 | /** 106 | * Get the url from a From header. 107 | * @param header The element to work on. 108 | */ 109 | osip_uri_t *osip_from_get_url (osip_from_t * header); 110 | /** 111 | * Get a header parameter from a From element. 112 | * @param header The element to work on. 113 | * @param pos The index of the element to get. 114 | * @param dest A pointer on the element found. 115 | */ 116 | int osip_from_param_get (osip_from_t * header, int pos, osip_generic_param_t ** dest); 117 | /** 118 | * Allocate and add a generic parameter element in a list. 119 | * @param header The element to work on. 120 | * @param name The token name. 121 | * @param value The token value. 122 | */ 123 | #define osip_from_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 124 | /** 125 | * Find a header parameter in a From element. 126 | * @param header The element to work on. 127 | * @param name The token name to search. 128 | * @param dest A pointer on the element found. 129 | */ 130 | #define osip_from_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 131 | 132 | /** 133 | * Find the tag parameter in a From element. 134 | * @param header The element to work on. 135 | * @param dest A pointer on the element found. 136 | */ 137 | #define osip_from_get_tag(header,dest) osip_generic_param_get_byname((&(header)->gen_params), "tag",dest) 138 | /** 139 | * Allocate and add a tag parameter element in a Contact element. 140 | * @param header The element to work on. 141 | * @param value The token value. 142 | */ 143 | #define osip_from_set_tag(header,value) osip_generic_param_add((&(header)->gen_params), osip_strdup("tag"),value) 144 | 145 | #ifndef DOXYGEN /* avoid DOXYGEN warning */ 146 | /* Compare the username, host and tag part (if exist) of the two froms */ 147 | int osip_from_compare (osip_from_t * header1, osip_from_t * header2); 148 | #endif 149 | 150 | /** 151 | * Check if the tags in the From headers match. 152 | * NOTE: THIS IS AN INTERNAL METHOD ONLY 153 | * @param from1 The first From header. 154 | * @param from2 The second From header. 155 | */ 156 | int osip_from_tag_match (osip_from_t * from1, osip_from_t * from2); 157 | 158 | 159 | #ifdef __cplusplus 160 | } 161 | #endif 162 | 163 | /** @} */ 164 | 165 | #endif 166 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_header.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_HEADER_H_ 22 | #define _OSIP_HEADER_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_header.h 28 | * @brief oSIP osip_header definition. 29 | * 30 | */ 31 | 32 | /** 33 | * @defgroup oSIP_HEADER oSIP header definition. 34 | * @ingroup oSIP_HEADERS 35 | * @{ 36 | */ 37 | 38 | /** 39 | * Structure for 'unknown' headers. 40 | * NOTE: 'unknown' header' are used in oSIP for all header that are not 41 | * defined by oSIP in the osip_message_t structure. This means that all 42 | * 'unknown' header has to be handled with the API related to this 43 | * structure. 44 | * @var osip_header_t 45 | */ 46 | typedef struct osip_header osip_header_t; 47 | 48 | /** 49 | * Definition of a generic sip header. 50 | * @struct osip_header 51 | */ 52 | struct osip_header 53 | { 54 | char *hname; /**< Name of header */ 55 | char *hvalue; /**< Value for header */ 56 | }; 57 | 58 | /** 59 | * Structure for generic parameter headers. 60 | * Generic parameter are used in a lot of headers. (To, From, Route, 61 | * Record-Route...) All those headers use a common API but this is 62 | * hidden by MACROs that you can be found in smsg.h. 63 | * @var osip_generic_param_t 64 | */ 65 | typedef osip_uri_param_t osip_generic_param_t; 66 | 67 | #ifdef __cplusplus 68 | extern "C" 69 | { 70 | #endif 71 | 72 | /** 73 | * Allocate a header element. 74 | * @param header The element to work on. 75 | */ 76 | int osip_header_init (osip_header_t ** header); 77 | /** 78 | * Free a header element. 79 | * @param header The element to work on. 80 | */ 81 | void osip_header_free (osip_header_t * header); 82 | /** 83 | * Get a string representation of a header element. 84 | * @param header The element to work on. 85 | * @param dest A pointer on the new allocated buffer. 86 | */ 87 | int osip_header_to_str (const osip_header_t * header, char **dest); 88 | /** 89 | * Get the token name a header element. 90 | * @param header The element to work on. 91 | */ 92 | char *osip_header_get_name (const osip_header_t * header); 93 | /** 94 | * Set the token name a header element. 95 | * @param header The element to work on. 96 | * @param pname The token name to set. 97 | */ 98 | void osip_header_set_name (osip_header_t * header, char *pname); 99 | /** 100 | * Get the token value a header element. 101 | * @param header The element to work on. 102 | */ 103 | char *osip_header_get_value (const osip_header_t * header); 104 | /** 105 | * Set the token value a header element. 106 | * @param header The element to work on. 107 | * @param pvalue The token value to set. 108 | */ 109 | void osip_header_set_value (osip_header_t * header, char *pvalue); 110 | /** 111 | * Clone a header element. 112 | * @param header The element to work on. 113 | * @param dest A pointer on the copy of the element. 114 | */ 115 | int osip_header_clone (const osip_header_t * header, osip_header_t ** dest); 116 | 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | /** @} */ 123 | 124 | #endif 125 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_mime_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_MIME_VERSION_H_ 22 | #define _OSIP_MIME_VERSION_H_ 23 | 24 | #include 25 | #include 26 | 27 | /** 28 | * @file osip_mime_version.h 29 | * @brief oSIP osip_mime_version header definition. 30 | */ 31 | 32 | /** 33 | * @defgroup oSIP_MIME_VERSION oSIP mime-version header definition. 34 | * @ingroup oSIP_HEADERS 35 | * @{ 36 | */ 37 | 38 | /** 39 | * Structure for Mime-Version headers. 40 | * @var osip_mime_version_t 41 | */ 42 | typedef osip_content_length_t osip_mime_version_t; 43 | 44 | #ifdef __cplusplus 45 | extern "C" 46 | { 47 | #endif 48 | 49 | /** 50 | * Allocate a Mime-Version element. 51 | * @param header The element to work on. 52 | */ 53 | #define osip_mime_version_init(header) osip_content_length_init(header) 54 | /** 55 | * Parse a Mime-Version element. 56 | * @param header The element to work on. 57 | * @param hvalue The string to parse. 58 | */ 59 | #define osip_mime_version_parse(header, hvalue) osip_content_length_parse(header, hvalue) 60 | /** 61 | * Get a string representation of a Mime-Version element. 62 | * @param header The element to work on. 63 | * @param dest A pointer on the new allocated string. 64 | */ 65 | #define osip_mime_version_to_str(header, dest) osip_content_length_to_str(header, dest) 66 | /** 67 | * Free a Mime-Version element. 68 | * @param header The element to work on. 69 | */ 70 | #define osip_mime_version_free(header) osip_content_length_free(header) 71 | /** 72 | * Clone a Mime-Version element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_mime_version_clone osip_content_length_clone 77 | 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | /** @} */ 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_proxy_authentication_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or(at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_PROXY_AUTHENTICATION_INFO_H_ 22 | #define _OSIP_PROXY_AUTHENTICATION_INFO_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_proxy_authentication_info.h 28 | * @brief oSIP osip_proxy_authentication_info header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_PROXY_AUTH_INFO oSIP proxy-authentication-info header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Proxy-Authentication-Info headers. 39 | * @var osip_proxy_authentication_info_t 40 | */ 41 | typedef osip_authentication_info_t osip_proxy_authentication_info_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Authenication-Info element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_proxy_authentication_info_init(header) osip_authentication_info_init(header) 53 | /** 54 | * Parse a Authenication-Info element. 55 | * @param header The element to work on. 56 | * @param hvalue The string to parse. 57 | */ 58 | #define osip_proxy_authentication_info_parse(header, hvalue) osip_authentication_info_parse(header, hvalue) 59 | /** 60 | * Get a string representation of a Authenication-Info element. 61 | * @param header The element to work on. 62 | * @param dest A pointer on the new allocated string. 63 | */ 64 | #define osip_proxy_authentication_info_to_str(header, dest) osip_authentication_info_to_str(header, dest) 65 | /** 66 | * Free a Authenication-Info element. 67 | * @param header The element to work on. 68 | */ 69 | #define osip_proxy_authentication_info_free osip_authentication_info_free 70 | /** 71 | * Clone a Authenication-Info element. 72 | * @param header The element to work on. 73 | * @param dest A pointer on the copy of the element. 74 | */ 75 | #define osip_proxy_authentication_info_clone osip_authentication_info_clone 76 | 77 | /** 78 | * Get value of the nextnonce parameter from a Authenication-Info element. 79 | * @param header The element to work on. 80 | */ 81 | #define osip_proxy_authentication_info_get_nextnonce(header) osip_authentication_info_get_nextnonce(header) 82 | /** 83 | * Add the nextnonce parameter from a Authenication-Info element. 84 | * @param header The element to work on. 85 | * @param value The value of the new parameter. 86 | */ 87 | #define osip_proxy_authentication_info_set_nextnonce(header, value) osip_authentication_info_set_nextnonce(header, value) 88 | /** 89 | * Get value of the cnonce parameter from a Authenication-Info element. 90 | * @param header The element to work on. 91 | */ 92 | #define osip_proxy_authentication_info_get_cnonce(header) osip_authentication_info_get_cnonce(header) 93 | /** 94 | * Add the cnonce parameter from a Authenication-Info element. 95 | * @param header The element to work on. 96 | * @param value The value of the new parameter. 97 | */ 98 | #define osip_proxy_authentication_info_set_cnonce(header, value) osip_authentication_info_set_cnonce(header, value) 99 | /** 100 | * Get value of the qop_options parameter from a Authenication-Info element. 101 | * @param header The element to work on. 102 | */ 103 | #define osip_proxy_authentication_info_get_qop_options(header) osip_authentication_info_get_qop_options(header) 104 | /** 105 | * Add the qop_options parameter from a Authenication-Info element. 106 | * @param header The element to work on. 107 | * @param value The value of the new parameter. 108 | */ 109 | #define osip_proxy_authentication_info_set_qop_options(header, value) osip_authentication_info_set_qop_options(header, value) 110 | /** 111 | * Get value of the rspauth parameter from a Authenication-Info element. 112 | * @param header The element to work on. 113 | */ 114 | #define osip_proxy_authentication_info_get_rspauth(header) osip_authentication_info_get_rspauth(header) 115 | /** 116 | * Add the rspauth parameter from a Authenication-Info element. 117 | * @param header The element to work on. 118 | * @param value The value of the new parameter. 119 | */ 120 | #define osip_proxy_authentication_info_set_rspauth(header, value) osip_authentication_info_set_rspauth(header, value) 121 | /** 122 | * Get value of the nc parameter from a Authenication-Info element. 123 | * @param header The element to work on. 124 | */ 125 | #define osip_proxy_authentication_info_get_nonce_count(header) osip_authentication_info_get_nonce_count(header) 126 | /** 127 | * Add the nc parameter from a Authenication-Info element. 128 | * @param header The element to work on. 129 | * @param value The value of the new parameter. 130 | */ 131 | #define osip_proxy_authentication_info_set_nonce_count(header, value) osip_authentication_info_set_nonce_count(header, value) 132 | /** 133 | * Get value of the snum parameter from a Authenication-Info element. 134 | * @param header The element to work on. 135 | */ 136 | #define osip_proxy_authentication_info_get_snum(header) osip_authentication_info_get_snum(header) 137 | /** 138 | * Add the snum parameter from a Authenication-Info element. 139 | * @param header The element to work on. 140 | * @param value The value of the new parameter. 141 | */ 142 | #define osip_proxy_authentication_info_set_snum(header, value) osip_authentication_info_set_snum(header, value) 143 | /** 144 | * Get value of the srand parameter from a Authenication-Info element. 145 | * @param header The element to work on. 146 | */ 147 | #define osip_proxy_authentication_info_get_srand(header) osip_authentication_info_get_srand(header) 148 | /** 149 | * Add the srand parameter from a Authenication-Info element. 150 | * @param header The element to work on. 151 | * @param value The value of the new parameter. 152 | */ 153 | #define osip_proxy_authentication_info_set_srand(header, value) osip_authentication_info_set_srand(header, value) 154 | /** 155 | * Get value of the targetname parameter from a Authenication-Info element. 156 | * @param header The element to work on. 157 | */ 158 | #define osip_proxy_authentication_info_get_targetname(header) osip_authentication_info_get_targetname(header) 159 | /** 160 | * Add the targetname parameter from a Authenication-Info element. 161 | * @param header The element to work on. 162 | * @param value The value of the new parameter. 163 | */ 164 | #define osip_proxy_authentication_info_set_targetname(header, value) osip_authentication_info_set_targetname(header, value) 165 | /** 166 | * Get value of the realm parameter from a Authenication-Info element. 167 | * @param header The element to work on. 168 | */ 169 | #define osip_proxy_authentication_info_get_realm(header) osip_authentication_info_get_realm(header) 170 | /** 171 | * Add the realm parameter from a Authenication-Info element. 172 | * @param header The element to work on. 173 | * @param value The value of the new parameter. 174 | */ 175 | #define osip_proxy_authentication_info_set_realm(header, value) osip_authentication_info_set_realm(header, value) 176 | /** 177 | * Get value of the opaque parameter from a Authenication-Info element. 178 | * @param header The element to work on. 179 | */ 180 | #define osip_proxy_authentication_info_get_opaque(header) osip_authentication_info_get_opaque(header) 181 | /** 182 | * Add the opaque parameter from a Authenication-Info element. 183 | * @param header The element to work on. 184 | * @param value The value of the new parameter. 185 | */ 186 | #define osip_proxy_authentication_info_set_opaque(header, value) osip_authentication_info_set_opaque(header, value) 187 | 188 | 189 | #ifdef __cplusplus 190 | } 191 | #endif 192 | 193 | /** @} */ 194 | 195 | #endif 196 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_record_route.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_RECORD_ROUTE_H_ 22 | #define _OSIP_RECORD_ROUTE_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_record_route.h 28 | * @brief oSIP osip_record_route header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_RECORD_ROUTE oSIP record-route header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Record-Route headers. 39 | * @var osip_record_route_t 40 | */ 41 | typedef osip_from_t osip_record_route_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | #ifndef MINISIZE 49 | /** 50 | * Allocate a Record-Route element. 51 | * @param header The element to work on. 52 | */ 53 | int osip_record_route_init (osip_record_route_t ** header); 54 | /** 55 | * Free a Record-Route element. 56 | * @param header The element to work on. 57 | */ 58 | void osip_record_route_free (osip_record_route_t * header); 59 | /** 60 | * Parse a Record-Route element. 61 | * @param header The element to work on. 62 | * @param hvalue The string to parse. 63 | */ 64 | int osip_record_route_parse (osip_record_route_t * header, const char *hvalue); 65 | /** 66 | * Get a string representation of a Record-Route element. 67 | * @param header The element to work on. 68 | * @param dest A pointer on the new allocated string. 69 | */ 70 | int osip_record_route_to_str (const osip_record_route_t * header, char **dest); 71 | /** 72 | * Clone a Record-Route element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_record_route_clone osip_from_clone 77 | #else 78 | #define osip_record_route_init osip_from_init 79 | #define osip_record_route_free osip_from_free 80 | #define osip_record_route_parse osip_from_parse 81 | #define osip_record_route_to_str osip_from_to_str 82 | #define osip_record_route_clone osip_from_clone 83 | #endif 84 | /** 85 | * Set the url in the Record-Route element. 86 | * @param header The element to work on. 87 | * @param url The value of the element. 88 | */ 89 | #define osip_record_route_set_url(header,url) osip_from_set_url((osip_from_t*)header,url) 90 | /** 91 | * Get the url from a Record-Route header. 92 | * @param header The element to work on. 93 | */ 94 | #define osip_record_route_get_url(header) osip_from_get_url((osip_from_t*)header) 95 | /** 96 | * Get a header parameter from a Record-Route element. 97 | * @param header The element to work on. 98 | * @param pos The index of the element to get. 99 | * @param dest A pointer on the element found. 100 | */ 101 | #define osip_record_route_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest) 102 | /** 103 | * Allocate and add a generic parameter element in a list. 104 | * @param header The element to work on. 105 | * @param name The token name. 106 | * @param value The token value. 107 | */ 108 | #define osip_record_route_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 109 | /** 110 | * Find a header parameter in a Record-Route element. 111 | * @param header The element to work on. 112 | * @param name The token name to search. 113 | * @param dest A pointer on the element found. 114 | */ 115 | #define osip_record_route_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 116 | 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | 121 | /** @} */ 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_route.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_RECORD_H_ 22 | #define _OSIP_RECORD_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_route.h 28 | * @brief oSIP osip_route header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_ROUTE oSIP route header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Route headers. 39 | * @var osip_route_t 40 | */ 41 | typedef osip_from_t osip_route_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | #ifndef MINISIZE 49 | /** 50 | * Allocate a Route element. 51 | * @param header The element to work on. 52 | */ 53 | int osip_route_init (osip_route_t ** header); 54 | /** 55 | * Free a Route element. 56 | * @param header The element to work on. 57 | */ 58 | void osip_route_free (osip_route_t * header); 59 | /** 60 | * Parse a Route element. 61 | * @param header The element to work on. 62 | * @param hvalue The string to parse. 63 | */ 64 | int osip_route_parse (osip_route_t * header, const char *hvalue); 65 | /** 66 | * Get a string representation of a Route element. 67 | * @param header The element to work on. 68 | * @param dest A pointer on the new allocated string. 69 | */ 70 | int osip_route_to_str (const osip_route_t * header, char **dest); 71 | /** 72 | * Clone a Route element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | #define osip_route_clone osip_from_clone 77 | #else 78 | #define osip_route_init osip_from_init 79 | #define osip_route_free osip_from_free 80 | #define osip_route_parse osip_from_parse 81 | #define osip_route_to_str osip_from_to_str 82 | #define osip_route_clone osip_from_clone 83 | #endif 84 | /** 85 | * Set the url in the Route element. 86 | * @param header The element to work on. 87 | * @param url The value of the element. 88 | */ 89 | #define osip_route_set_url(header,url) osip_from_set_url((osip_from_t*)header,url) 90 | /** 91 | * Get the url from a Route header. 92 | * @param header The element to work on. 93 | */ 94 | #define osip_route_get_url(header) osip_from_get_url((osip_from_t*)header) 95 | /** 96 | * Get a header parameter from a Route element. 97 | * @param header The element to work on. 98 | * @param pos The index of the element to get. 99 | * @param dest A pointer on the element found. 100 | */ 101 | #define osip_route_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest) 102 | /** 103 | * Allocate and add a generic parameter element in a Route element. 104 | * @param header The element to work on. 105 | * @param name The token name. 106 | * @param value The token value. 107 | */ 108 | #define osip_route_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 109 | /** 110 | * Find a header parameter in a Route element. 111 | * @param header The element to work on. 112 | * @param name The token name to search. 113 | * @param dest A pointer on the element found. 114 | */ 115 | #define osip_route_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 116 | 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | 121 | /** @} */ 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_to.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_TO_H_ 22 | #define _OSIP_TO_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_to.h 28 | * @brief oSIP osip_to header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_TO oSIP to header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for To headers. 39 | * @var osip_to_t 40 | */ 41 | typedef osip_from_t osip_to_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | #ifndef MINISIZE 49 | /** 50 | * Allocate a To element. 51 | * @param header The element to work on. 52 | */ 53 | int osip_to_init (osip_to_t ** header); 54 | /** 55 | * Free a To element. 56 | * @param header The element to work on. 57 | */ 58 | void osip_to_free (osip_to_t * header); 59 | /** 60 | * Parse a To element. 61 | * @param header The element to work on. 62 | * @param hvalue The string to parse. 63 | */ 64 | int osip_to_parse (osip_to_t * header, const char *hvalue); 65 | /** 66 | * Get a string representation of a To element. 67 | * @param header The element to work on. 68 | * @param dest A pointer on the new allocated string. 69 | */ 70 | int osip_to_to_str (const osip_to_t * header, char **dest); 71 | /** 72 | * Clone a To element. 73 | * @param header The element to work on. 74 | * @param dest A pointer on the copy of the element. 75 | */ 76 | int osip_to_clone (const osip_to_t * header, osip_to_t ** dest); 77 | /** 78 | * Check if the tags in the To headers match. 79 | * NOTE: THIS IS AN INTERNAL METHOD ONLY 80 | * @param to1 The first To header. 81 | * @param to2 The second To header. 82 | */ 83 | int osip_to_tag_match (osip_to_t * to1, osip_to_t * to2); 84 | #else 85 | #define osip_to_init osip_from_init 86 | #define osip_to_free osip_from_free 87 | #define osip_to_parse osip_from_parse 88 | #define osip_to_to_str osip_from_to_str 89 | #define osip_to_clone osip_from_clone 90 | #define osip_to_tag_match osip_from_tag_match 91 | #endif 92 | /** 93 | * Set the displayname in the To element. 94 | * @param header The element to work on. 95 | * @param value The value of the element. 96 | */ 97 | #define osip_to_set_displayname(header,value) osip_from_set_displayname((osip_from_t*)header,value) 98 | /** 99 | * Get the displayname from a To header. 100 | * @param header The element to work on. 101 | */ 102 | #define osip_to_get_displayname(header) osip_from_get_displayname((osip_from_t*)header) 103 | /** 104 | * Set the url in the To element. 105 | * @param header The element to work on. 106 | * @param url The value of the element. 107 | */ 108 | #define osip_to_set_url(header,url) osip_from_set_url((osip_from_t*)header,url) 109 | /** 110 | * Get the url from a To header. 111 | * @param header The element to work on. 112 | */ 113 | #define osip_to_get_url(header) osip_from_get_url((osip_from_t*)header) 114 | /** 115 | * Get a header parameter from a To element. 116 | * @param header The element to work on. 117 | * @param pos The index of the element to get. 118 | * @param dest A pointer on the element found. 119 | */ 120 | #define osip_to_param_get(header,pos,dest) osip_from_param_get((osip_from_t*)header,pos,dest) 121 | /** 122 | * Find a header parameter in a To element. 123 | * @param header The element to work on. 124 | * @param name The token name to search. 125 | * @param dest A pointer on the element found. 126 | */ 127 | #define osip_to_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->gen_params),name,dest) 128 | /** 129 | * Allocate and add a generic parameter element in a list. 130 | * @param header The element to work on. 131 | * @param name The token name. 132 | * @param value The token value. 133 | */ 134 | #define osip_to_param_add(header,name,value) osip_generic_param_add((&(header)->gen_params),name,value) 135 | 136 | /** 137 | * Allocate and add a tag parameter element in a list. 138 | * @param header The element to work on. 139 | * @param value The token value. 140 | */ 141 | #define osip_to_set_tag(header,value) osip_generic_param_add((&(header)->gen_params), osip_strdup("tag"),value) 142 | /** 143 | * Find a tag parameter in a To element. 144 | * @param header The element to work on. 145 | * @param dest A pointer on the element found. 146 | */ 147 | #define osip_to_get_tag(header,dest) osip_generic_param_get_byname((&(header)->gen_params), "tag",dest) 148 | 149 | #ifndef DOXYGEN /* avoid DOXYGEN warning */ 150 | /* Compare the username, host and tag part of the two froms */ 151 | #define osip_to_compare(header1, header2) osip_from_compare((osip_from_t *)header1, (osip_from_t *)header2) 152 | #endif 153 | 154 | #ifdef __cplusplus 155 | } 156 | #endif 157 | 158 | /** @} */ 159 | 160 | #endif 161 | -------------------------------------------------------------------------------- /include/osipparser2/headers/osip_via.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_VIA_H_ 22 | #define _OSIP_VIA_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_via.h 28 | * @brief oSIP osip_via header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_VIA oSIP via header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Via headers. 39 | * @var osip_via_t 40 | */ 41 | typedef struct osip_via osip_via_t; 42 | 43 | /** 44 | * Definition of the Via header. 45 | * @struct osip_via 46 | */ 47 | struct osip_via 48 | { 49 | char *version; /**< SIP Version */ 50 | char *protocol; /**< Protocol used by SIP Agent */ 51 | char *host; /**< Host where to send answers */ 52 | char *port; /**< Port where to send answers */ 53 | char *comment; /**< Comments about SIP Agent */ 54 | osip_list_t via_params; /**< Via parameters */ 55 | }; 56 | 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | /** 63 | * Allocate a Via element. 64 | * @param header The element to work on. 65 | */ 66 | int osip_via_init (osip_via_t ** header); 67 | /** 68 | * Free a Via element. 69 | * @param header The element to work on. 70 | */ 71 | void osip_via_free (osip_via_t * header); 72 | /** 73 | * Parse a Via element. 74 | * @param header The element to work on. 75 | * @param hvalue The string to parse. 76 | */ 77 | int osip_via_parse (osip_via_t * header, const char *hvalue); 78 | /** 79 | * Get a string representation of a Via element. 80 | * @param header The element to work on. 81 | * @param dest A pointer on the new allocated string. 82 | */ 83 | int osip_via_to_str (const osip_via_t * header, char **dest); 84 | /** 85 | * Clone a Via element. 86 | * @param header The element to work on. 87 | * @param dest A pointer on the copy of the element. 88 | */ 89 | int osip_via_clone (const osip_via_t * header, osip_via_t ** dest); 90 | /** 91 | * Set the SIP version in the Via element. 92 | * @param header The element to work on. 93 | * @param value The value of the element. 94 | */ 95 | void via_set_version (osip_via_t * header, char *value); 96 | #define osip_via_set_version via_set_version 97 | /** 98 | * Get the SIP version from a Via header. 99 | * @param header The element to work on. 100 | */ 101 | char *via_get_version (osip_via_t * header); 102 | #define osip_via_get_version via_get_version 103 | /** 104 | * Set the protocol in the Via element. 105 | * @param header The element to work on. 106 | * @param value The value of the element. 107 | */ 108 | void via_set_protocol (osip_via_t * header, char *value); 109 | #define osip_via_set_protocol via_set_protocol 110 | /** 111 | * Get the protocol from a Via header. 112 | * @param header The element to work on. 113 | */ 114 | char *via_get_protocol (osip_via_t * header); 115 | #define osip_via_get_protocol via_get_protocol 116 | /** 117 | * Set the host in the Via element. 118 | * @param header The element to work on. 119 | * @param value The value of the element. 120 | */ 121 | void via_set_host (osip_via_t * header, char *value); 122 | #define osip_via_set_host via_set_host 123 | /** 124 | * Get the host from a Via header. 125 | * @param header The element to work on. 126 | */ 127 | char *via_get_host (osip_via_t * header); 128 | #define osip_via_get_host via_get_host 129 | /** 130 | * Set the port in the Via element. 131 | * @param header The element to work on. 132 | * @param value The value of the element. 133 | */ 134 | void via_set_port (osip_via_t * header, char *value); 135 | #define osip_via_set_port via_set_port 136 | /** 137 | * Get the port from a Via header. 138 | * @param header The element to work on. 139 | */ 140 | char *via_get_port (osip_via_t * header); 141 | #define osip_via_get_port via_get_port 142 | /** 143 | * Set the comment in the Via element. 144 | * @param header The element to work on. 145 | * @param value The value of the element. 146 | */ 147 | void via_set_comment (osip_via_t * header, char *value); 148 | #define osip_via_set_comment via_set_comment 149 | /** 150 | * Get the comment from a Via header. 151 | * @param header The element to work on. 152 | */ 153 | char *via_get_comment (osip_via_t * header); 154 | #define osip_via_get_comment via_get_comment 155 | 156 | /** 157 | * Allocate and add a hidden parameter element in a list. 158 | * @param header The element to work on. 159 | */ 160 | #define osip_via_set_hidden(header) osip_generic_param_add((&(header)->via_params),osip_strdup("hidden"),NULL) 161 | /** 162 | * Allocate and add a ttl parameter element in a list. 163 | * @param header The element to work on. 164 | * @param value The token value. 165 | */ 166 | #define osip_via_set_ttl(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("ttl"),value) 167 | /** 168 | * Allocate and add a maddr parameter element in a list. 169 | * @param header The element to work on. 170 | * @param value The token value. 171 | */ 172 | #define osip_via_set_maddr(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("maddr"),value) 173 | /** 174 | * Allocate and add a received parameter element in a list. 175 | * @param header The element to work on. 176 | * @param value The token value. 177 | */ 178 | #define osip_via_set_received(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("received"),value) 179 | /** 180 | * Allocate and add a branch parameter element in a list. 181 | * @param header The element to work on. 182 | * @param value The token value. 183 | */ 184 | #define osip_via_set_branch(header,value) osip_generic_param_add((&(header)->via_params),osip_strdup("branch"),value) 185 | 186 | /** 187 | * Allocate and add a generic parameter element in a list. 188 | * @param header The element to work on. 189 | * @param name The token name. 190 | * @param value The token value. 191 | */ 192 | #define osip_via_param_add(header,name,value) osip_generic_param_add((&(header)->via_params),name,value) 193 | /** 194 | * Find a header parameter in a Via element. 195 | * @param header The element to work on. 196 | * @param name The token name to search. 197 | * @param dest A pointer on the element found. 198 | */ 199 | #define osip_via_param_get_byname(header,name,dest) osip_generic_param_get_byname((&(header)->via_params),name,dest) 200 | 201 | /** 202 | * Check if the Via headers match. 203 | * NOTE: THIS IS AN INTERNAL METHOD ONLY 204 | * @param via1 The first Via header. 205 | * @param via2 The second Via header. 206 | */ 207 | int osip_via_match (osip_via_t * via1, osip_via_t * via2); 208 | 209 | #ifdef __cplusplus 210 | } 211 | #endif 212 | 213 | /** @} */ 214 | 215 | #endif 216 | -------------------------------------------------------------------------------- /include/osipparser2/internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | #ifndef _INTERNALOSIPPARSER_H_ 21 | #define _INTERNALOSIPPARSER_H_ 22 | 23 | #if defined (HAVE_CONFIG_H) 24 | #include 25 | #endif 26 | 27 | #if defined(__PALMOS__) && (__PALMOS__ >= 0x06000000) 28 | #define HAVE_CTYPE_H 1 29 | #define HAVE_STRING_H 1 30 | #define HAVE_SYS_TYPES_H 1 31 | #define HAVE_TIME_H 1 32 | #define HAVE_STDARG_H 1 33 | 34 | #elif defined(__VXWORKS_OS__) || defined(__rtems__) 35 | #define HAVE_STRING_H 1 36 | #define HAVE_TIME_H 1 37 | #define HAVE_SYS_TIME_H 1 38 | #define HAVE_SYS_TYPES_H 1 39 | #define HAVE_STDARG_H 1 40 | 41 | #elif defined _WIN32_WCE 42 | 43 | #define HAVE_CTYPE_H 1 44 | #define HAVE_STRING_H 1 45 | #define HAVE_TIME_H 1 46 | #define HAVE_STDARG_H 1 47 | 48 | #define snprintf _snprintf 49 | 50 | #elif defined(WIN32) 51 | 52 | #define HAVE_CTYPE_H 1 53 | #define HAVE_STRING_H 1 54 | #define HAVE_SYS_TYPES_H 1 55 | #define HAVE_TIME_H 1 56 | #define HAVE_STDARG_H 1 57 | 58 | #if (_MSC_VER < 1900) 59 | #define snprintf _snprintf 60 | #endif 61 | #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_) 62 | #include 63 | #endif 64 | 65 | /* use win32 crypto routines for random number generation */ 66 | /* only use for vs .net (compiler v. 1300) or greater */ 67 | #if _MSC_VER >= 1300 68 | #define WIN32_USE_CRYPTO 1 69 | #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_) 70 | #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) 71 | #undef WIN32_USE_CRYPTO 72 | #elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) 73 | #undef WIN32_USE_CRYPTO 74 | #endif 75 | #endif 76 | #endif 77 | 78 | #endif 79 | 80 | #if defined (HAVE_STRING_H) 81 | #include 82 | #elif defined (HAVE_STRINGS_H) 83 | #include 84 | #else 85 | #include 86 | #endif 87 | 88 | #include 89 | #include 90 | 91 | #if defined (HAVE_SYS_TYPES_H) 92 | #include 93 | #endif 94 | 95 | #ifdef HAVE_TIME_H 96 | #include 97 | #endif 98 | 99 | #if defined (HAVE_SYS_TIME_H) 100 | #include 101 | #endif 102 | 103 | #if defined(__arc__) 104 | #include "includes_api.h" 105 | #include "os_cfg_pub.h" 106 | #include 107 | #endif 108 | 109 | #ifdef __PSOS__ 110 | #define VA_START(a, f) va_start(a, f) 111 | #include "pna.h" 112 | #include "stdlib.h" 113 | #include "time.h" 114 | #define timercmp(tvp, uvp, cmp) \ 115 | ((tvp)->tv_sec cmp (uvp)->tv_sec || \ 116 | (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) 117 | #define snprintf osip_snprintf 118 | #ifndef INT_MAX 119 | #define INT_MAX 0x7FFFFFFF 120 | #endif 121 | #endif 122 | 123 | #endif /* #ifndef _INTERNAL_H_ */ 124 | -------------------------------------------------------------------------------- /include/osipparser2/osip_body.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_BODY_H_ 22 | #define _OSIP_BODY_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_body.h 28 | * @brief oSIP SIP Message Body Routines 29 | * 30 | */ 31 | 32 | /** 33 | * @defgroup oSIP_BODY oSIP body API 34 | * @ingroup osip2_parser 35 | * @{ 36 | */ 37 | 38 | /** 39 | * Structure for holding Body 40 | * @var osip_body_t 41 | */ 42 | typedef struct osip_body osip_body_t; 43 | 44 | /** 45 | * Structure for holding Body 46 | * @struct osip_body 47 | */ 48 | struct osip_body { 49 | char *body; /**< buffer containing data */ 50 | size_t length; /**< length of data */ 51 | osip_list_t *headers; /**< List of headers (when mime is used) */ 52 | osip_content_type_t *content_type; 53 | /**< Content-Type (when mime is used) */ 54 | }; 55 | 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | /** 62 | * Allocate a osip_body_t element. 63 | * @param body The element to work on. 64 | */ 65 | int osip_body_init (osip_body_t ** body); 66 | /** 67 | * Free a osip_body_t element. 68 | * @param body The element to work on. 69 | */ 70 | void osip_body_free (osip_body_t * body); 71 | /** 72 | * Parse a osip_body_t element. 73 | * @param body The element to work on. 74 | * @param buf The buffer to parse. 75 | * @param length The length of the buffer to parse. 76 | */ 77 | int osip_body_parse (osip_body_t * body, const char *buf, size_t length); 78 | /** 79 | * Clone a osip_body_t element. 80 | * @param body The element to clone. 81 | * @param dest The cloned element. 82 | */ 83 | int osip_body_clone (const osip_body_t * body, osip_body_t ** dest); 84 | /** 85 | * Parse a osip_body_t element. (for mime message format) (NOT TESTED, use with care) 86 | * @param body The element to work on. 87 | * @param buf The buffer to parse. 88 | * @param length The length of the buffer to parse. 89 | */ 90 | int osip_body_parse_mime (osip_body_t * body, const char *buf, size_t length); 91 | /** 92 | * Get a string representation of a osip_body_t element. 93 | * @param body The element to work on. 94 | * @param dest The resulting buffer. 95 | * @param length The length of the returned buffer. 96 | */ 97 | int osip_body_to_str (const osip_body_t * body, char **dest, size_t * length); 98 | 99 | /** 100 | * Set the Content-Type header in the osip_body_t element. 101 | * @param body The element to work on. 102 | * @param hvalue The content type string value. 103 | */ 104 | int osip_body_set_contenttype (osip_body_t * body, const char *hvalue); 105 | 106 | /** 107 | * Add a header in the osip_body_t element. 108 | * @param body The element to work on. 109 | * @param hname The header string name. 110 | * @param hvalue The header string value. 111 | */ 112 | int osip_body_set_header (osip_body_t * body, const char *hname, const char *hvalue); 113 | 114 | #ifdef __cplusplus 115 | } 116 | #endif 117 | /** @} */ 118 | #endif 119 | -------------------------------------------------------------------------------- /include/osipparser2/osip_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _OSIP_CONST_H_ 22 | #define _OSIP_CONST_H_ 23 | 24 | #ifdef ENABLE_MPATROL 25 | #include 26 | #endif 27 | 28 | #define OSIP_CRLF "\r\n\0" 29 | #define OSIP_CR "\r\0" 30 | #define OSIP_LF "\n\0" 31 | #define OSIP_SP " \0" 32 | 33 | 34 | #define ACCEPT "accept" 35 | #define ACCEPT_ENCODING "accept-encoding" 36 | #define ACCEPT_LANGUAGE "accept-language" 37 | #define ALERT_INFO "alert-info" 38 | #define ALLOW "allow" 39 | #define AUTHENTICATION_INFO "authentication-info" 40 | #define AUTHORIZATION "authorization" 41 | #define CALL_ID "call-id" 42 | #define CALL_ID_SHORT "i" 43 | #define CALL_INFO "call-info" 44 | #define CONTACT "contact" 45 | #define CONTACT_SHORT "m" 46 | #define CONTENT_DISPOSITION "content-disposition" 47 | #define CONTENT_ENCODING_SHORT "e" 48 | #define CONTENT_ENCODING "content-encoding" 49 | #define CONTENT_LANGUAGE "content-language" 50 | #define CONTENT_LENGTH_SHORT "l" 51 | #define CONTENT_LENGTH "content-length" 52 | #define CONTENT_TYPE_SHORT "c" 53 | #define CONTENT_TYPE "content-type" 54 | #define CSEQ "cseq" 55 | #define SIPDATE "date" 56 | #define ERROR_INFO "error-info" 57 | #define EXPIRES "expires" 58 | #define FROM "from" 59 | #define FROM_SHORT "f" 60 | #define IN_REPLY_TO "in-reply-to" 61 | #define MAX_FORWARDS "max-forwards" 62 | #define MIME_VERSION "mime-version" 63 | #define MIN_EXPIRES "min-expires" 64 | #define ORGANIZATION "organization" 65 | #define PRIORITY "priority" 66 | #define PROXY_AUTHENTICATE "proxy-authenticate" 67 | #define PROXY_AUTHENTICATION_INFO "proxy-authentication-info" 68 | #define PROXY_AUTHORIZATION "proxy-authorization" 69 | #define PROXY_REQUIRE "proxy-require" 70 | #define RECORD_ROUTE "record-route" 71 | #define REPLY_TO "reply-to" 72 | #define REQUIRE "require" 73 | #define RETRY_AFTER "retry-after" 74 | #define ROUTE "route" 75 | #define SERVER "server" 76 | #define SUBJECT "subject" 77 | #define SUBJECT_SHORT "s" 78 | #define SUPPORTED "supported" 79 | #define TIMESTAMP "timestamp" 80 | #define TO "to" 81 | #define TO_SHORT "t" 82 | #define UNSUPPORTED "unsupported" 83 | #define USER_AGENT "user-agent" 84 | #define VIA "via" 85 | #define VIA_SHORT "v" 86 | #define WARNING "warning" 87 | #define WWW_AUTHENTICATE "www-authenticate" 88 | 89 | 90 | #define RESPONSE_CODES 51 91 | 92 | #define SIP_TRYING 100 93 | #define SIP_RINGING 180 94 | #define SIP_CALL_IS_BEING_FORWARDED 181 95 | #define SIP_QUEUED 182 96 | #define SIP_SESSION_PROGRESS 183 97 | #define SIP_OK 200 98 | #define SIP_ACCEPTED 202 99 | #define SIP_MULTIPLE_CHOICES 300 100 | #define SIP_MOVED_PERMANENTLY 301 101 | #define SIP_MOVED_TEMPORARILY 302 102 | #define SIP_USE_PROXY 305 103 | #define SIP_ALTERNATIVE_SERVICE 380 104 | #define SIP_BAD_REQUEST 400 105 | #define SIP_UNAUTHORIZED 401 106 | #define SIP_PAYMENT_REQUIRED 402 107 | #define SIP_FORBIDDEN 403 108 | #define SIP_NOT_FOUND 404 109 | #define SIP_METHOD_NOT_ALLOWED 405 110 | #define SIP_406_NOT_ACCEPTABLE 406 111 | #define SIP_PROXY_AUTHENTICATION_REQUIRED 407 112 | #define SIP_REQUEST_TIME_OUT 408 113 | #define SIP_GONE 410 114 | #define SIP_REQUEST_ENTITY_TOO_LARGE 413 115 | #define SIP_REQUEST_URI_TOO_LARGE 414 116 | #define SIP_UNSUPPORTED_MEDIA_TYPE 415 117 | #define SIP_UNSUPPORTED_URI_SCHEME 416 118 | #define SIP_BAD_EXTENSION 420 119 | #define SIP_EXTENSION_REQUIRED 421 120 | #define SIP_INTERVAL_TOO_BRIEF 423 121 | #define SIP_TEMPORARILY_UNAVAILABLE 480 122 | #define SIP_CALL_TRANSACTION_DOES_NOT_EXIST 481 123 | #define SIP_LOOP_DETECTED 482 124 | #define SIP_TOO_MANY_HOPS 483 125 | #define SIP_ADDRESS_INCOMPLETE 484 126 | #define SIP_AMBIGUOUS 485 127 | #define SIP_BUSY_HERE 486 128 | #define SIP_REQUEST_TERMINATED 487 129 | #define SIP_NOT_ACCEPTABLE_HERE 488 130 | #define SIP_BAD_EVENT 489 131 | #define SIP_REQUEST_PENDING 491 132 | #define SIP_UNDECIPHERABLE 493 133 | #define SIP_INTERNAL_SERVER_ERROR 500 134 | #define SIP_NOT_IMPLEMENTED 501 135 | #define SIP_BAD_GATEWAY 502 136 | #define SIP_SERVICE_UNAVAILABLE 503 137 | #define SIP_SERVER_TIME_OUT 504 138 | #define SIP_VERSION_NOT_SUPPORTED 505 139 | #define SIP_MESSAGE_TOO_LARGE 513 140 | #define SIP_BUSY_EVRYWHERE 600 141 | #define SIP_DECLINE 603 142 | #define SIP_DOES_NOT_EXIST_ANYWHERE 604 143 | #define SIP_606_NOT_ACCEPTABLE 606 144 | 145 | /** is the status code informational */ 146 | #define OSIP_IS_SIP_INFO(x) (((x) >= 100)&&((x) < 200)) 147 | /** is the status code OK ?*/ 148 | #define OSIP_IS_SIP_SUCCESS(x) (((x) >= 200)&&((x) < 300)) 149 | /** is the status code a redirect */ 150 | #define OSIP_IS_SIP_REDIRECT(x) (((x) >= 300)&&((x) < 400)) 151 | /** is the status code a error (client or server) */ 152 | #define OSIP_IS_SIP_ERROR(x) (((x) >= 400)&&((x) < 600)) 153 | /** is the status code a client error */ 154 | #define OSIP_IS_SIP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500)) 155 | /** is the status code a server error */ 156 | #define OSIP_IS_SIP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600)) 157 | 158 | 159 | #endif /* _CONST_H_ */ 160 | -------------------------------------------------------------------------------- /include/osipparser2/osip_headers.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | 22 | #ifndef _OSIP_HEADERS_H_ 23 | #define _OSIP_HEADERS_H_ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | /** 58 | * @file osip_headers.h 59 | * @brief oSIP osip_headers definition. 60 | */ 61 | 62 | /** 63 | * @defgroup oSIP_HEADERS oSIP headers definitions 64 | * @ingroup osip2_parser 65 | * @{ 66 | */ 67 | 68 | /** @} */ 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/osipparser2/osip_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-) 3 | Copyright (C) 2001-2015 Aymeric MOIZARD amoizard@antisip.com 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | 21 | #ifndef _LIST_H_ 22 | #define _LIST_H_ 23 | 24 | #ifdef ENABLE_MPATROL 25 | #include 26 | #endif 27 | 28 | /** 29 | * @file osip_list.h 30 | * @brief oSIP list Routines 31 | * 32 | * This is a simple implementation of a linked list. 33 | */ 34 | 35 | /** 36 | * @defgroup oSIP_LIST oSIP list Handling 37 | * @{ 38 | */ 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | #ifndef DOXYGEN 45 | /** 46 | * Structure for referencing a node in a osip_list_t element. 47 | * @var __node_t 48 | */ 49 | typedef struct __node __node_t; 50 | 51 | /** 52 | * Structure for referencing a node in a osip_list_t element. 53 | * @struct __node 54 | */ 55 | struct __node { 56 | __node_t *next; /**< next __node_t containing element */ 57 | void *element; /**< element in Current node */ 58 | }; 59 | #endif 60 | 61 | /** 62 | * Structure for referencing a list of elements. 63 | * @var osip_list_t 64 | */ 65 | typedef struct osip_list osip_list_t; 66 | 67 | /** 68 | * Structure used to iterate list. 69 | * @var osip_list_iterator_t 70 | */ 71 | typedef struct osip_list_iterator osip_list_iterator_t; 72 | 73 | /** 74 | * Structure used to iterate list. 75 | * @struct osip_list_iterator 76 | */ 77 | struct osip_list_iterator { 78 | __node_t *actual; /**< actual */ 79 | __node_t **prev; /**< prev */ 80 | osip_list_t *li; /**< li */ 81 | int pos; /**< pos */ 82 | }; 83 | 84 | /** 85 | * Structure for referencing a list of elements. 86 | * @struct osip_list 87 | */ 88 | struct osip_list { 89 | 90 | int nb_elt; /**< Number of element in the list */ 91 | __node_t *node; /**< Next node containing element */ 92 | 93 | }; 94 | 95 | /** 96 | * Initialise a osip_list_t element. 97 | * NOTE: this element MUST be previously allocated with 98 | * osip_malloc(). The osip_free() call on the list is 99 | * still automatically done by osip_list_free(). This 100 | * also means you can't use a static osip_list_t variable 101 | * if you want to use osip_list_free(). 102 | * @param li The element to initialise. 103 | */ 104 | int osip_list_init (osip_list_t * li); 105 | /** 106 | * Free a list of element. 107 | * Each element will be free with the method given as the second parameter. 108 | * @param li The element to work on. 109 | * @param free_func The method that is able to release one element of the list. 110 | */ 111 | void osip_list_special_free (osip_list_t * li, void (*free_func) (void *)); 112 | /** 113 | * Clone a list of element. 114 | * Each element will be cloned with the method given as the second parameter. 115 | * @param src The element to work on. 116 | * @param dst The element to work on. 117 | * @param clone_func The method that is able to release one element of the list. 118 | */ 119 | int osip_list_clone (const osip_list_t * src, osip_list_t * dst, int (*clone_func) (void *, void **)); 120 | /** 121 | * Free a list of element where elements are pointer to 'char'. 122 | * @param li The element to work on. 123 | */ 124 | void osip_list_ofchar_free (osip_list_t * li); 125 | /** 126 | * Get the size of a list of element. 127 | * @param li The element to work on. 128 | */ 129 | int osip_list_size (const osip_list_t * li); 130 | /** 131 | * Check if the end of list is detected . 132 | * @param li The element to work on. 133 | * @param pos The index of the possible element. 134 | */ 135 | int osip_list_eol (const osip_list_t * li, int pos); 136 | /** 137 | * Add an element in a list. 138 | * @param li The element to work on. 139 | * @param element The pointer on the element to add. 140 | * @param pos the index of the element to add. (or -1 to append the element at the end) 141 | */ 142 | int osip_list_add (osip_list_t * li, void *element, int pos); 143 | /** 144 | * Get an element from a list. 145 | * @param li The element to work on. 146 | * @param pos the index of the element to get. 147 | */ 148 | void *osip_list_get (const osip_list_t * li, int pos); 149 | /** 150 | * Remove an element from a list. 151 | * @param li The element to work on. 152 | * @param pos the index of the element to remove. 153 | */ 154 | int osip_list_remove (osip_list_t * li, int pos); 155 | 156 | /** 157 | * Check current iterator state. 158 | * @param it The element to work on. 159 | */ 160 | #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt ) 161 | /** 162 | * Get first iterator from list. 163 | * @param li The element to work on. 164 | * @param it The iterator. 165 | */ 166 | void *osip_list_get_first (const osip_list_t * li, osip_list_iterator_t * it); 167 | /** 168 | * GEt next iterator. 169 | * @param it The element to work on. 170 | */ 171 | void *osip_list_get_next (osip_list_iterator_t * it); 172 | /** 173 | * Remove current iterator. 174 | * @param it The element to work on. 175 | */ 176 | void *osip_list_iterator_remove (osip_list_iterator_t * it); 177 | 178 | #ifdef __cplusplus 179 | } 180 | #endif 181 | /** @} */ 182 | #endif 183 | -------------------------------------------------------------------------------- /include/osipparser2/osip_md5.h: -------------------------------------------------------------------------------- 1 | /* MD5.H - header file for MD5C.C 2 | */ 3 | 4 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 | rights reserved. 6 | 7 | License to copy and use this software is granted provided that it 8 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 9 | Algorithm" in all material mentioning or referencing this software 10 | or this function. 11 | 12 | License is also granted to make and use derivative works provided 13 | that such works are identified as "derived from the RSA Data 14 | Security, Inc. MD5 Message-Digest Algorithm" in all material 15 | mentioning or referencing the derived work. 16 | 17 | RSA Data Security, Inc. makes no representations concerning either 18 | the merchantability of this software or the suitability of this 19 | software for any particular purpose. It is provided "as is" 20 | without express or implied warranty of any kind. 21 | 22 | These notices must be retained in any copies of any part of this 23 | documentation and/or software. 24 | */ 25 | 26 | #ifndef _MD5_H_ 27 | #define _MD5_H_ 28 | 29 | #ifndef DOXYGEN 30 | 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* modified for oSIP: GCC supports this feature */ 37 | #define PROTOTYPES 1 38 | 39 | #ifndef PROTOTYPES 40 | #define PROTOTYPES 0 41 | #endif 42 | 43 | /* POINTER defines a generic pointer type */ 44 | typedef unsigned char *POINTER; 45 | 46 | /* UINT2 defines a two byte word */ 47 | typedef unsigned short int UINT2; 48 | 49 | /* UINT4 defines a four byte word */ 50 | typedef unsigned int UINT4; 51 | 52 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 53 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 54 | returns an empty list. 55 | */ 56 | #if PROTOTYPES 57 | #define PROTO_LIST(list) list 58 | #else 59 | #define PROTO_LIST(list) () 60 | #endif 61 | 62 | 63 | /** 64 | * Structure for holding MD5 context. 65 | * @var MD5_CTX 66 | */ 67 | typedef struct { 68 | UINT4 state[4]; /* state (ABCD) */ 69 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 70 | unsigned char buffer[64]; /* input buffer */ 71 | } osip_MD5_CTX; 72 | 73 | void osip_MD5Init PROTO_LIST ((osip_MD5_CTX *)); 74 | void osip_MD5Update PROTO_LIST ((osip_MD5_CTX *, unsigned char *, unsigned int)); 75 | void osip_MD5Final PROTO_LIST ((unsigned char[16], osip_MD5_CTX *)); 76 | 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | #endif 82 | #endif 83 | -------------------------------------------------------------------------------- /lib/eXosip.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/lib/eXosip.lib -------------------------------------------------------------------------------- /lib/libcares.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/lib/libcares.lib -------------------------------------------------------------------------------- /lib/osip2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/lib/osip2.lib -------------------------------------------------------------------------------- /lib/osipparser2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/lib/osipparser2.lib -------------------------------------------------------------------------------- /x64/Release/GB28181_Stress_Tools.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/x64/Release/GB28181_Stress_Tools.exe -------------------------------------------------------------------------------- /x64/Release/bigbuckbunnynoB_480x272.h264: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/husanpao/gb28181_client_windows/3e31b288465f519521c4b8ba9df2219f53cd84e5/x64/Release/bigbuckbunnynoB_480x272.h264 --------------------------------------------------------------------------------