[Asterisk-Dev] ast_callerid_parse destroying the cid info

Kevin P. Fleming kpfleming at starnetworks.us
Thu Mar 31 20:40:08 MST 2005


Matt Gibson wrote:

> The problem that I am having is like this. When ast_callerid_parse is 
> run on the callerid, it functions as expected, but if you try to use the 
> same callerid elsewhere, it has been destroyed and cannot be used. Is 
> there a way to put the variables into memory so it does not need to be 
> reparsed, but is just available at all times?

The buffer you pass in is destructively parsed, and pointers to the 
name/number portions are stored in the variables you supply to the function.

If you need to have the input string undisturbed, then you need to copy 
it first before letting the function parse it.



More information about the asterisk-dev mailing list