Beispiel #1
0
/** Get the CallID header (nil if one does not exist)
 *
 *@param callId -- the call identifier to be assigned to the call id header
 */
func (this *SIPMessage) SetCallIdFromString(callId string) { //throws java.text.ParseException {
	if this.callIdHeader == nil {
		c, _ := header.NewCallID(callId)
		this.SetHeader(c)
	}
	this.callIdHeader.SetCallId(callId)
}
Beispiel #2
0
/** parse the String message
 * @return Header (CallID object)
 * @throws ParseException if the message does not respect the spec.
 */
func (this *CallIDParser) Parse() (sh header.Header, ParseException error) {
	lexer := this.GetLexer()
	lexer.Match(TokenTypes_CALL_ID)
	lexer.SPorHT()
	lexer.Match(':')
	lexer.SPorHT()
	rest := strings.TrimSpace(lexer.GetRest())

	callID, ParseException := header.NewCallID(rest)

	return callID, ParseException
}