├── work ├── MD5 │ ├── MD5.o │ ├── test.o │ ├── libmd5.a │ ├── HTTPDigest.o │ ├── MD5.pro │ ├── makefile │ ├── HTTPDigest.h │ ├── MD5.h │ ├── test.c │ └── HTTPDigest.c ├── sip │ ├── lib │ │ ├── libmd5.a │ │ ├── libmxml.a │ │ ├── libosip2.a │ │ └── libeXosip.a │ └── include │ │ ├── eXosip2 │ │ ├── Makefile.am │ │ ├── eX_refer.h │ │ ├── eX_publish.h │ │ ├── eX_options.h │ │ ├── eX_message.h │ │ ├── eX_register.h │ │ └── eX_subscribe.h │ │ ├── osip2 │ │ ├── Makefile.am │ │ ├── doxygen.dox.in │ │ ├── osip_time.h │ │ ├── osip_condv.h │ │ ├── osip_fifo.h │ │ ├── osip_mt.h │ │ └── osip_dialog.h │ │ └── osipparser2 │ │ ├── Makefile.am │ │ ├── headers │ │ ├── Makefile.am │ │ ├── osip_allow.h │ │ ├── osip_mime_version.h │ │ ├── osip_content_encoding.h │ │ ├── osip_content_length.h │ │ ├── osip_alert_info.h │ │ ├── osip_error_info.h │ │ ├── osip_accept.h │ │ ├── osip_content_disposition.h │ │ ├── osip_call_info.h │ │ ├── osip_cseq.h │ │ ├── osip_content_type.h │ │ ├── osip_call_id.h │ │ ├── osip_accept_language.h │ │ ├── osip_header.h │ │ ├── osip_route.h │ │ ├── osip_accept_encoding.h │ │ ├── osip_record_route.h │ │ ├── osip_contact.h │ │ ├── osip_from.h │ │ ├── osip_to.h │ │ ├── osip_proxy_authentication_info.h │ │ ├── osip_authentication_info.h │ │ ├── osip_via.h │ │ ├── osip_proxy_authenticate.h │ │ └── osip_www_authenticate.h │ │ ├── osip_md5.h │ │ ├── osip_headers.h │ │ ├── internal.h │ │ ├── osip_body.h │ │ ├── osip_list.h │ │ └── osip_const.h ├── mxml-2.10 │ └── lib │ │ └── libmxml.a ├── include │ ├── pstream.h │ └── mediaServer.h └── cjson │ └── cJSON.h ├── Makefile ├── README.md └── config.json /work/MD5/MD5.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/MD5/MD5.o -------------------------------------------------------------------------------- /work/MD5/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/MD5/test.o -------------------------------------------------------------------------------- /work/MD5/libmd5.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/MD5/libmd5.a -------------------------------------------------------------------------------- /work/MD5/HTTPDigest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/MD5/HTTPDigest.o -------------------------------------------------------------------------------- /work/sip/lib/libmd5.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/sip/lib/libmd5.a -------------------------------------------------------------------------------- /work/sip/lib/libmxml.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/sip/lib/libmxml.a -------------------------------------------------------------------------------- /work/sip/lib/libosip2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/sip/lib/libosip2.a -------------------------------------------------------------------------------- /work/sip/lib/libeXosip.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/sip/lib/libeXosip.a -------------------------------------------------------------------------------- /work/mxml-2.10/lib/libmxml.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/debugger999/gb28181ToH264/HEAD/work/mxml-2.10/lib/libmxml.a -------------------------------------------------------------------------------- /work/sip/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 eX_refer.h \ 7 | eX_subscribe.h eX_publish.h eX_message.h 8 | 9 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | CFLAGS = -Wall -O2 -Iwork/include -Iwork/cjson -Iwork/sip/include 3 | CFLAGS += -Iwork/mxml-2.10/include -Iwork/MD5 4 | LDFLAGS = -Lwork/sip/lib 5 | LDFLAGS += -leXosip -losip2 -lmd5 -lmxml -lpthread -lrt 6 | SRC = main.cpp work/cjson/cJSON.c 7 | 8 | all: 9 | $(CC) $(CFLAGS) $(SRC) $(LDFLAGS) -o gb28181ToH264 10 | 11 | clean: 12 | rm -f *.o gb28181ToH264 13 | 14 | -------------------------------------------------------------------------------- /work/MD5/MD5.pro: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Automatically generated by qmake (2.01a) Tue Jul 1 19:33:55 2014 3 | ###################################################################### 4 | 5 | TEMPLATE = lib 6 | TARGET = MD5 7 | DEPENDPATH += . 8 | INCLUDEPATH += . 9 | 10 | CONFIG += shared 11 | 12 | # Input 13 | HEADERS += HTTPDigest.h MD5.h 14 | SOURCES += HTTPDigest.c MD5.c test.c 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gb28181ToH264 2 | 3 | 1.此工程为linux 64位版本; 4 | 5 | 2.作为上级域,可以对接海康、大华、宇视等国内主流平台; 6 | 7 | 8 | #使用方法 9 | 10 | 1.参考config.json修改配置文件中的厂家平台sipId和本地平台sipId; 11 | 12 | 2../gb28181ToH264运行程序; 13 | 14 | 3.登录厂家GB网关平台或联系厂家技术人员,添加上级域,注意与config.json中本地平台参数一致,如果有鉴权,可以打勾,用户名/密码随便填写; 15 | 16 | 4.正常情况下,本地会收到厂家平台的注册信息,同时在厂家平台看到本地上级域变为在线状态; 17 | 18 | 5.在厂家GB网管平台共享要推送的摄像头; 19 | 20 | 6.摄像头ID可以从厂家平台共享页面查询,也可以通过main.cpp中的函数sendQueryCatalog获取; 21 | 22 | 7.把摄像头ID填写到config.json中; 23 | 24 | 8.重启gb28181ToH264,正常情况下会在本地存储每个摄像头对应的.264文件,可以用Elecard StreamEye播放。 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "gb28181": { 3 | "_comment" : "海康平台sipId,端口号,ip地址", 4 | "platform_id" : "32020200002000000001", 5 | "platform_port" : 7100, 6 | "platform_ip" : "192.168.0.100", 7 | 8 | "_comment" : "本地平台sipId,端口号,ip地址", 9 | "local_id" : "34010000002000000001", 10 | "local_port" : 5060, 11 | "local_ip" : "192.168.0.101" 12 | }, 13 | 14 | "_comment" : "摄像头数目,sipId", 15 | "camera_num" : 2, 16 | "camera1_sip_id" : "18223002001310012922", 17 | "camera1_recv_port" : 5500, 18 | "camera2_sip_id" : "18223002001310012923", 19 | "camera2_recv_port" : 5502 20 | } 21 | -------------------------------------------------------------------------------- /work/MD5/makefile: -------------------------------------------------------------------------------- 1 | # -MM 2 | # -pipe : Use pipes rather than temporary files for communication between the various stages of compilation. 3 | 4 | 5 | CROSS_COMPILE= 6 | CC = $(CROSS_COMPILE)gcc 7 | 8 | CFLAG += -Wall -W -g -Os -o 9 | 10 | AR = $(CROSS_COMPILE)ar crv 11 | RANLIB = $(CROSS_COMPILE)ranlib -t 12 | STRIP = $(CROSS_COMPILE)strip 13 | 14 | 15 | OBJ := MD5.o 16 | OBJ += HTTPDigest.o 17 | OBJ += test.o 18 | 19 | TARGET = libmd5.a 20 | 21 | all: $(OBJ) 22 | #$(CC) -shared $(CFLAG) $(TARGET) $(OBJ) $(LIBS) 23 | $(AR) $(TARGET) $(OBJ) 24 | $(RANLIB) $(TARGET) 25 | chmod 777 $(TARGET) 26 | 27 | $(OBJ): %.o:%.c 28 | $(CC) -c $< $(CFLAG) $@ $(INCLUDE) 29 | 30 | clean: 31 | rm -rf $(OBJ) 32 | 33 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/MD5/HTTPDigest.h: -------------------------------------------------------------------------------- 1 | #define HASHLEN 16 2 | typedef char HASH[HASHLEN]; 3 | #define HASHHEXLEN 32 4 | typedef char HASHHEX[HASHHEXLEN+1]; 5 | #define IN 6 | #define OUT 7 | /* calculate H(A1) as per HTTP Digest spec */ 8 | void DigestCalcHA1 (IN const char *pszAlg, 9 | IN const char *pszUserName, 10 | IN const char *pszRealm, 11 | IN const char *pszPassword, 12 | IN const char *pszNonce, 13 | IN const char *pszCNonce, 14 | OUT HASHHEX SessionKey); 15 | /* calculate request-digest/response-digest as per HTTP Digest spec */ 16 | void DigestCalcResponse (IN HASHHEX HA1, /* H(A1) */ 17 | IN const char *pszNonce, /* nonce from server */ 18 | IN const char *pszNonceCount, /* 8 hex digits */ 19 | IN const char *pszCNonce, /* client nonce */ 20 | IN const char *pszQop, /* qop-value: "", "auth", "auth-int" */ 21 | IN int Aka, /* Calculating AKAv1-MD5 response */ 22 | IN const char *pszMethod, /* method from the request */ 23 | IN const char *pszDigestUri, /* requested URL */ 24 | IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ 25 | OUT HASHHEX Response 26 | /* request-digest or response-digest */ ); 27 | -------------------------------------------------------------------------------- /work/include/pstream.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEDIA_PSTREAM__H__ 2 | #define __MEDIA_PSTREAM__H__ 3 | 4 | #ifndef uint16_t 5 | typedef unsigned short uint16_t; 6 | #endif 7 | #ifndef uint32_t 8 | typedef unsigned int uint32_t; 9 | #endif 10 | 11 | typedef struct RTP_HEADER 12 | { 13 | uint16_t cc:4; 14 | uint16_t extbit:1; 15 | uint16_t padbit:1; 16 | uint16_t version:2; 17 | uint16_t paytype:7; //负载类型 18 | uint16_t markbit:1; //1表示前面的包为一个解码单元,0表示当前解码单元未结束 19 | uint16_t seq_number; //序号 20 | uint32_t timestamp; //时间戳 21 | uint32_t ssrc; //循环校验码 22 | //uint32_t csrc[16]; 23 | } RTP_header_t; 24 | 25 | #pragma pack (1) 26 | typedef union littel_endian_size_s { 27 | unsigned short int length; 28 | unsigned char byte[2]; 29 | } littel_endian_size; 30 | 31 | typedef struct pack_start_code_s { 32 | unsigned char start_code[3]; 33 | unsigned char stream_id[1]; 34 | } pack_start_code; 35 | 36 | typedef struct program_stream_pack_header_s { 37 | pack_start_code PackStart;// 4 38 | unsigned char Buf[9]; 39 | unsigned char stuffinglen; 40 | } program_stream_pack_header; 41 | 42 | typedef struct program_stream_map_s { 43 | pack_start_code PackStart; 44 | littel_endian_size PackLength;//we mast do exchange 45 | //program_stream_info_length 46 | //info 47 | //elementary_stream_map_length 48 | //elem 49 | } program_stream_map; 50 | 51 | typedef struct program_stream_e_s { 52 | pack_start_code PackStart; 53 | littel_endian_size PackLength;//we mast do exchange 54 | char PackInfo1[2]; 55 | unsigned char stuffing_length; 56 | } program_stream_e; 57 | 58 | #endif //__MEDIA_PSTREAM__H__ 59 | 60 | 61 | -------------------------------------------------------------------------------- /work/include/mediaServer.h: -------------------------------------------------------------------------------- 1 | #ifndef ___MEDIA_SERVER_H__ 2 | #define ___MEDIA_SERVER_H__ 3 | 4 | #define APREFIX_NONE "\033[0m" 5 | #define APREFIX_RED "\033[0;31m" 6 | #define APREFIX_GREEN "\033[0;32m" 7 | #define APREFIX_YELLOW "\033[1;33m" 8 | 9 | #define APP_DEBUG(format, args...) printf(APREFIX_GREEN"DEBUG : FILE -> %s, %s, LINE -> %d :" format APREFIX_NONE"\n", __FILE__, __func__, __LINE__, ## args) 10 | #define APP_WARRING(format, args...) printf(APREFIX_YELLOW"WARRING : FILE -> %s, %s, LINE -> %d :" format APREFIX_NONE"\n", __FILE__, __func__, __LINE__, ## args) 11 | #define APP_ERR(format, args...) printf(APREFIX_RED"ERR : FILE -> %s, %s, LINE -> %d :" format APREFIX_NONE"\n", __FILE__, __func__, __LINE__, ## args) 12 | 13 | #define GB28181_CFG_FILE "config.json" 14 | #define CAMERA_SUPPORT_MAX 500 15 | #define RTP_MAXBUF 4096 16 | #define PS_BUF_SIZE (1024*1024*4) 17 | #define H264_FRAME_SIZE_MAX (1024*1024*2) 18 | 19 | typedef struct { 20 | char platformSipId[256]; 21 | char platformIpAddr[128]; 22 | int platformSipPort; 23 | char localSipId[256]; 24 | char localIpAddr[128]; 25 | int localSipPort; 26 | int SN; 27 | struct eXosip_t *eCtx; 28 | int call_id; 29 | int dialog_id; 30 | int registerOk; 31 | int running; 32 | } gb28181Params; 33 | 34 | typedef struct { 35 | char sipId[256]; 36 | int recvPort; 37 | int status; 38 | int statusErrCnt; 39 | FILE *fpH264; 40 | int running; 41 | } CameraParams; 42 | 43 | typedef struct { 44 | int cameraNum; 45 | CameraParams *pCameraParams; 46 | gb28181Params gb28181Param; 47 | int stream_input_type; 48 | int running; 49 | } liveVideoStreamParams; 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/sip/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 API in libosipparser2-@VERSION@. 56 | * 57 | * XXX 58 | */ 59 | 60 | /** 61 | * @defgroup osip2_port The OS port modules 62 | * @brief Thread/Semaphore/Mutex API in libosip2-@VERSION@. 63 | * 64 | * XXX 65 | */ 66 | 67 | /** 68 | * @defgroup osip2_fsm State Machines 69 | * @brief libosip2 APIs for transaction management 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 | -------------------------------------------------------------------------------- /work/MD5/MD5.h: -------------------------------------------------------------------------------- 1 | 2 | /* GLOBAL.H - RSAREF types and constants 3 | */ 4 | /* PROTOTYPES should be set to one if and only if the compiler supports 5 | function argument prototyping. 6 | The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. 7 | */ 8 | 9 | 10 | #ifndef PROTOTYPES 11 | #define PROTOTYPES 0 12 | #endif 13 | /* POINTER defines a generic pointer type */ 14 | typedef unsigned char *POINTER; 15 | /* UINT2 defines a two byte word */ 16 | typedef unsigned short int UINT2; 17 | /* UINT4 defines a four byte word */ 18 | typedef unsigned long int UINT4; 19 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 20 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 21 | returns an empty list. 22 | */ 23 | #if PROTOTYPES 24 | #define PROTO_LIST(list) list 25 | #else 26 | #define PROTO_LIST(list) () 27 | #endif 28 | 29 | 30 | 31 | /* MD5.H - header file for MD5C.C 32 | */ 33 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 34 | rights reserved. 35 | License to copy and use this software is granted provided that it 36 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 37 | Algorithm" in all material mentioning or referencing this software 38 | or this function. 39 | License is also granted to make and use derivative works provided 40 | that such works are identified as "derived from the RSA Data 41 | Security, Inc. MD5 Message-Digest Algorithm" in all material 42 | mentioning or referencing the derived work. 43 | RSA Data Security, Inc. makes no representations concerning either 44 | the merchantability of this software or the suitability of this 45 | software for any particular purpose. It is provided "as is" 46 | without express or implied warranty of any kind. 47 | These notices must be retained in any copies of any part of this 48 | documentation and/or software. 49 | */ 50 | /* MD5 context. */ 51 | 52 | 53 | typedef struct { 54 | UINT4 state[4]; /* state (ABCD) */ 55 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 56 | unsigned char buffer[64]; /* input buffer */ 57 | } MD5_CTX; 58 | 59 | #if 0 60 | void MD5Init PROTO_LIST ((MD5_CTX *)); 61 | void MD5Update PROTO_LIST 62 | ((MD5_CTX *, unsigned char *, unsigned int)); 63 | void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); 64 | #endif 65 | 66 | void MD5Init(MD5_CTX *); 67 | void MD5Update(MD5_CTX *, unsigned char *, unsigned int); 68 | void MD5Final(unsigned char [16], MD5_CTX *); 69 | -------------------------------------------------------------------------------- /work/sip/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 | /* OS-dependent */ 47 | #if defined(WIN32) || defined(_WIN32_WCE) || defined (__VXWORKS_OS__) || defined(__arc__) 48 | /* Operations on struct timeval */ 49 | #define osip_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 50 | #define osip_timercmp(a, b, CMP) \ 51 | (((a)->tv_sec == (b)->tv_sec) ? \ 52 | ((a)->tv_usec CMP (b)->tv_usec) : \ 53 | ((a)->tv_sec CMP (b)->tv_sec)) 54 | #define osip_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 55 | 56 | #else 57 | /* Operations on struct timeval */ 58 | #define osip_timerisset(tvp) timerisset(tvp) 59 | #define osip_timercmp(tvp, uvp, cmp) timercmp(tvp,uvp,cmp) 60 | #define osip_timerclear(tvp) timerclear(tvp) 61 | 62 | #endif 63 | 64 | int osip_gettimeofday (struct timeval *tp, void *tz); 65 | time_t osip_getsystemtime (time_t * t); 66 | void osip_compensatetime (void); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #endif 72 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_allow.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_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(header, dest) osip_content_length_clone(header, dest) 76 | 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | /** @} */ 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_mime_version.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_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(header, dest) osip_content_length_clone(header, dest) 77 | 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | /** @} */ 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_content_encoding.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_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(header, dest) osip_content_length_clone(header, dest) 77 | 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | /** @} */ 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/osip_headers.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 | 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_content_length.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_alert_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_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(header, dest) osip_call_info_clone(header, dest) 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_error_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_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(header, dest) osip_call_info_clone(header, dest) 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 | -------------------------------------------------------------------------------- /work/sip/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 | #ifndef HAVE_STRUCT_TIMESPEC 56 | #define HAVE_STRUCT_TIMESPEC 1 57 | /** 58 | * timespec structure 59 | * @struct timespec 60 | */ 61 | struct timespec { 62 | long tv_sec; 63 | long tv_nsec; 64 | }; 65 | #endif 66 | #endif 67 | 68 | struct osip_cond; 69 | 70 | /** 71 | * Allocate and Initialise a condition variable 72 | */ 73 | struct osip_cond *osip_cond_init (void); 74 | /** 75 | * Destroy a condition variable 76 | * @param cond The condition variable to destroy. 77 | */ 78 | int osip_cond_destroy (struct osip_cond *cond); 79 | /** 80 | * Signal the condition variable. 81 | * @param cond The condition variable to signal. 82 | */ 83 | int osip_cond_signal (struct osip_cond *cond); 84 | 85 | /** 86 | * Wait on the condition variable. 87 | * @param cond The condition variable to wait on. 88 | * @param mut The external mutex 89 | */ 90 | int osip_cond_wait (struct osip_cond *cond, struct osip_mutex *mut); 91 | /** 92 | * Timed wait on the condition variable. 93 | * @param cond The condition variable to wait on. 94 | * @param mut The external mutex 95 | * @param abstime time to wait until 96 | */ 97 | int osip_cond_timedwait (struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime); 98 | 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | #endif 104 | /** @} */ 105 | #endif 106 | #endif 107 | -------------------------------------------------------------------------------- /work/MD5/test.c: -------------------------------------------------------------------------------- 1 | #include "stdio.h" 2 | #include "string.h" 3 | #include "MD5.h" 4 | 5 | #include "HTTPDigest.h" 6 | 7 | #if 0 8 | int main(int argc, _TCHAR* argv[]) 9 | { 10 | char *string = "a"; 11 | MD5_CTX context; 12 | unsigned char digest[16]; 13 | unsigned int len = strlen((const char *)string); 14 | MD5Init(&context); 15 | MD5Update(&context,(unsigned char *)string, len); 16 | MD5Final(digest,&context); 17 | printf ("MD%d (\"%s\") = ",5, string); 18 | 19 | printf ("result:%s\n",digest); 20 | 21 | return 0; 22 | } 23 | #endif 24 | 25 | #if 0 26 | void main(int argc, char ** argv) { 27 | char * pszNonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093"; 28 | char * pszCNonce = "0a4f113b"; 29 | char * pszUser = "Mufasa"; 30 | char * pszRealm = "testrealm@host.com"; 31 | char * pszPass = "Circle Of Life"; 32 | char * pszAlg = "md5"; 33 | char szNonceCount[9] = "00000001"; 34 | char * pszMethod = "GET"; 35 | char * pszQop = "auth"; 36 | char * pszURI = "/dir/index.html"; 37 | HASHHEX HA1; 38 | HASHHEX HA2 = ""; 39 | HASHHEX Response; 40 | DigestCalcHA1(pszAlg, pszUser, pszRealm, pszPass, pszNonce, 41 | pszCNonce, HA1); 42 | DigestCalcResponse(HA1, pszNonce, szNonceCount, pszCNonce, pszQop, 43 | pszMethod, pszURI, HA2, Response); 44 | printf("Response = %s\n", Response); 45 | }; 46 | #endif 47 | 48 | 49 | #if 0 50 | void CvtHex(IN HASH Bin, 51 | OUT HASHHEX Hex); 52 | int main(int argc, char ** argv) 53 | { 54 | char * pszNonce = "6fe9ba44a76be22a"; 55 | char * pszCNonce = "kk"; 56 | char * pszUser = "64010000002020000001"; 57 | char * pszRealm = "64010000"; 58 | char * pszPass = "12345"; 59 | char * pszAlg = "md5"; 60 | char szNonceCount[9] = "00000001"; 61 | char * pszMethod = "REGISTER"; 62 | char * pszQop = "auth"; 63 | char * pszURI = "sip:64010000002000000001@172.18.16.5:5060"; 64 | HASHHEX HA1; 65 | //HASHHEX HA2 = ""; //H(entity body) if qop="auth-int" 66 | HASHHEX Response; 67 | #if 0 68 | DigestCalcHA1(pszAlg, pszUser, pszRealm, pszPass, pszNonce, 69 | pszCNonce, HA1); 70 | DigestCalcResponse(HA1, pszNonce, szNonceCount, pszCNonce, pszQop, 71 | pszMethod, pszURI, HA2, Response); 72 | #endif 73 | 74 | #if 0 //MD5 的计算,一个一个块输入,与整体一起输入,实际上是没有区别的。由下面的实验可以得出结论 75 | char *string = "64010000002020000001:64010000:12345"; 76 | int len = strlen(string); 77 | HASH MD5_HA1; 78 | HASHHEX MD_HA1; 79 | MD5_CTX context; 80 | MD5Init(&context); 81 | MD5Update(&context,(unsigned char *)string, len); 82 | MD5Final(MD5_HA1,&context); 83 | 84 | CvtHex(MD5_HA1,MD_HA1); 85 | printf("MD5Final = %s\n",MD_HA1); 86 | #endif 87 | 88 | DigestCalcHA1(pszAlg, pszUser, pszRealm, pszPass, NULL, 89 | NULL, HA1); 90 | 91 | //在下面这个函数里面,已经计算了 H(A2),所以不需要自己计算 H(A2) 92 | DigestCalcResponse(HA1, pszNonce,NULL,NULL,NULL,0, 93 | pszMethod, pszURI,NULL, Response); 94 | 95 | printf("Response = %s\n", Response); 96 | return 0; 97 | } 98 | #endif 99 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_refer.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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_REFER_H__ 41 | #define __EX_REFER_H__ 42 | 43 | #include 44 | #include 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | /** 51 | * @file eX_refer.h 52 | * @brief eXosip transfer outside of calls API 53 | * 54 | * This file provide the API needed to request a blind transfer 55 | * outside of any call. 56 | * 57 | *
    58 | *
  • build initial refer.
  • 59 | *
  • send initial refer.
  • 60 | *
61 | * 62 | */ 63 | 64 | /** 65 | * @defgroup eXosip2_refer eXosip2 REFER and blind tranfer Management outside of calls 66 | * @ingroup eXosip2_msg 67 | * @{ 68 | */ 69 | 70 | /** 71 | * Build a default REFER message for a blind transfer outside of any calls. 72 | * 73 | * @param excontext eXosip_t instance. 74 | * @param refer Pointer for the SIP element to hold. 75 | * @param refer_to SIP url for transfer. 76 | * @param from SIP url for caller. 77 | * @param to SIP url for callee. 78 | * @param route Route header for REFER. (optional) 79 | */ 80 | int eXosip_refer_build_request (struct eXosip_t *excontext, osip_message_t ** refer, const char *refer_to, const char *from, const char *to, const char *route); 81 | 82 | /** 83 | * Initiate a blind tranfer outside of any call. 84 | * 85 | * @param excontext eXosip_t instance. 86 | * @param refer SIP REFER message to send. 87 | */ 88 | int eXosip_refer_send_request (struct eXosip_t *excontext, osip_message_t * refer); 89 | 90 | /** @} */ 91 | 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | #endif 97 | #endif 98 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_accept.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_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(header, dest) osip_content_type_clone(header, dest) 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_content_disposition.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_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(header, dest) osip_call_info_clone(header, dest) 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_call_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_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 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_publish.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/internal.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 _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 | #define snprintf _snprintf 59 | 60 | #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_) 61 | #include 62 | #endif 63 | 64 | /* use win32 crypto routines for random number generation */ 65 | /* only use for vs .net (compiler v. 1300) or greater */ 66 | #if _MSC_VER >= 1300 67 | #define WIN32_USE_CRYPTO 1 68 | #if (_MSC_VER >= 1700) && !defined(_USING_V110_SDK71_) 69 | #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) 70 | #undef WIN32_USE_CRYPTO 71 | #elif defined(WINAPI_FAMILY) && WINAPI_FAMILY_ONE_PARTITION( WINAPI_FAMILY, WINAPI_PARTITION_APP ) 72 | #undef WIN32_USE_CRYPTO 73 | #endif 74 | #endif 75 | #endif 76 | 77 | #endif 78 | 79 | #if defined (HAVE_STRING_H) 80 | #include 81 | #elif defined (HAVE_STRINGS_H) 82 | #include 83 | #else 84 | #include 85 | #endif 86 | 87 | #include 88 | #include 89 | 90 | #if defined (HAVE_SYS_TYPES_H) 91 | #include 92 | #endif 93 | 94 | #ifdef HAVE_TIME_H 95 | #include 96 | #endif 97 | 98 | #if defined (HAVE_SYS_TIME_H) 99 | #include 100 | #endif 101 | 102 | #if defined(__arc__) 103 | #include "includes_api.h" 104 | #include "os_cfg_pub.h" 105 | #include 106 | #endif 107 | 108 | #ifdef __PSOS__ 109 | #define VA_START(a, f) va_start(a, f) 110 | #include "pna.h" 111 | #include "stdlib.h" 112 | #include "time.h" 113 | #define timercmp(tvp, uvp, cmp) \ 114 | ((tvp)->tv_sec cmp (uvp)->tv_sec || \ 115 | (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec) 116 | #define snprintf osip_snprintf 117 | #ifndef INT_MAX 118 | #define INT_MAX 0x7FFFFFFF 119 | #endif 120 | #endif 121 | 122 | #endif /* #ifndef _INTERNAL_H_ */ 123 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_cseq.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_content_type.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_call_id.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_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 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_accept_language.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_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(header, dest) osip_accept_encoding_clone(header, dest) 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_header.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/osip_body.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_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 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_route.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_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 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_message.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_accept_encoding.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_record_route.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_contact.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_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 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_register.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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 | -------------------------------------------------------------------------------- /work/MD5/HTTPDigest.c: -------------------------------------------------------------------------------- 1 | #include "MD5.h" 2 | #include 3 | #include "HTTPDigest.h" 4 | 5 | void CvtHex( 6 | IN HASH Bin, 7 | OUT HASHHEX Hex 8 | ) 9 | { 10 | unsigned short i; 11 | unsigned char j; 12 | for (i = 0; i < HASHLEN; i++) { 13 | j = (Bin[i] >> 4) & 0xf; 14 | if (j <= 9) 15 | Hex[i*2] = (j + '0'); 16 | else 17 | Hex[i*2] = (j + 'a' - 10); 18 | j = Bin[i] & 0xf; 19 | if (j <= 9) 20 | Hex[i*2+1] = (j + '0'); 21 | else 22 | Hex[i*2+1] = (j + 'a' - 10); 23 | }; 24 | Hex[HASHHEXLEN] = '\0'; 25 | } 26 | 27 | /* calculate H(A1) as per spec */ 28 | void 29 | DigestCalcHA1 (IN const char *pszAlg, 30 | IN const char *pszUserName, 31 | IN const char *pszRealm, 32 | IN const char *pszPassword, 33 | IN const char *pszNonce, 34 | IN const char *pszCNonce, 35 | OUT HASHHEX SessionKey) 36 | { 37 | MD5_CTX Md5Ctx; 38 | HASH HA1; 39 | 40 | MD5Init (&Md5Ctx); 41 | MD5Update (&Md5Ctx, (unsigned char *) pszUserName, (unsigned int) strlen (pszUserName)); 42 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 43 | MD5Update (&Md5Ctx, (unsigned char *) pszRealm, (unsigned int) strlen (pszRealm)); 44 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 45 | MD5Update (&Md5Ctx, (unsigned char *) pszPassword, (unsigned int) strlen (pszPassword)); 46 | MD5Final ((unsigned char *) HA1, &Md5Ctx); 47 | if ((pszAlg != NULL) && strcasecmp (pszAlg, "md5-sess") == 0) { 48 | MD5Init (&Md5Ctx); 49 | MD5Update (&Md5Ctx, (unsigned char *) HA1, HASHLEN); 50 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 51 | MD5Update (&Md5Ctx, (unsigned char *) pszNonce, (unsigned int) strlen (pszNonce)); 52 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 53 | MD5Update (&Md5Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen (pszCNonce)); 54 | MD5Final ((unsigned char *) HA1, &Md5Ctx); 55 | } 56 | CvtHex (HA1, SessionKey); 57 | } 58 | 59 | /* calculate request-digest/response-digest as per HTTP Digest spec */ 60 | void 61 | DigestCalcResponse (IN HASHHEX HA1, /* H(A1) */ 62 | IN const char *pszNonce, /* nonce from server */ 63 | IN const char *pszNonceCount, /* 8 hex digits */ 64 | IN const char *pszCNonce, /* client nonce */ 65 | IN const char *pszQop, /* qop-value: "", "auth", "auth-int" */ 66 | IN int Aka, /* Calculating AKAv1-MD5 response */ 67 | IN const char *pszMethod, /* method from the request */ 68 | IN const char *pszDigestUri, /* requested URL */ 69 | IN HASHHEX HEntity, /* H(entity body) if qop="auth-int" */ 70 | OUT HASHHEX Response 71 | /* request-digest or response-digest */ ) 72 | { 73 | MD5_CTX Md5Ctx; 74 | HASH HA2; 75 | HASH RespHash; 76 | HASHHEX HA2Hex; 77 | 78 | /* calculate H(A2) */ 79 | MD5Init (&Md5Ctx); 80 | MD5Update (&Md5Ctx, (unsigned char *) pszMethod, (unsigned int) strlen (pszMethod)); 81 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 82 | MD5Update (&Md5Ctx, (unsigned char *) pszDigestUri, (unsigned int) strlen (pszDigestUri)); 83 | 84 | if (pszQop == NULL) { 85 | goto auth_withoutqop; 86 | } 87 | else if (0 == strcasecmp (pszQop, "auth-int")) { 88 | goto auth_withauth_int; 89 | } 90 | else if (0 == strcasecmp (pszQop, "auth")) { 91 | goto auth_withauth; 92 | } 93 | 94 | auth_withoutqop: 95 | MD5Final ((unsigned char *) HA2, &Md5Ctx); 96 | CvtHex (HA2, HA2Hex); 97 | 98 | /* calculate response */ 99 | MD5Init (&Md5Ctx); 100 | MD5Update (&Md5Ctx, (unsigned char *) HA1, HASHHEXLEN); 101 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 102 | MD5Update (&Md5Ctx, (unsigned char *) pszNonce, (unsigned int) strlen (pszNonce)); 103 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 104 | 105 | goto end; 106 | 107 | auth_withauth_int: 108 | 109 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 110 | MD5Update (&Md5Ctx, (unsigned char *) HEntity, HASHHEXLEN); 111 | 112 | auth_withauth: 113 | MD5Final ((unsigned char *) HA2, &Md5Ctx); 114 | CvtHex (HA2, HA2Hex); 115 | 116 | /* calculate response */ 117 | MD5Init (&Md5Ctx); 118 | MD5Update (&Md5Ctx, (unsigned char *) HA1, HASHHEXLEN); 119 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 120 | MD5Update (&Md5Ctx, (unsigned char *) pszNonce, (unsigned int) strlen (pszNonce)); 121 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 122 | if (Aka == 0) { 123 | MD5Update (&Md5Ctx, (unsigned char *) pszNonceCount, (unsigned int) strlen (pszNonceCount)); 124 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 125 | MD5Update (&Md5Ctx, (unsigned char *) pszCNonce, (unsigned int) strlen (pszCNonce)); 126 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 127 | MD5Update (&Md5Ctx, (unsigned char *) pszQop, (unsigned int) strlen (pszQop)); 128 | MD5Update (&Md5Ctx, (unsigned char *) ":", 1); 129 | } 130 | end: 131 | MD5Update (&Md5Ctx, (unsigned char *) HA2Hex, HASHHEXLEN); 132 | MD5Final ((unsigned char *) RespHash, &Md5Ctx); 133 | CvtHex (RespHash, Response); 134 | } 135 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_from.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_to.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_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 | -------------------------------------------------------------------------------- /work/sip/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(header, dest) osip_authentication_info_clone(header, dest) 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 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | /** @} */ 139 | 140 | #endif 141 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/osip_list.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 _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 { 72 | __node_t *actual; /**< actual */ 73 | __node_t **prev; /**< prev */ 74 | osip_list_t *li; /**< li */ 75 | int pos; /**< pos */ 76 | } osip_list_iterator_t; 77 | 78 | /** 79 | * Structure for referencing a list of elements. 80 | * @struct osip_list 81 | */ 82 | struct osip_list { 83 | 84 | int nb_elt; /**< Number of element in the list */ 85 | __node_t *node; /**< Next node containing element */ 86 | 87 | }; 88 | 89 | /** 90 | * Initialise a osip_list_t element. 91 | * NOTE: this element MUST be previously allocated with 92 | * osip_malloc(). The osip_free() call on the list is 93 | * still automatically done by osip_list_free(). This 94 | * also means you can't use a static osip_list_t variable 95 | * if you want to use osip_list_free(). 96 | * @param li The element to initialise. 97 | */ 98 | int osip_list_init (osip_list_t * li); 99 | /** 100 | * Free a list of element. 101 | * Each element will be free with the method given as the second parameter. 102 | * @param li The element to work on. 103 | * @param free_func The method that is able to release one element of the list. 104 | */ 105 | void osip_list_special_free (osip_list_t * li, void (*free_func) (void *)); 106 | /** 107 | * Clone a list of element. 108 | * Each element will be cloned with the method given as the second parameter. 109 | * @param src The element to work on. 110 | * @param dst The element to work on. 111 | * @param clone_func The method that is able to release one element of the list. 112 | */ 113 | int osip_list_clone (const osip_list_t * src, osip_list_t * dst, int (*clone_func) (void *, void **)); 114 | /** 115 | * Free a list of element where elements are pointer to 'char'. 116 | * @param li The element to work on. 117 | */ 118 | void osip_list_ofchar_free (osip_list_t * li); 119 | /** 120 | * Get the size of a list of element. 121 | * @param li The element to work on. 122 | */ 123 | int osip_list_size (const osip_list_t * li); 124 | /** 125 | * Check if the end of list is detected . 126 | * @param li The element to work on. 127 | * @param pos The index of the possible element. 128 | */ 129 | int osip_list_eol (const osip_list_t * li, int pos); 130 | /** 131 | * Add an element in a list. 132 | * @param li The element to work on. 133 | * @param element The pointer on the element to add. 134 | * @param pos the index of the element to add. (or -1 to append the element at the end) 135 | */ 136 | int osip_list_add (osip_list_t * li, void *element, int pos); 137 | /** 138 | * Get an element from a list. 139 | * @param li The element to work on. 140 | * @param pos the index of the element to get. 141 | */ 142 | void *osip_list_get (const osip_list_t * li, int pos); 143 | /** 144 | * Remove an element from a list. 145 | * @param li The element to work on. 146 | * @param pos the index of the element to remove. 147 | */ 148 | int osip_list_remove (osip_list_t * li, int pos); 149 | 150 | /** 151 | * Check current iterator state. 152 | * @param it The element to work on. 153 | */ 154 | #define osip_list_iterator_has_elem( it ) ( 0 != (it).actual && (it).pos < (it).li->nb_elt ) 155 | /** 156 | * Get first iterator from list. 157 | * @param li The element to work on. 158 | * @param it The iterator. 159 | */ 160 | void *osip_list_get_first (osip_list_t * li, osip_list_iterator_t * it); 161 | /** 162 | * GEt next iterator. 163 | * @param it The element to work on. 164 | */ 165 | void *osip_list_get_next (osip_list_iterator_t * it); 166 | /** 167 | * Remove current iterator. 168 | * @param it The element to work on. 169 | */ 170 | void *osip_list_iterator_remove (osip_list_iterator_t * it); 171 | 172 | #ifdef __cplusplus 173 | } 174 | #endif 175 | /** @} */ 176 | #endif 177 | -------------------------------------------------------------------------------- /work/sip/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 *nextnonce; /**< nextnonce value */ 49 | char *qop_options; /**< qop options value */ 50 | char *rspauth; /**< rspauth value */ 51 | char *cnonce; /**< cnonce value */ 52 | char *nonce_count; /**< noncecount value */ 53 | }; 54 | 55 | 56 | #ifdef __cplusplus 57 | extern "C" 58 | { 59 | #endif 60 | 61 | /** 62 | * Allocate a Authenication-Info element. 63 | * @param header The element to work on. 64 | */ 65 | int osip_authentication_info_init (osip_authentication_info_t ** header); 66 | /** 67 | * Parse a Authenication-Info element. 68 | * @param header The element to work on. 69 | * @param hvalue The string to parse. 70 | */ 71 | int osip_authentication_info_parse (osip_authentication_info_t * header, const char *hvalue); 72 | /** 73 | * Get a string representation of a Authenication-Info element. 74 | * @param header The element to work on. 75 | * @param dest A pointer on the new allocated string. 76 | */ 77 | int osip_authentication_info_to_str (const osip_authentication_info_t * header, char **dest); 78 | /** 79 | * Free a Authenication-Info element. 80 | * @param header The element to work on. 81 | */ 82 | void osip_authentication_info_free (osip_authentication_info_t * header); 83 | /** 84 | * Clone a Authenication-Info element. 85 | * @param header The element to work on. 86 | * @param dest A pointer on the copy of the element. 87 | */ 88 | int osip_authentication_info_clone (const osip_authentication_info_t * header, 89 | osip_authentication_info_t ** dest); 90 | 91 | 92 | /** 93 | * Get value of the nextnonce parameter from a Authenication-Info element. 94 | * @param header The element to work on. 95 | */ 96 | char *osip_authentication_info_get_nextnonce (osip_authentication_info_t * header); 97 | /** 98 | * Add the nextnonce parameter from a Authenication-Info element. 99 | * @param header The element to work on. 100 | * @param value The value of the new parameter. 101 | */ 102 | void osip_authentication_info_set_nextnonce (osip_authentication_info_t * header, char *value); 103 | /** 104 | * Get value of the cnonce parameter from a Authenication-Info element. 105 | * @param header The element to work on. 106 | */ 107 | char *osip_authentication_info_get_cnonce (osip_authentication_info_t * header); 108 | /** 109 | * Add the cnonce parameter from a Authenication-Info element. 110 | * @param header The element to work on. 111 | * @param value The value of the new parameter. 112 | */ 113 | void osip_authentication_info_set_cnonce (osip_authentication_info_t * header, char *value); 114 | /** 115 | * Get value of the qop_options parameter from a Authenication-Info element. 116 | * @param header The element to work on. 117 | */ 118 | char *osip_authentication_info_get_qop_options (osip_authentication_info_t * header); 119 | /** 120 | * Add the qop_options parameter from a Authenication-Info element. 121 | * @param header The element to work on. 122 | * @param value The value of the new parameter. 123 | */ 124 | void osip_authentication_info_set_qop_options (osip_authentication_info_t * header, 125 | char *value); 126 | /** 127 | * Get value of the rspauth parameter from a Authenication-Info element. 128 | * @param header The element to work on. 129 | */ 130 | char *osip_authentication_info_get_rspauth (osip_authentication_info_t * header); 131 | /** 132 | * Add the rspauth parameter from a Authenication-Info element. 133 | * @param header The element to work on. 134 | * @param value The value of the new parameter. 135 | */ 136 | void osip_authentication_info_set_rspauth (osip_authentication_info_t * header, char *value); 137 | /** 138 | * Get value of the nc parameter from a Authenication-Info element. 139 | * @param header The element to work on. 140 | */ 141 | char *osip_authentication_info_get_nonce_count (osip_authentication_info_t * header); 142 | /** 143 | * Add the nc parameter from a Authenication-Info element. 144 | * @param header The element to work on. 145 | * @param value The value of the new parameter. 146 | */ 147 | void osip_authentication_info_set_nonce_count (osip_authentication_info_t * header, char *value); 148 | 149 | 150 | #ifdef __cplusplus 151 | } 152 | #endif 153 | 154 | /** @} */ 155 | 156 | #endif 157 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/osip_const.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_CONST_H_ 22 | #define _OSIP_CONST_H_ 23 | 24 | #ifdef ENABLE_MPATROL 25 | #include 26 | #endif 27 | 28 | #define CRLF "\r\n\0" 29 | #define CR "\r\0" 30 | #define LF "\n\0" 31 | #define 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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_via.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_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 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_proxy_authenticate.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_AUHTHENTICATE_H_ 22 | #define _OSIP_PROXY_AUHTHENTICATE_H_ 23 | 24 | #include 25 | 26 | /** 27 | * @file osip_proxy_authenticate.h 28 | * @brief oSIP osip_proxy_authenticate header definition. 29 | */ 30 | 31 | /** 32 | * @defgroup oSIP_PROXY_AUTHENTICATE oSIP proxy-authenticate header definition. 33 | * @ingroup oSIP_HEADERS 34 | * @{ 35 | */ 36 | 37 | /** 38 | * Structure for Proxy-Authenticate headers. 39 | * @var osip_proxy_authenticate_t 40 | */ 41 | typedef osip_www_authenticate_t osip_proxy_authenticate_t; 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /** 49 | * Allocate a Proxy-Authenticate element. 50 | * @param header The element to work on. 51 | */ 52 | #define osip_proxy_authenticate_init(header) osip_www_authenticate_init(header) 53 | /** 54 | * Parse a Proxy-Authenticate element. 55 | * @param header The element to work on. 56 | * @param hvalue The string to parse. 57 | */ 58 | #define osip_proxy_authenticate_parse(header, hvalue) osip_www_authenticate_parse(header, hvalue) 59 | /** 60 | * Get a string representation of a Proxy-Authenticate element. 61 | * @param header The element to work on. 62 | * @param dest A pointer on the new allocated string. 63 | */ 64 | #define osip_proxy_authenticate_to_str(header, dest) osip_www_authenticate_to_str(header, dest) 65 | /** 66 | * Free a Proxy-Authenticate element. 67 | * @param header The element to work on. 68 | */ 69 | #define osip_proxy_authenticate_free osip_www_authenticate_free 70 | /** 71 | * Clone a Proxy-Authenticate 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_authenticate_clone osip_www_authenticate_clone 76 | 77 | /** 78 | * Get value of the auth_type parameter from a Proxy-Authenticate element. 79 | * @param header The element to work on. 80 | */ 81 | #define osip_proxy_authenticate_get_auth_type(header) osip_www_authenticate_get_auth_type(header) 82 | /** 83 | * Add the auth_type parameter from a Proxy-Authenticate element. 84 | * @param header The element to work on. 85 | * @param value The value of the new parameter. 86 | */ 87 | #define osip_proxy_authenticate_set_auth_type(header,value) osip_www_authenticate_set_auth_type(header, value) 88 | /** 89 | * Get value of the realm parameter from a Proxy-Authenticate element. 90 | * @param header The element to work on. 91 | */ 92 | #define osip_proxy_authenticate_get_realm(header) osip_www_authenticate_get_realm(header) 93 | /** 94 | * Add the realm parameter from a Proxy-Authenticate element. 95 | * @param header The element to work on. 96 | * @param value The value of the new parameter. 97 | */ 98 | #define osip_proxy_authenticate_set_realm(header, value) osip_www_authenticate_set_realm(header, value) 99 | /** 100 | * Get value of the domain parameter from a Proxy-Authenticate element. 101 | * @param header The element to work on. 102 | */ 103 | #define osip_proxy_authenticate_get_domain(header) osip_www_authenticate_get_domain(header) 104 | /** 105 | * Add the domain parameter from a Proxy-Authenticate element. 106 | * @param header The element to work on. 107 | * @param value The value of the new parameter. 108 | */ 109 | #define osip_proxy_authenticate_set_domain(header, value) osip_www_authenticate_set_domain(header, value) 110 | /** 111 | * Get value of the nonce parameter from a Proxy-Authenticate element. 112 | * @param header The element to work on. 113 | */ 114 | #define osip_proxy_authenticate_get_nonce(header) osip_www_authenticate_get_nonce(header) 115 | /** 116 | * Add the nonce parameter from a Proxy-Authenticate element. 117 | * @param header The element to work on. 118 | * @param value The value of the new parameter. 119 | */ 120 | #define osip_proxy_authenticate_set_nonce(header, value) osip_www_authenticate_set_nonce(header, value) 121 | /** 122 | * Get value of the opaque parameter from a Proxy-Authenticate element. 123 | * @param header The element to work on. 124 | */ 125 | #define osip_proxy_authenticate_get_opaque(header) osip_www_authenticate_get_opaque(header) 126 | /** 127 | * Add the opaque parameter from a Proxy-Authenticate element. 128 | * @param header The element to work on. 129 | * @param value The value of the new parameter. 130 | */ 131 | #define osip_proxy_authenticate_set_opaque(header, value) osip_www_authenticate_set_opaque(header, value) 132 | /** 133 | * Get value of the stale parameter from a Proxy-Authenticate element. 134 | * @param header The element to work on. 135 | */ 136 | #define osip_proxy_authenticate_get_stale(header) osip_www_authenticate_get_stale(header) 137 | /** 138 | * Add the stale parameter from a Proxy-Authenticate element. 139 | * @param header The element to work on. 140 | * @param value The value of the new parameter. 141 | */ 142 | #define osip_proxy_authenticate_set_stale(header, value) osip_www_authenticate_set_stale(header, value) 143 | /** 144 | * Add a stale parameter set to "true" in a proxy-Authenticate element. 145 | * @param header The element to work on. 146 | */ 147 | #define osip_proxy_authenticate_set_stale_true(header) osip_www_authenticate_set_stale(header,osip_strdup("true")) 148 | /** 149 | * Add a stale parameter set to "false" in a Proxy-Authenticate element. 150 | * @param header The element to work on. 151 | */ 152 | #define osip_proxy_authenticate_set_stale_false(header) osip_www_authenticate_set_stale(header,osip_strdup("false")) 153 | /** 154 | * Get value of the algorithm parameter from a Proxy-Authenticate element. 155 | * @param header The element to work on. 156 | */ 157 | #define osip_proxy_authenticate_get_algorithm(header) osip_www_authenticate_get_algorithm(header) 158 | /** 159 | * Add the algorithm parameter from a Proxy-Authenticate element. 160 | * @param header The element to work on. 161 | * @param value The value of the new parameter. 162 | */ 163 | #define osip_proxy_authenticate_set_algorithm(header, value) osip_www_authenticate_set_algorithm(header, value) 164 | /** 165 | * Add the algorithm parameter set to "MD5" in a Proxy-Authenticate element. 166 | * @param header The element to work on. 167 | */ 168 | #define osip_proxy_authenticate_set_algorithm_MD5(header) osip_www_authenticate_set_algorithm(header,osip_strdup("MD5")) 169 | /** 170 | * Get value of the qop_options parameter from a Proxy-Authenticate element. 171 | * @param header The element to work on. 172 | */ 173 | #define osip_proxy_authenticate_get_qop_options(header) osip_www_authenticate_get_qop_options(header) 174 | /** 175 | * Add the qop_options parameter from a Proxy-Authenticate element. 176 | * @param header The element to work on. 177 | * @param value The value of the new parameter. 178 | */ 179 | #define osip_proxy_authenticate_set_qop_options(header,value) osip_www_authenticate_set_qop_options(header,value) 180 | 181 | 182 | #ifdef __cplusplus 183 | } 184 | #endif 185 | 186 | /** @} */ 187 | 188 | #endif 189 | -------------------------------------------------------------------------------- /work/cjson/cJSON.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Dave Gamble 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #ifndef cJSON__h 24 | #define cJSON__h 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | /* cJSON Types: */ 32 | #define cJSON_False 0 33 | #define cJSON_True 1 34 | #define cJSON_NULL 2 35 | #define cJSON_Number 3 36 | #define cJSON_String 4 37 | #define cJSON_Array 5 38 | #define cJSON_Object 6 39 | 40 | #define cJSON_IsReference 256 41 | #define cJSON_StringIsConst 512 42 | 43 | /* The cJSON structure: */ 44 | typedef struct cJSON { 45 | struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ 46 | struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ 47 | 48 | int type; /* The type of the item, as above. */ 49 | 50 | char *valuestring; /* The item's string, if type==cJSON_String */ 51 | int valueint; /* The item's number, if type==cJSON_Number */ 52 | double valuedouble; /* The item's number, if type==cJSON_Number */ 53 | 54 | char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ 55 | } cJSON; 56 | 57 | typedef struct cJSON_Hooks { 58 | void *(*malloc_fn)(size_t sz); 59 | void (*free_fn)(void *ptr); 60 | } cJSON_Hooks; 61 | 62 | /* Supply malloc, realloc and free functions to cJSON */ 63 | extern void cJSON_InitHooks(cJSON_Hooks* hooks); 64 | 65 | 66 | /* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */ 67 | extern cJSON *cJSON_Parse(const char *value); 68 | /* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */ 69 | extern char *cJSON_Print(cJSON *item); 70 | /* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */ 71 | extern char *cJSON_PrintUnformatted(cJSON *item); 72 | /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ 73 | extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt); 74 | /* Delete a cJSON entity and all subentities. */ 75 | extern void cJSON_Delete(cJSON *c); 76 | 77 | /* Returns the number of items in an array (or object). */ 78 | extern int cJSON_GetArraySize(cJSON *array); 79 | /* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */ 80 | extern cJSON *cJSON_GetArrayItem(cJSON *array,int item); 81 | /* Get item "string" from object. Case insensitive. */ 82 | extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string); 83 | 84 | /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ 85 | extern const char *cJSON_GetErrorPtr(void); 86 | 87 | /* These calls create a cJSON item of the appropriate type. */ 88 | extern cJSON *cJSON_CreateNull(void); 89 | extern cJSON *cJSON_CreateTrue(void); 90 | extern cJSON *cJSON_CreateFalse(void); 91 | extern cJSON *cJSON_CreateBool(int b); 92 | extern cJSON *cJSON_CreateNumber(double num); 93 | extern cJSON *cJSON_CreateString(const char *string); 94 | extern cJSON *cJSON_CreateArray(void); 95 | extern cJSON *cJSON_CreateObject(void); 96 | 97 | /* These utilities create an Array of count items. */ 98 | extern cJSON *cJSON_CreateIntArray(const int *numbers,int count); 99 | extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count); 100 | extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count); 101 | extern cJSON *cJSON_CreateStringArray(const char **strings,int count); 102 | 103 | /* Append item to the specified array/object. */ 104 | extern void cJSON_AddItemToArray(cJSON *array, cJSON *item); 105 | extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item); 106 | extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */ 107 | /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ 108 | extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); 109 | extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item); 110 | 111 | /* Remove/Detatch items from Arrays/Objects. */ 112 | extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which); 113 | extern void cJSON_DeleteItemFromArray(cJSON *array,int which); 114 | extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string); 115 | extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string); 116 | 117 | /* Update array items. */ 118 | extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */ 119 | extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem); 120 | extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); 121 | 122 | /* Duplicate a cJSON item */ 123 | extern cJSON *cJSON_Duplicate(cJSON *item,int recurse); 124 | /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will 125 | need to be released. With recurse!=0, it will duplicate any children connected to the item. 126 | The item->next and ->prev pointers are always zero on return from Duplicate. */ 127 | 128 | /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ 129 | extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated); 130 | 131 | extern void cJSON_Minify(char *json); 132 | 133 | /* Macros for creating things quickly. */ 134 | #define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull()) 135 | #define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue()) 136 | #define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse()) 137 | #define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b)) 138 | #define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n)) 139 | #define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s)) 140 | 141 | /* When assigning an integer value, it needs to be propagated to valuedouble too. */ 142 | #define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 143 | #define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val)) 144 | 145 | #ifdef __cplusplus 146 | } 147 | #endif 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /work/sip/include/osipparser2/headers/osip_www_authenticate.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_WWW_AUTHENTICATE_H_ 22 | #define _OSIP_WWW_AUTHENTICATE_H_ 23 | 24 | 25 | /** 26 | * @file osip_www_authenticate.h 27 | * @brief oSIP osip_www_authenticate header definition. 28 | */ 29 | 30 | /** 31 | * @defgroup oSIP_WWW_AUTHENTICATE oSIP www-authenticate header definition. 32 | * @ingroup oSIP_HEADERS 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Structure for WWW-Authenticate headers. 38 | * @var osip_www_authenticate_t 39 | */ 40 | typedef struct osip_www_authenticate osip_www_authenticate_t; 41 | 42 | /** 43 | * Definition of the WWW-Authenticate header. 44 | * @struct osip_www_authenticate 45 | */ 46 | struct osip_www_authenticate 47 | { 48 | char *auth_type; /**< Authentication Type (Basic or Digest */ 49 | char *realm; /**< realm (as a quoted-string) */ 50 | char *domain; /**< domain (optional) */ 51 | char *nonce; /**< nonce (optional)*/ 52 | char *opaque; /**< opaque (optional) */ 53 | char *stale; /**< stale (optional) */ 54 | char *algorithm; /**< algorythm (optional) */ 55 | char *qop_options; /**< qop option (optional) */ 56 | char *auth_param; /**< other parameters (optional) */ 57 | }; 58 | 59 | 60 | #ifdef __cplusplus 61 | extern "C" 62 | { 63 | #endif 64 | 65 | /** 66 | * Allocate a Www-Authenticate element. 67 | * @param header The element to work on. 68 | */ 69 | int osip_www_authenticate_init (osip_www_authenticate_t ** header); 70 | /** 71 | * Parse a Www-Authenticate element. 72 | * @param header The element to work on. 73 | * @param hvalue The string to parse. 74 | */ 75 | int osip_www_authenticate_parse (osip_www_authenticate_t * header, const char *hvalue); 76 | /** 77 | * Get a string representation of a Www-Authenticate element. 78 | * @param header The element to work on. 79 | * @param dest A pointer on the new allocated string. 80 | */ 81 | int osip_www_authenticate_to_str (const osip_www_authenticate_t * header, char **dest); 82 | /** 83 | * Free a Www-Authenticate element. 84 | * @param header The element to work on. 85 | */ 86 | void osip_www_authenticate_free (osip_www_authenticate_t * header); 87 | /** 88 | * Clone a Www-Authenticate element. 89 | * @param header The element to work on. 90 | * @param dest A pointer on the copy of the element. 91 | */ 92 | int osip_www_authenticate_clone (const osip_www_authenticate_t * header, 93 | osip_www_authenticate_t ** dest); 94 | 95 | /** 96 | * Get value of the auth_type parameter from a Www-Authenticate element. 97 | * @param header The element to work on. 98 | */ 99 | char *osip_www_authenticate_get_auth_type (osip_www_authenticate_t * header); 100 | /** 101 | * Add the auth_type parameter from a Www-Authenticate element. 102 | * @param header The element to work on. 103 | * @param value The value of the new parameter. 104 | */ 105 | void osip_www_authenticate_set_auth_type (osip_www_authenticate_t * header, 106 | char *value); 107 | /** 108 | * Get value of the realm parameter from a Www-Authenticate element. 109 | * @param header The element to work on. 110 | */ 111 | char *osip_www_authenticate_get_realm (osip_www_authenticate_t * header); 112 | /** 113 | * Add the realm parameter from a Www-Authenticate element. 114 | * @param header The element to work on. 115 | * @param value The value of the new parameter. 116 | */ 117 | void osip_www_authenticate_set_realm (osip_www_authenticate_t * header, char *value); 118 | /** 119 | * Get value of the domain parameter from a Www-Authenticate element. 120 | * @param header The element to work on. 121 | */ 122 | char *osip_www_authenticate_get_domain (osip_www_authenticate_t * header); 123 | /** 124 | * Add the domain parameter from a Www-Authenticate element. 125 | * @param header The element to work on. 126 | * @param value The value of the new parameter. 127 | */ 128 | void osip_www_authenticate_set_domain (osip_www_authenticate_t * header, char *value); 129 | /** 130 | * Get value of the nonce parameter from a Www-Authenticate element. 131 | * @param header The element to work on. 132 | */ 133 | char *osip_www_authenticate_get_nonce (osip_www_authenticate_t * header); 134 | /** 135 | * Add the nonce parameter from a Www-Authenticate element. 136 | * @param header The element to work on. 137 | * @param value The value of the new parameter. 138 | */ 139 | void osip_www_authenticate_set_nonce (osip_www_authenticate_t * header, char *value); 140 | /** 141 | * Get value of the opaque parameter from a Www-Authenticate element. 142 | * @param header The element to work on. 143 | */ 144 | char *osip_www_authenticate_get_opaque (osip_www_authenticate_t * header); 145 | /** 146 | * Add the opaque parameter from a Www-Authenticate element. 147 | * @param header The element to work on. 148 | * @param value The value of the new parameter. 149 | */ 150 | void osip_www_authenticate_set_opaque (osip_www_authenticate_t * header, char *value); 151 | /** 152 | * Get value of the stale parameter from a Www-Authenticate element. 153 | * @param header The element to work on. 154 | */ 155 | char *osip_www_authenticate_get_stale (osip_www_authenticate_t * header); 156 | /** 157 | * Add the stale parameter in a Www-Authenticate element. 158 | * @param header The element to work on. 159 | * @param value The value of the new parameter. 160 | */ 161 | void osip_www_authenticate_set_stale (osip_www_authenticate_t * header, char *value); 162 | /** 163 | * Add a stale parameter set to "true" in a Www-Authenticate element. 164 | * @param header The element to work on. 165 | */ 166 | #define osip_www_authenticate_set_stale_true(header) osip_www_authenticate_set_stale(header,osip_strdup("true")) 167 | /** 168 | * Add a stale parameter set to "false" in a Www-Authenticate element. 169 | * @param header The element to work on. 170 | */ 171 | #define osip_www_authenticate_set_stale_false(header) osip_www_authenticate_set_stale(header,osip_strdup("false")) 172 | /** 173 | * Get value of the algorithm parameter from a Www-Authenticate element. 174 | * @param header The element to work on. 175 | */ 176 | char *osip_www_authenticate_get_algorithm (osip_www_authenticate_t * header); 177 | /** 178 | * Add the algorithm parameter in a Www-Authenticate element. 179 | * @param header The element to work on. 180 | * @param value The value of the new parameter. 181 | */ 182 | void osip_www_authenticate_set_algorithm (osip_www_authenticate_t * header, 183 | char *value); 184 | /** 185 | * Add the algorithm parameter set to "MD5" in a Www-Authenticate element. 186 | * @param header The element to work on. 187 | */ 188 | #define osip_www_authenticate_set_algorithm_MD5(header) osip_www_authenticate_set_algorithm(header,osip_strdup("MD5")) 189 | /** 190 | * Get value of the qop_options parameter from a Www-Authenticate element. 191 | * @param header The element to work on. 192 | */ 193 | char *osip_www_authenticate_get_qop_options (osip_www_authenticate_t * header); 194 | /** 195 | * Add the qop_options parameter from a Www-Authenticate element. 196 | * @param header The element to work on. 197 | * @param value The value of the new parameter. 198 | */ 199 | void osip_www_authenticate_set_qop_options (osip_www_authenticate_t * header, 200 | char *value); 201 | 202 | #ifdef __cplusplus 203 | } 204 | #endif 205 | 206 | /** @} */ 207 | 208 | #endif 209 | -------------------------------------------------------------------------------- /work/sip/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 | -------------------------------------------------------------------------------- /work/sip/include/eXosip2/eX_subscribe.h: -------------------------------------------------------------------------------- 1 | /* 2 | eXosip - This is the eXtended osip library. 3 | Copyright (C) 2001-2012 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_SUBSCRIBE_H__ 39 | #define __EX_SUBSCRIBE_H__ 40 | 41 | #include 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | /** 49 | * @file eX_subscribe.h 50 | * @brief eXosip subscribe request API 51 | * 52 | * This file provide the API needed to control SUBSCRIBE requests. You can 53 | * use it to: 54 | * 55 | *
    56 | *
  • build SUBSCRIBE requests.
  • 57 | *
  • send SUBSCRIBE requests.
  • 58 | *
  • build SUBSCRIBE answers.
  • 59 | *
  • send SUBSCRIBE answers.
  • 60 | *
61 | */ 62 | 63 | /** 64 | * @defgroup eXosip2_subscribe eXosip2 SUBSCRIBE and outgoing subscriptions 65 | * @ingroup eXosip2_msg 66 | * @{ 67 | */ 68 | 69 | /** 70 | * Structure for subscription status 71 | * @enum eXosip_ss 72 | */ 73 | enum eXosip_ss { 74 | EXOSIP_SUBCRSTATE_UNKNOWN, /**< unknown subscription-state */ 75 | EXOSIP_SUBCRSTATE_PENDING, /**< pending subscription-state */ 76 | EXOSIP_SUBCRSTATE_ACTIVE, /**< active subscription-state */ 77 | EXOSIP_SUBCRSTATE_TERMINATED /**< terminated subscription-state */ 78 | }; 79 | 80 | /** 81 | * Structure for subscription reason 82 | * @enum eXosip_ss_reason 83 | */ 84 | enum eXosip_ss_reason { 85 | DEACTIVATED, /**< deactivated for subscription-state */ 86 | PROBATION, /**< probation for subscription-state */ 87 | REJECTED, /**< rejected for subscription-state */ 88 | TIMEOUT, /**< timeout for subscription-state */ 89 | GIVEUP, /**< giveup for subscription-state */ 90 | NORESOURCE /**< noresource for subscription-state */ 91 | }; 92 | 93 | /** 94 | * Structure for notification status 95 | * @enum eXosip_ss_status 96 | */ 97 | enum eXosip_ss_status { 98 | EXOSIP_NOTIFY_UNKNOWN, /**< unknown state for subscription */ 99 | EXOSIP_NOTIFY_PENDING, /**< subscription not yet accepted */ 100 | EXOSIP_NOTIFY_ONLINE, /**< online status */ 101 | EXOSIP_NOTIFY_BUSY, /**< busy status */ 102 | EXOSIP_NOTIFY_BERIGHTBACK, 103 | /**< be right back status */ 104 | EXOSIP_NOTIFY_AWAY, /**< away status */ 105 | EXOSIP_NOTIFY_ONTHEPHONE,/**< on the phone status */ 106 | EXOSIP_NOTIFY_OUTTOLUNCH,/**< out to lunch status */ 107 | EXOSIP_NOTIFY_CLOSED /**< closed status */ 108 | }; 109 | 110 | #ifndef MINISIZE 111 | 112 | /** 113 | * Build a default initial SUBSCRIBE request. 114 | * 115 | * @param excontext eXosip_t instance. 116 | * @param subscribe Pointer for the SIP request to build. 117 | * @param to SIP url for callee. 118 | * @param from SIP url for caller. 119 | * @param route Route header for SUBSCRIBE. (optional) 120 | * @param event Event header for SUBSCRIBE. 121 | * @param expires Expires header for SUBSCRIBE. 122 | */ 123 | int eXosip_subscribe_build_initial_request (struct eXosip_t *excontext, osip_message_t ** subscribe, const char *to, const char *from, const char *route, const char *event, int expires); 124 | 125 | /** 126 | * Send an initial SUBSCRIBE request. 127 | * 128 | * @param excontext eXosip_t instance. 129 | * @param subscribe SIP SUBSCRIBE message to send. 130 | */ 131 | int eXosip_subscribe_send_initial_request (struct eXosip_t *excontext, osip_message_t * subscribe); 132 | 133 | /** 134 | * Build a default new SUBSCRIBE message. 135 | * 136 | * @param excontext eXosip_t instance. 137 | * @param did identifier of the subscription. 138 | * @param sub Pointer for the SIP request to build. 139 | */ 140 | int eXosip_subscribe_build_refresh_request (struct eXosip_t *excontext, int did, osip_message_t ** sub); 141 | 142 | /** 143 | * Send a new SUBSCRIBE request. 144 | * 145 | * @param excontext eXosip_t instance. 146 | * @param did identifier of the subscription. 147 | * @param sub SIP SUBSCRIBE message to send. 148 | */ 149 | int eXosip_subscribe_send_refresh_request (struct eXosip_t *excontext, int did, osip_message_t * sub); 150 | 151 | /** 152 | * Remove outgoing subscription context. 153 | * 154 | * @param excontext eXosip_t instance. 155 | * @param did identifier of the subscription. 156 | */ 157 | int eXosip_subscribe_remove (struct eXosip_t *excontext, int did); 158 | 159 | /** @} */ 160 | 161 | /** 162 | * @defgroup eXosip2_notify eXosip2 SUBSCRIBE and incoming subscriptions 163 | * @ingroup eXosip2_msg 164 | * @{ 165 | */ 166 | 167 | /** 168 | * Build answer for an SUBSCRIBE request. 169 | * 170 | * @param excontext eXosip_t instance. 171 | * @param tid id of SUBSCRIBE transaction. 172 | * @param status status for SIP answer to build. 173 | * @param answer The SIP answer to build. 174 | */ 175 | int eXosip_insubscription_build_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t ** answer); 176 | 177 | /** 178 | * Send answer for an SUBSCRIBE request. 179 | * 180 | * @param excontext eXosip_t instance. 181 | * @param tid id of SUBSCRIBE transaction. 182 | * @param status status for SIP answer to send. 183 | * @param answer The SIP answer to send. (default will be sent if NULL) 184 | */ 185 | int eXosip_insubscription_send_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t * answer); 186 | 187 | /** 188 | * Build a request within subscription. 189 | * 190 | * @param excontext eXosip_t instance. 191 | * @param did id of incoming subscription. 192 | * @param method request method to build. 193 | * @param request The SIP request to build. 194 | */ 195 | int eXosip_insubscription_build_request (struct eXosip_t *excontext, int did, const char *method, osip_message_t ** request); 196 | 197 | /** 198 | * Build a NOTIFY request within subscription. 199 | * 200 | * @param excontext eXosip_t instance. 201 | * @param did id of incoming subscription. 202 | * @param subscription_status subscription status (pending, active, terminated) 203 | * @param subscription_reason subscription reason 204 | * @param request The SIP request to build. 205 | */ 206 | int eXosip_insubscription_build_notify (struct eXosip_t *excontext, int did, int subscription_status, int subscription_reason, osip_message_t ** request); 207 | 208 | /** 209 | * Send a request within subscription. 210 | * 211 | * @param excontext eXosip_t instance. 212 | * @param did id of incoming subscription. 213 | * @param request The SIP request to send. 214 | */ 215 | int eXosip_insubscription_send_request (struct eXosip_t *excontext, int did, osip_message_t * request); 216 | 217 | /** 218 | * Remove incoming subscription context. 219 | * 220 | * @param excontext eXosip_t instance. 221 | * @param did identifier of the subscription. 222 | */ 223 | int eXosip_insubscription_remove (struct eXosip_t *excontext, int did); 224 | 225 | 226 | #endif 227 | 228 | /** @} */ 229 | 230 | 231 | #ifdef __cplusplus 232 | } 233 | #endif 234 | #endif 235 | --------------------------------------------------------------------------------