apps/app_verify.c
static void parse_iax2_dial_string(char *data, struct ast_str *strbuf)
{
	char *exten = NULL, *username = NULL, *secret = NULL, *context = NULL, *peer = NULL, *port = NULL;

	strsep(&data, "/"); /* eat the IAX2/ */
	peer = strsep(&data, "/");
	exten = strsep(&data, "/");

	if (exten) {
		data = exten;
		exten = strsep(&data, "@");
		context = data;
	}
	if (peer && strchr(peer, '@')) {
		data = peer;
		username = strsep(&data, "@");
		peer = data;
	}
	if (username) {
		data = username;
		username = strsep(&data, ":");
		secret = strsep(&data, ":");
	}

	data = peer;
	peer = strsep(&data, ":");
	port = data;
	ast_debug(1, "Peer: %s, Port: %s, Username: %s, Secret: %s, Context: %s, Exten: %s\n", peer, port, username, secret, context, exten); /* no need for outkey */
	ast_str_set(&strbuf, 0, "%s", peer); /* piggyback of this ast_str, cause why not? */
}
/* simplified and modified version of parse_dial_string from chan_iax2.c */
simplified and modified version of parse_dial_string from chan_iax2.c
simplified and modified version of parse_dial_string from chan_iax2 . c
static void parse_iax2_dial_string(char *data, struct ast_str *strbuf)
{
	char *exten = NULL, *username = NULL, *secret = NULL, *context = NULL, *peer = NULL, *port = NULL;
	strsep(&data, "/"); 
	peer = strsep(&data, "/");
	exten = strsep(&data, "/");
	if (exten) {
		data = exten;
		exten = strsep(&data, "@");
		context = data;
	}
	if (peer && strchr(peer, '@')) {
		data = peer;
		username = strsep(&data, "@");
		peer = data;
	}
	if (username) {
		data = username;
		username = strsep(&data, ":");
		secret = strsep(&data, ":");
	}
	data = peer;
	peer = strsep(&data, ":");
	port = data;
	ast_debug(1, "Peer: %s, Port: %s, Username: %s, Secret: %s, Context: %s, Exten: %s\n", peer, port, username, secret, context, exten); 
	ast_str_set(&strbuf, 0, "%s", peer); 
}
static void parse_iax2_dial_string ( char * data , struct ast_str * strbuf ) { char * exten = NULL , * username = NULL , * secret = NULL , * context = NULL , * peer = NULL , * port = NULL ; strsep ( & data , " " ) ; peer = strsep ( & data , " " ) ; exten = strsep ( & data , " " ) ; if ( exten ) { data = exten ; exten = strsep ( & data , " " ) ; context = data ; } if ( peer && strchr ( peer , ' ' ) ) { data = peer ; username = strsep ( & data , " " ) ; peer = data ; } if ( username ) { data = username ; username = strsep ( & data , " " ) ; secret = strsep ( & data , " " ) ; } data = peer ; peer = strsep ( & data , " " ) ; port = data ; ast_debug ( 1 , " \n " , peer , port , username , secret , context , exten ) ; ast_str_set ( & strbuf , 0 , " " , peer ) ; }
simplified and modified version of parse_dial_string from chan_iax2.c
simplified and modified version of parse_dial_string from chan_iax2 . c
/* eat the IAX2/ */ /* no need for outkey */ /* piggyback of this ast_str, cause why not? */