[asterisk-commits] oej: branch oej/invitestate r48210 - in /team/oej/invitestate: ./ apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Dec 2 11:45:31 MST 2006


Author: oej
Date: Sat Dec  2 12:45:30 2006
New Revision: 48210

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48210
Log:
Adding some new invitestate, updating to trunk

Modified:
    team/oej/invitestate/   (props changed)
    team/oej/invitestate/apps/app_dial.c
    team/oej/invitestate/cdr.c
    team/oej/invitestate/channel.c
    team/oej/invitestate/channels/chan_iax2.c
    team/oej/invitestate/channels/chan_sip.c
    team/oej/invitestate/configs/extensions.conf.sample
    team/oej/invitestate/configs/sip.conf.sample
    team/oej/invitestate/res/res_features.c

Propchange: team/oej/invitestate/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Dec  2 12:45:30 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-48123
+/branches/1.2:1-48207

Modified: team/oej/invitestate/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/apps/app_dial.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/apps/app_dial.c (original)
+++ team/oej/invitestate/apps/app_dial.c Sat Dec  2 12:45:30 2006
@@ -1197,6 +1197,7 @@
 		strcpy(status, "NOANSWER");
 		if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
 			moh=1;
+			ast_indicate(chan, AST_CONTROL_PROGRESS);
 			ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
 		} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
 			ast_indicate(chan, AST_CONTROL_RINGING);

Modified: team/oej/invitestate/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/cdr.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/cdr.c (original)
+++ team/oej/invitestate/cdr.c Sat Dec  2 12:45:30 2006
@@ -440,11 +440,11 @@
 		next = cdr->next;
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' not posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' not posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 
 		ast_cdr_free_vars(cdr, 0);
 		free(cdr);
@@ -806,11 +806,11 @@
 	while (cdr) {
 		chan = !ast_strlen_zero(cdr->channel) ? cdr->channel : "<unknown>";
 		if (ast_test_flag(cdr, AST_CDR_FLAG_POSTED))
-			ast_log(LOG_WARNING, "CDR on channel '%s' already posted\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' already posted\n", chan);
 		if (ast_tvzero(cdr->end))
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
 		if (ast_tvzero(cdr->start)) {
-			ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
+			ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
 			cdr->disposition = AST_CDR_FAILED;
 		} else
 			cdr->duration = cdr->end.tv_sec - cdr->start.tv_sec;

Modified: team/oej/invitestate/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channel.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/channel.c (original)
+++ team/oej/invitestate/channel.c Sat Dec  2 12:45:30 2006
@@ -2295,6 +2295,11 @@
 			res = chan->tech->write_video(chan, fr);
 		else
 			res = 0;
+		break;
+	case AST_FRAME_NULL:
+	case AST_FRAME_IAX:
+		/* Ignore these */
+		res = 0;
 		break;
 	default:
 		if (chan->tech->write) {

Modified: team/oej/invitestate/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channels/chan_iax2.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/channels/chan_iax2.c (original)
+++ team/oej/invitestate/channels/chan_iax2.c Sat Dec  2 12:45:30 2006
@@ -7110,7 +7110,7 @@
 					if (!strcmp(ies.called_number, ast_parking_ext())) {
 						if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
 							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
-						} else
+						} else if (ast_bridged_channel(iaxs[fr->callno]->owner))
 							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 					} else {
 						if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))

Modified: team/oej/invitestate/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channels/chan_sip.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/channels/chan_sip.c (original)
+++ team/oej/invitestate/channels/chan_sip.c Sat Dec  2 12:45:30 2006
@@ -155,7 +155,7 @@
 enum invitestates {
 	INV_NONE = 0,	/*!< No state at all, maybe not an INVITE dialog */
 	INV_CALLING,	/*!< Invite sent, no answer */
-	INV_PROCEEDING,	/*!< We got 1xx message */
+	INV_PROCEEDING,	/*!< We got/sent 1xx message */
 	INV_EARLY_MEDIA, /*!< We got 18x message with to-tag back */
 	INV_COMPLETED,	/*!< Got final response with error. Wait for ACK, then CONFIRMED */
 	INV_CONFIRMED,	/*!< Confirmed response - we've got an ack (Incoming calls only) */
@@ -2708,6 +2708,7 @@
 	switch(condition) {
 	case AST_CONTROL_RINGING:
 		if (ast->_state == AST_STATE_RING) {
+			p->invitestate = INV_EARLY_MEDIA;
 			if (!ast_test_flag(p, SIP_PROGRESS_SENT) ||
 			    (ast_test_flag(p, SIP_PROG_INBAND) == SIP_PROG_INBAND_NEVER)) {
 				/* Send 180 ringing if out-of-band seems reasonable */
@@ -2725,6 +2726,7 @@
 		if (ast->_state != AST_STATE_UP) {
 			transmit_response(p, "486 Busy Here", &p->initreq);
 			ast_set_flag(p, SIP_ALREADYGONE);	
+			p->invitestate = INV_TERMINATED;
 			ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
 			break;
 		}
@@ -2734,6 +2736,7 @@
 		if (ast->_state != AST_STATE_UP) {
 			transmit_response(p, "503 Service Unavailable", &p->initreq);
 			ast_set_flag(p, SIP_ALREADYGONE);	
+			p->invitestate = INV_TERMINATED;
 			ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
 			break;
 		}
@@ -2742,6 +2745,7 @@
 	case AST_CONTROL_PROCEEDING:
 		if ((ast->_state != AST_STATE_UP) && !ast_test_flag(p, SIP_PROGRESS_SENT) && !ast_test_flag(p, SIP_OUTGOING)) {
 			transmit_response(p, "100 Trying", &p->initreq);
+			p->invitestate = INV_PROCEEDING;  
 			break;
 		}
 		res = -1;
@@ -2750,6 +2754,7 @@
 		if ((ast->_state != AST_STATE_UP) && !ast_test_flag(p, SIP_PROGRESS_SENT) && !ast_test_flag(p, SIP_OUTGOING)) {
 			transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, 0);
 			ast_set_flag(p, SIP_PROGRESS_SENT);	
+			p->invitestate = INV_EARLY_MEDIA;  
 			break;
 		}
 		res = -1;
@@ -5680,7 +5685,8 @@
 		ast_copy_string(p->domain, r->domain, sizeof(p->domain));
 		ast_copy_string(p->opaque, r->opaque, sizeof(p->opaque));
 		ast_copy_string(p->qop, r->qop, sizeof(p->qop));
-		p->noncecount = r->noncecount++;
+		r->noncecount++;
+		p->noncecount = r->noncecount;
 
 		memset(digest,0,sizeof(digest));
 		if(!build_reply_digest(p, sipmethod, digest, sizeof(digest)))
@@ -11246,7 +11252,7 @@
 		error = 1;
 	}
 	if (error) {
-		if (!p->initreq.header)	/* New call */
+		if (!p->initreq.headers)	/* New call */
 			ast_set_flag(p, SIP_NEEDDESTROY);	/* Make sure we destroy this dialog */
 		return -1;
 	}

Modified: team/oej/invitestate/configs/extensions.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/configs/extensions.conf.sample?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/configs/extensions.conf.sample (original)
+++ team/oej/invitestate/configs/extensions.conf.sample Sat Dec  2 12:45:30 2006
@@ -154,7 +154,7 @@
 ;
 ; List canonical entries here
 ;
-;exten => 12564286000,1,Macro(std-exten,6000,IAX2/foo)
+;exten => 12564286000,1,Macro(stdexten,6000,IAX2/foo)
 ;exten => _125642860XX,1,Dial(IAX2/otherbox/${EXTEN:7})
 
 [dundi-e164-customers]

Modified: team/oej/invitestate/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/configs/sip.conf.sample?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/configs/sip.conf.sample (original)
+++ team/oej/invitestate/configs/sip.conf.sample Sat Dec  2 12:45:30 2006
@@ -32,6 +32,7 @@
 				; Realms MUST be globally unique according to RFC 3261
 				; Set this to your host name or domain name
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)
+				; bindport is the local UDP port that Asterisk will listen on
 bindaddr=0.0.0.0		; IP address to bind to (0.0.0.0 binds to all)
 srvlookup=yes			; Enable DNS SRV lookups on outbound calls
 				; Note: Asterisk only uses the first host 
@@ -327,6 +328,7 @@
 ;usereqphone=yes			; This provider requires ";user=phone" on URI
 ;call-limit=5				; permit only 5 simultaneous outgoing calls to this peer
 ;outboundproxy=proxy.provider.domain	; send outbound signaling to this proxy, not directly to the peer
+;port=80				; The port number we want to connect to on the remote side
 
 ;------------------------------------------------------------------------------
 ; Definitions of locally connected SIP phones

Modified: team/oej/invitestate/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/res/res_features.c?view=diff&rev=48210&r1=48209&r2=48210
==============================================================================
--- team/oej/invitestate/res/res_features.c (original)
+++ team/oej/invitestate/res/res_features.c Sat Dec  2 12:45:30 2006
@@ -1774,12 +1774,6 @@
 			ast_verbose(VERBOSE_PREFIX_3 "Channel %s connected to parked call %d\n", chan->name, park);
 
 		memset(&config, 0, sizeof(struct ast_bridge_config));
-		ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT);
-		ast_set_flag(&(config.features_caller), AST_FEATURE_REDIRECT);
-		config.timelimit = 0;
-		config.play_warning = 0;
-		config.warning_freq = 0;
-		config.warning_sound=NULL;
 		res = ast_bridge_call(chan, peer, &config);
 
 		/* Simulate the PBX hanging up */
@@ -2058,7 +2052,8 @@
 		ast_unregister_features();
 		var = ast_variable_browse(cfg, "applicationmap");
 		while(var) {
-			char *tmp_val=strdup(var->value);
+			char *tmp_val_orig=strdup(var->value);
+			char *tmp_val = tmp_val_orig;
 			char *exten, *party=NULL, *app=NULL, *app_args=NULL; 
 
 			if (!tmp_val) { 
@@ -2075,7 +2070,7 @@
 
 			if (!(app && strlen(app)) || !(exten && strlen(exten)) || !(party && strlen(party)) || !(var->name && strlen(var->name))) {
 				ast_log(LOG_NOTICE, "Please check the feature Mapping Syntax, either extension, name, or app aren't provided %s %s %s %s\n",app,exten,party,var->name);
-				free(tmp_val);
+				free(tmp_val_orig);
 				var = var->next;
 				continue;
 			}
@@ -2090,7 +2085,7 @@
 				}
 				if (!feature) {
 					ast_log(LOG_NOTICE, "Malloc failed at feature mapping\n");
-					free(tmp_val);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2099,7 +2094,6 @@
 				ast_copy_string(feature->sname,var->name,FEATURE_SNAME_LEN);
 				ast_copy_string(feature->app,app,FEATURE_APP_LEN);
 				ast_copy_string(feature->exten, exten,FEATURE_EXTEN_LEN);
-				free(tmp_val);
 				
 				if (app_args) 
 					ast_copy_string(feature->app_args,app_args,FEATURE_APP_ARGS_LEN);
@@ -2114,6 +2108,7 @@
 					ast_set_flag(feature,AST_FEATURE_FLAG_CALLEE);
 				else {
 					ast_log(LOG_NOTICE, "Invalid party specification for feature '%s', must be caller, or callee\n", var->name);
+					free(tmp_val_orig);
 					var = var->next;
 					continue;
 				}
@@ -2121,6 +2116,7 @@
 				ast_register_feature(feature);
 				
 				if (option_verbose >=1) ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
+				free(tmp_val_orig);
 			}
 			var = var->next;
 		}	 



More information about the asterisk-commits mailing list