[asterisk-commits] oej: branch oej/pine-brutal-sip-experiments-1.4 r305739 - in /team/oej/pine-b...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 2 01:49:20 CST 2011


Author: oej
Date: Wed Feb  2 01:49:13 2011
New Revision: 305739

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305739
Log:
Trying to separate rtp, apps and functions. I can now load two SIP channels in my Asterisk,
but haven't really tested if it works.

There should be a possibility that we can still move media outside of the box, even with
one call leg in each SIP channel driver.

Next step: testing

Modified:
    team/oej/pine-brutal-sip-experiments-1.4/channels/chan_sip.c
    team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/cli.h
    team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/rtp.h

Modified: team/oej/pine-brutal-sip-experiments-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pine-brutal-sip-experiments-1.4/channels/chan_sip.c?view=diff&rev=305739&r1=305738&r2=305739
==============================================================================
--- team/oej/pine-brutal-sip-experiments-1.4/channels/chan_sip.c (original)
+++ team/oej/pine-brutal-sip-experiments-1.4/channels/chan_sip.c Wed Feb  2 01:49:13 2011
@@ -20246,12 +20246,29 @@
 /*! \brief PBX load module - initialization */
 static int load_module(void)
 {
+	struct ast_cli_entry *clidef;
+	int i = 0;
+	char *dyn_app_dtmfmode = app_dtmfmode;
+	char *dyn_app_sipaddheader = app_sipaddheader;
+	char *dyn_ami_sippeers = "SIPpeers";
+	char *dyn_ami_sipshowpeer = "SIPshowpeer";
+
 	ast_log(LOG_DEBUG, "***** HEY YOU DEBUGGER: %s \n", ast_module_name(ast_module_info->self));
 	if (strcasecmp(ast_module_name(ast_module_info->self), "chan_sip.so")) {
 		ast_log(LOG_DEBUG, "*** We're not who we are supposed to be.\n");
 		dynamic_sip_tech = ast_calloc(1, sizeof(struct ast_channel_tech));
 		memcpy(dynamic_sip_tech, &sip_tech, sizeof(struct ast_channel_tech));
 		dynamic_sip_tech->type = "SIP00";
+
+		for (i = 0; i < sizeof(cli_sip)/sizeof(struct ast_cli_entry); i++) {
+			cli_sip[i].cmda[0] = "SIP00";
+			ast_log(LOG_DEBUG, "--Changed %s %s\n", cli_sip[i].cmda[0], cli_sip[i].cmda[1]);
+		}
+		dyn_app_dtmfmode = "SIP00.SIPDtmfMode";
+		dyn_app_sipaddheader = "SIP00.SIPAddHeader";
+		dyn_ami_sippeers = "SIP00.SIPpeers";
+		dyn_ami_sipshowpeer = "SIP00.SIPshowpeer";
+		sip_rtp.type = "SIP00";
 	} else {
 		dynamic_sip_tech = NULL;
 	}
@@ -20282,6 +20299,7 @@
 		sched_context_destroy(sched);
 		return AST_MODULE_LOAD_FAILURE;
 	}
+	
 
 	/* Register all CLI functions for SIP */
 	ast_cli_register_multiple(cli_sip, sizeof(cli_sip)/ sizeof(struct ast_cli_entry));
@@ -20293,8 +20311,10 @@
 	ast_udptl_proto_register(&sip_udptl);
 
 	/* Register dialplan applications */
-	ast_register_application(app_dtmfmode, sip_dtmfmode, synopsis_dtmfmode, descrip_dtmfmode);
-	ast_register_application(app_sipaddheader, sip_addheader, synopsis_sipaddheader, descrip_sipaddheader);
+	ast_log(LOG_DEBUG, "--Registrerar %s\n", dyn_app_dtmfmode);
+	ast_register_application(dyn_app_dtmfmode, sip_dtmfmode, synopsis_dtmfmode, descrip_dtmfmode);
+	ast_log(LOG_DEBUG, "--Registrerar %s\n", dyn_app_sipaddheader);
+	ast_register_application(dyn_app_sipaddheader, sip_addheader, synopsis_sipaddheader, descrip_sipaddheader);
 
 	/* Register dialplan functions */
 	ast_custom_function_register(&sip_header_function);
@@ -20303,9 +20323,9 @@
 	ast_custom_function_register(&checksipdomain_function);
 
 	/* Register manager commands */
-	ast_manager_register2("SIPpeers", EVENT_FLAG_SYSTEM, manager_sip_show_peers,
+	ast_manager_register2(dyn_ami_sippeers, EVENT_FLAG_SYSTEM, manager_sip_show_peers,
 			"List SIP peers (text format)", mandescr_show_peers);
-	ast_manager_register2("SIPshowpeer", EVENT_FLAG_SYSTEM, manager_sip_show_peer,
+	ast_manager_register2(dyn_ami_sipshowpeer, EVENT_FLAG_SYSTEM, manager_sip_show_peer,
 			"Show SIP peer (text format)", mandescr_show_peer);
 
 	sip_poke_all_peers();	

Modified: team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/cli.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/cli.h?view=diff&rev=305739&r1=305738&r2=305739
==============================================================================
--- team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/cli.h (original)
+++ team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/cli.h Wed Feb  2 01:49:13 2011
@@ -46,7 +46,7 @@
 
 /*! \brief A command line entry */
 struct ast_cli_entry {
-	char * const cmda[AST_MAX_CMD_LEN];
+	char * cmda[AST_MAX_CMD_LEN];
 	/*! Handler for the command (fd for output, # of args, argument list).
 	  Returns RESULT_SHOWUSAGE for improper arguments.
 	  argv[] has argc 'useful' entries, and an additional NULL entry

Modified: team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/rtp.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/rtp.h?view=diff&rev=305739&r1=305738&r2=305739
==============================================================================
--- team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/rtp.h (original)
+++ team/oej/pine-brutal-sip-experiments-1.4/include/asterisk/rtp.h Wed Feb  2 01:49:13 2011
@@ -73,7 +73,7 @@
 	/*! Set RTP peer */
 	int (* const set_rtp_peer)(struct ast_channel *chan, struct ast_rtp *peer, struct ast_rtp *vpeer, int codecs, int nat_active);
 	int (* const get_codec)(struct ast_channel *chan);
-	const char * const type;
+	const char * type;
 	AST_LIST_ENTRY(ast_rtp_protocol) list;
 };
 




More information about the asterisk-commits mailing list