[Asterisk-Dev] ast_callerid_parse

Luigi Rizzo rizzo at icir.org
Thu Dec 29 07:31:19 MST 2005


ast_callerid_parse(), as it is written now,
never returns an error, despite the documentation
says it may return -1 on error.

Question is - is there any illegal callerid string ?

Right now these forms are all legal:

	input			name		location
	"foo bar" <12345>	foo bar		12345
	foo bar <12345>		foo bar		12345
	"foo bar <12345>"	"foo bar	12345

however i believe the latter is either illegal or
improperly parsed, and some similar code e.g. in
chan_sip.c processes it in a different way.

Do we need to fix the above behaviour, or just document it
(in which case the code can be simplified) ?
And, what about the processing in chan_sip.c ?

On passing, also ast_shrink_phone_number() is documented as

/*! \brief Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s... */
/*!
 * \param n The number to be stripped/shrunk


but what it really does is (my understanding of the code)

/*
 * remove '(', ' ', ')', non-trailing '.', and '-' if not in square brackets.
 * Basically, remove anything that could be invalid in a pattern.
 */

again, what is correct - the code or the documentation ?

	cheers
	luigi



More information about the asterisk-dev mailing list