custom apps to make calls.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone. 

I’m start learn Asterisk code to start develop any app to asterisk, or improve exists.

My first app is to a simples DIAL context.

I’m try make this

exten _X.,1,Dial(SIP/number@trunk)

but using a custom APP

exten => _X.,Dial(Magnus(${EXTEN})) 

I create the app_magnus.c

	struct ast_dial *dial;
	char *info;
	info = ast_strdupa(data);
	
	AST_DECLARE_APP_ARGS(args,
		AST_APP_ARG(exten);
	);
	
	AST_STANDARD_APP_ARGS(args, info);


	if (ast_strlen_zero(args. exten)) {
		ast_log(LOG_WARNING, “%s requires an argument (exten)\n", app);
		return -1;
	}


	if (!(dial = ast_dial_create())) {
		ast_log(LOG_WARNING, "Failed to create dialing structure.\n");
		return 0;
	}

	if (ast_dial_append(dial, "SIP", number, NULL) == -1) {
		ast_log(LOG_ERROR, "Failed to add %s to outbound dial\n", "SIP");
		ast_dial_destroy(dial);
		return 0;
	}	

	res =  ast_dial_run(dial, args.exten@MYTRUNK, 0);

	ast_bridge_basic_new();
	ast_dial_hangup(dial);
	ast_dial_destroy(dial);



the problem is:
When I answer the call in LEG b the LEG a hangup.

thanks your help



_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev




[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux