[asterisk-dev] Re: [asterisk-commits] trunk r27479 - /trunk/channels/chan_sip.c

Kevin P. Fleming kpfleming at digium.com
Tue May 16 13:25:43 MST 2006


asterisk-commits at lists.digium.com wrote:

> +	char hold[256];
>  	char m_audio[256];
>  	char m_video[256];
>  	char a_audio[1024];
> @@ -4822,6 +4823,11 @@
>  	ast_build_string(&m_audio_next, &m_audio_left, "m=audio %d RTP/AVP", ntohs(dest.sin_port));
>  	ast_build_string(&m_video_next, &m_video_left, "m=video %d RTP/AVP", ntohs(vdest.sin_port));
>  
> +	if (ast_test_flag(&p->flags[0], SIP_CALL_ONHOLD))
> +		sprintf(hold, "a=recvonly");
> +	else
> +		sprintf(hold, "a=sendrecv");
> +

There is no need for this to be a character array or use sprintf() at
all.. it can just be a 'char *' and hold a pointer to one of these two
constant strings.



More information about the asterisk-dev mailing list