Documentation ¶
Overview ¶
SIPExer Generic SIP Parsing Library
Index ¶
- Constants
- func SGAddrType(addr string) int
- func SGAddrTypeEx(addr string) int
- func SGSIPACKToByeString(ackReq *SGSIPMessage, outputStr *string) int
- func SGSIPHeaderGetType(name string) int
- func SGSIPHeaderParseDigestAuthBody(hbody string) map[string]string
- func SGSIPHeaderValidName(name string) bool
- func SGSIPInviteToACKString(invReq *SGSIPMessage, invRpl *SGSIPMessage, outputStr *string) int
- func SGSIPMessageCSeqParse(msgVal *SGSIPMessage) int
- func SGSIPMessageCSeqUpdate(msgVal *SGSIPMessage, ival int) int
- func SGSIPMessageGetContactURI(msgVal *SGSIPMessage, cturi *string) int
- func SGSIPMessageHeaderGet(msgVal *SGSIPMessage, hname string, hbody *string) int
- func SGSIPMessageHeaderSet(msgVal *SGSIPMessage, hname string, hbody string) int
- func SGSIPMessageToResponseString(sipReq *SGSIPMessage, scode string, sreason string, outputStr *string) int
- func SGSIPMessageToString(msgVal *SGSIPMessage, outputStr *string) int
- func SGSIPMessageViaUpdate(msgObj *SGSIPMessage) int
- func SGSIPParamsGet(paramStr string, paramName string, vmode int, paramVal *SGSIPParam) int
- func SGSIPParseBody(inputStr string, bodyVal *SGSIPBody) int
- func SGSIPParseFirstLine(inputStr string, flineVal *SGSIPFirstLine) int
- func SGSIPParseHeaders(inputStr string, pMode int, headersList *[]SGSIPHeader) int
- func SGSIPParseMessage(inputStr string, msgVal *SGSIPMessage) int
- func SGSIPParseSocketAddress(sockstr string, sockaddr *SGSIPSocketAddress) int
- func SGSIPParseURI(uristr string, uri *SGSIPURI) int
- func SGSIPSetMethodId(method string, methodid *int)
- func SGSIPSetProto(protostr string, protoval *string, protoid *int) int
- func SGSIPSetSchema(schemastr string, schemaval *string, schemaid *int) int
- func SGSIPURIToSocketAddress(uri *SGSIPURI, sockaddr *SGSIPSocketAddress) int
- func SGSocketAddressToSIPURI(sockaddr *SGSIPSocketAddress, user string, tmode int, uri *SGSIPURI) int
- type SGSIPBody
- type SGSIPCSeq
- type SGSIPFirstLine
- type SGSIPHeader
- type SGSIPMessage
- type SGSIPParam
- type SGSIPSocketAddress
- type SGSIPURI
Constants ¶
const ( SGSIPRetOK = 0 // generic errors SGSIPRetErr = -1 SGSIPRetNotFound = -2 // first line parse errors SGSIPRetErrFLineShort = -100 SGSIPRetErrFLineFormat = -101 SGSIPRetErrFLineRequestFormat = -102 SGSIPRetErrFLineResponseShort = -103 SGSIPRetErrFLineResponseFormat = -104 SGSIPRetErrFLineResponseCode = -105 // sip params parse errors SGSIPRetErrParamFormat = -140 SGSIPRetErrParamNotFound = -141 // socket address error SGSIPRetErrSocketAddressPort = -200 SGSIPRetErrSocketAddressPortVal = -201 SGSIPRetErrSocketAddressAFIPv6 = -202 // uri errors SGSIPRetErrURI = -220 SGSIPRetErrURIUser = -221 SGSIPRetErrURIAFIPv6 = -222 SGSIPRetErrURIPort = -223 SGSIPRetErrURIFormat = -224 SGSIPRetErrURIProto = -225 // header errors SGSIPRetErrHeaderLength = -240 SGSIPRetErrHeaderEmpty = -241 SGSIPRetErrHeaderFormat = -242 SGSIPRetErrHeaderName = -243 SGSIPRetErrHeaderEoL = -244 // body errors SGSIPRetErrBody = -260 // cseq errors SGSIPRetErrCSeqBody = -280 SGSIPRetErrCSeqNumber = -281 // sip message errors SGSIPRetErrMessageNotSet = -300 )
return and error code values
const ( ProtoNONE = iota ProtoUDP ProtoTCP ProtoTLS ProtoSCTP ProtoWS ProtoWSS )
const ( AFNONE = 0 AFIPv4 = 4 AFIPv6 = 6 AFHost = 8 )
const ( SchemaNONE = iota SchemaSIP SchemaSIPS SchemaTEL )
const ( ParamValNone = iota ParamValBare ParamValQuoted )
const ( FLineNone = iota FLineRequest FLineResponse )
const ( SIPMethodNONE = iota SIPMethodINVITE SIPMethodACK SIPMethodBYE SIPMethodCANCEL SIPMethodREGISTER SIPMethodMESSAGE SIPMethodOPTIONS SIPMethodINFO SIPMethodUPDATE SIPMethodSUBSCRIBE SIPMethodNOTIFY SIPMethodPUBLISH SIPMethodPRACK SIPMethodOTHER )
const ( HeaderTypeNone = iota HeaderTypeCallID HeaderTypeCSeq HeaderTypeFrom HeaderTypeTo HeaderTypeVia HeaderTypeContact HeaderTypeSubject HeaderTypeContentLength HeaderTypeContentType HeaderTypeContentEncoding HeaderTypeAcceptContact HeaderTypeReferTo HeaderTypeReferredBy HeaderTypeEvent HeaderTypeAllowEvents HeaderTypeSupported HeaderTypeRecordRoute HeaderTypeRoute HeaderTypeExpires HeaderTypeUserAgent HeaderTypeOther )
const ( SGSIPMFlagNone = 0 SGSIPMFlagLateOffer = 1 )
message flags
Variables ¶
This section is empty.
Functions ¶
func SGAddrTypeEx ¶
Quick detection of ip/address type also with IPv6 square brackets
func SGSIPACKToByeString ¶
func SGSIPACKToByeString(ackReq *SGSIPMessage, outputStr *string) int
SGSIPACKToByeString --
func SGSIPHeaderParseDigestAuthBody ¶
SGSIPHeaderParseDigestAuthBody - parse www/proxy-authenticate header body. Return a map of parameters or nil if the header is not Digest auth header.
func SGSIPInviteToACKString ¶
func SGSIPInviteToACKString(invReq *SGSIPMessage, invRpl *SGSIPMessage, outputStr *string) int
SGSIPInviteToACKString --
func SGSIPMessageCSeqParse ¶
func SGSIPMessageCSeqParse(msgVal *SGSIPMessage) int
SGSIPMessageCSeqParse --
func SGSIPMessageCSeqUpdate ¶
func SGSIPMessageCSeqUpdate(msgVal *SGSIPMessage, ival int) int
SGSIPMessageCSeqUpdate --
func SGSIPMessageGetContactURI ¶
func SGSIPMessageGetContactURI(msgVal *SGSIPMessage, cturi *string) int
SGSIPMessageGetContactURI --
func SGSIPMessageHeaderGet ¶
func SGSIPMessageHeaderGet(msgVal *SGSIPMessage, hname string, hbody *string) int
SGSIPMessageHeaderGet --
func SGSIPMessageHeaderSet ¶
func SGSIPMessageHeaderSet(msgVal *SGSIPMessage, hname string, hbody string) int
SGSIPMessageHeaderSet --
func SGSIPMessageToResponseString ¶
func SGSIPMessageToResponseString(sipReq *SGSIPMessage, scode string, sreason string, outputStr *string) int
func SGSIPMessageToString ¶
func SGSIPMessageToString(msgVal *SGSIPMessage, outputStr *string) int
SGSIPMessageToString --
func SGSIPMessageViaUpdate ¶
func SGSIPMessageViaUpdate(msgObj *SGSIPMessage) int
SGSIPMessageViaUpdate --
func SGSIPParamsGet ¶
func SGSIPParamsGet(paramStr string, paramName string, vmode int, paramVal *SGSIPParam) int
SGSIPParamsGet --
func SGSIPParseBody ¶
SGSIPParseBody --
func SGSIPParseFirstLine ¶
func SGSIPParseFirstLine(inputStr string, flineVal *SGSIPFirstLine) int
SGSIPParseFirstLine --
func SGSIPParseHeaders ¶
func SGSIPParseHeaders(inputStr string, pMode int, headersList *[]SGSIPHeader) int
SGSIPParseHeader --
func SGSIPParseMessage ¶
func SGSIPParseMessage(inputStr string, msgVal *SGSIPMessage) int
SGSIPParseMessage --
func SGSIPParseSocketAddress ¶
func SGSIPParseSocketAddress(sockstr string, sockaddr *SGSIPSocketAddress) int
SGSIPParseSocketAddress --
func SGSIPSetProto ¶
SGSIPSetProto --
func SGSIPSetSchema ¶
SGSIPSetSchema --
func SGSIPURIToSocketAddress ¶
func SGSIPURIToSocketAddress(uri *SGSIPURI, sockaddr *SGSIPSocketAddress) int
SGSIPURIToSocketAddress --
func SGSocketAddressToSIPURI ¶
func SGSocketAddressToSIPURI(sockaddr *SGSIPSocketAddress, user string, tmode int, uri *SGSIPURI) int
SGSocketAddressToSIPURI --
Types ¶
type SGSIPFirstLine ¶
type SGSIPHeader ¶
type SGSIPMessage ¶
type SGSIPMessage struct { Data string FLine SGSIPFirstLine RURI SGSIPURI Headers []SGSIPHeader CSeq SGSIPCSeq Body SGSIPBody MFlags int }