Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package gov.nist.javax.sip.parser.extensions;
 
 
 
 // Parser for Join Header (RFC3911)
// Extension by jean deruelle
//
// Join        = "Join" HCOLON callid *(SEMI join-param)
// join-param  = to-tag / from-tag / generic-param
// to-tag          = "to-tag" EQUAL token
// from-tag        = "from-tag" EQUAL token
//
//
public class JoinParser extends ParametersParser {

    
Creates new CallIDParser

Parameters:
callID message to parse
    public JoinParser(String callID) {
        super(callID);
    }

    
Constructor

Parameters:
lexer Lexer to set
    protected JoinParser(Lexer lexer) {
        super(lexer);
    }

    
parse the String message

Returns:
SIPHeader (CallID object)
Throws:
java.text.ParseException if the message does not respect the spec.
    public SIPHeader parse() throws ParseException {
        if ()
            dbg_enter("parse");
        try {
            headerName(.);
            Join join = new Join();
            this..SPorHT();
            String callId = .byteStringNoSemicolon();
            this..SPorHT();
            super.parse(join);
            join.setCallId(callId);
            return join;
        } finally {
            if ()
                dbg_leave("parse");
        }
    }
    public static void main(String args[]) throws ParseException {
        String to[] =
            {   "Join: 12345th5z8z\n",
                "Join: 12345th5z8z;to-tag=tozght6-45;from-tag=fromzght789-337-2\n",
            };
        for (int i = 0; i < to.lengthi++) {
            JoinParser tp = new JoinParser(to[i]);
            Join t = (Jointp.parse();
            ..println("Parsing => " + to[i]);
            ..print("encoded = " + t.encode() + "==> ");
            ..println("callId " + t.getCallId() + " from-tag=" + t.getFromTag()
                    + " to-tag=" + t.getToTag()) ;
        }
    }
New to GrepCode? Check out our FAQ X