[svn-commits] loren: branch loren/sdp-parser r276615 - in /team/loren/sdp-parser: ./ addons...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 15 02:32:37 CDT 2010


Author: loren
Date: Thu Jul 15 02:32:16 2010
New Revision: 276615

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=276615
Log:
completed most of refactoring

Added:
    team/loren/sdp-parser/contrib/realtime/
      - copied from r276571, trunk/contrib/realtime/
    team/loren/sdp-parser/contrib/realtime/mysql/
      - copied from r276571, trunk/contrib/realtime/mysql/
    team/loren/sdp-parser/contrib/realtime/mysql/iaxfriends.sql
      - copied unchanged from r276571, trunk/contrib/realtime/mysql/iaxfriends.sql
    team/loren/sdp-parser/contrib/realtime/mysql/meetme.sql
      - copied unchanged from r276571, trunk/contrib/realtime/mysql/meetme.sql
    team/loren/sdp-parser/contrib/realtime/mysql/sipfriends.sql
      - copied unchanged from r276571, trunk/contrib/realtime/mysql/sipfriends.sql
    team/loren/sdp-parser/contrib/realtime/mysql/voicemail.sql
      - copied unchanged from r276571, trunk/contrib/realtime/mysql/voicemail.sql
    team/loren/sdp-parser/contrib/realtime/oracle/
      - copied from r276571, trunk/contrib/realtime/oracle/
    team/loren/sdp-parser/contrib/realtime/postgresql/
      - copied from r276571, trunk/contrib/realtime/postgresql/
    team/loren/sdp-parser/contrib/realtime/postgresql/realtime.sql
      - copied unchanged from r276571, trunk/contrib/realtime/postgresql/realtime.sql
    team/loren/sdp-parser/contrib/realtime/sqlserver/
      - copied from r276571, trunk/contrib/realtime/sqlserver/
    team/loren/sdp-parser/contrib/scripts/voicemailpwcheck.py
      - copied unchanged from r276571, trunk/contrib/scripts/voicemailpwcheck.py
    team/loren/sdp-parser/include/asterisk/netsock2.h
      - copied unchanged from r276571, trunk/include/asterisk/netsock2.h
    team/loren/sdp-parser/main/netsock2.c
      - copied unchanged from r276571, trunk/main/netsock2.c
    team/loren/sdp-parser/res/res_crypto.exports.in
      - copied unchanged from r276571, trunk/res/res_crypto.exports.in
    team/loren/sdp-parser/tests/test_func_file.c
      - copied unchanged from r276571, trunk/tests/test_func_file.c
Removed:
    team/loren/sdp-parser/contrib/scripts/iax-friends.sql
    team/loren/sdp-parser/contrib/scripts/meetme.sql
    team/loren/sdp-parser/contrib/scripts/realtime_pgsql.sql
    team/loren/sdp-parser/contrib/scripts/sip-friends.sql
    team/loren/sdp-parser/contrib/scripts/vmdb.sql
    team/loren/sdp-parser/funcs/func_connectedline.c
    team/loren/sdp-parser/funcs/func_redirecting.c
    team/loren/sdp-parser/main/adsistub.c
    team/loren/sdp-parser/main/cryptostub.c
Modified:
    team/loren/sdp-parser/   (props changed)
    team/loren/sdp-parser/CHANGES
    team/loren/sdp-parser/CREDITS
    team/loren/sdp-parser/UPGRADE.txt
    team/loren/sdp-parser/addons/chan_ooh323.c
    team/loren/sdp-parser/apps/app_alarmreceiver.c
    team/loren/sdp-parser/apps/app_amd.c
    team/loren/sdp-parser/apps/app_dial.c
    team/loren/sdp-parser/apps/app_directed_pickup.c
    team/loren/sdp-parser/apps/app_disa.c
    team/loren/sdp-parser/apps/app_dumpchan.c
    team/loren/sdp-parser/apps/app_externalivr.c
    team/loren/sdp-parser/apps/app_fax.c
    team/loren/sdp-parser/apps/app_followme.c
    team/loren/sdp-parser/apps/app_macro.c
    team/loren/sdp-parser/apps/app_meetme.c
    team/loren/sdp-parser/apps/app_minivm.c
    team/loren/sdp-parser/apps/app_osplookup.c
    team/loren/sdp-parser/apps/app_parkandannounce.c
    team/loren/sdp-parser/apps/app_privacy.c
    team/loren/sdp-parser/apps/app_queue.c
    team/loren/sdp-parser/apps/app_readexten.c
    team/loren/sdp-parser/apps/app_rpt.c
    team/loren/sdp-parser/apps/app_setcallerid.c
    team/loren/sdp-parser/apps/app_sms.c
    team/loren/sdp-parser/apps/app_stack.c
    team/loren/sdp-parser/apps/app_talkdetect.c
    team/loren/sdp-parser/apps/app_voicemail.c
    team/loren/sdp-parser/apps/app_while.c
    team/loren/sdp-parser/apps/app_zapateller.c
    team/loren/sdp-parser/cdr/cdr_csv.c
    team/loren/sdp-parser/cdr/cdr_pgsql.c
    team/loren/sdp-parser/cel/cel_pgsql.c
    team/loren/sdp-parser/channels/sip/include/sip.h
    team/loren/sdp-parser/channels/sip/sdp_parser.c
    team/loren/sdp-parser/configs/cdr.conf.sample
    team/loren/sdp-parser/configs/features.conf.sample
    team/loren/sdp-parser/configs/osp.conf.sample
    team/loren/sdp-parser/configs/say.conf.sample
    team/loren/sdp-parser/configs/sip.conf.sample
    team/loren/sdp-parser/configs/unistim.conf.sample
    team/loren/sdp-parser/configs/voicemail.conf.sample
    team/loren/sdp-parser/doc/osp.txt
    team/loren/sdp-parser/doc/tex/cdrdriver.tex
    team/loren/sdp-parser/doc/tex/celdriver.tex
    team/loren/sdp-parser/funcs/func_blacklist.c
    team/loren/sdp-parser/funcs/func_callerid.c
    team/loren/sdp-parser/funcs/func_dialplan.c
    team/loren/sdp-parser/funcs/func_env.c
    team/loren/sdp-parser/funcs/func_math.c
    team/loren/sdp-parser/funcs/func_strings.c
    team/loren/sdp-parser/include/asterisk/acl.h
    team/loren/sdp-parser/include/asterisk/adsi.h
    team/loren/sdp-parser/include/asterisk/agi.h
    team/loren/sdp-parser/include/asterisk/callerid.h
    team/loren/sdp-parser/include/asterisk/cdr.h
    team/loren/sdp-parser/include/asterisk/channel.h
    team/loren/sdp-parser/include/asterisk/config.h
    team/loren/sdp-parser/include/asterisk/crypto.h
    team/loren/sdp-parser/include/asterisk/data.h
    team/loren/sdp-parser/include/asterisk/dnsmgr.h
    team/loren/sdp-parser/include/asterisk/indications.h
    team/loren/sdp-parser/include/asterisk/optional_api.h
    team/loren/sdp-parser/include/asterisk/rtp_engine.h
    team/loren/sdp-parser/include/asterisk/tcptls.h
    team/loren/sdp-parser/include/asterisk/test.h
    team/loren/sdp-parser/main/Makefile
    team/loren/sdp-parser/main/acl.c
    team/loren/sdp-parser/main/app.c
    team/loren/sdp-parser/main/asterisk.dynamics
    team/loren/sdp-parser/main/callerid.c
    team/loren/sdp-parser/main/ccss.c
    team/loren/sdp-parser/main/cdr.c
    team/loren/sdp-parser/main/cel.c
    team/loren/sdp-parser/main/channel.c
    team/loren/sdp-parser/main/cli.c
    team/loren/sdp-parser/main/config.c
    team/loren/sdp-parser/main/data.c
    team/loren/sdp-parser/main/dial.c
    team/loren/sdp-parser/main/dnsmgr.c
    team/loren/sdp-parser/main/features.c
    team/loren/sdp-parser/main/file.c
    team/loren/sdp-parser/main/http.c
    team/loren/sdp-parser/main/indications.c
    team/loren/sdp-parser/main/loader.c
    team/loren/sdp-parser/main/manager.c
    team/loren/sdp-parser/main/pbx.c
    team/loren/sdp-parser/main/rtp_engine.c
    team/loren/sdp-parser/main/tcptls.c
    team/loren/sdp-parser/main/test.c
    team/loren/sdp-parser/res/res_adsi.c
    team/loren/sdp-parser/res/res_adsi.exports.in
    team/loren/sdp-parser/res/res_agi.c
    team/loren/sdp-parser/res/res_crypto.c
    team/loren/sdp-parser/res/res_fax.c
    team/loren/sdp-parser/res/res_odbc.c
    team/loren/sdp-parser/res/res_rtp_asterisk.c
    team/loren/sdp-parser/res/res_rtp_multicast.c
    team/loren/sdp-parser/res/res_timing_kqueue.c
    team/loren/sdp-parser/res/snmp/agent.c
    team/loren/sdp-parser/tests/test_acl.c
    team/loren/sdp-parser/tests/test_aoc.c
    team/loren/sdp-parser/tests/test_app.c
    team/loren/sdp-parser/tests/test_ast_format_str_reduce.c
    team/loren/sdp-parser/tests/test_astobj2.c
    team/loren/sdp-parser/tests/test_devicestate.c
    team/loren/sdp-parser/tests/test_event.c
    team/loren/sdp-parser/tests/test_gosub.c
    team/loren/sdp-parser/tests/test_heap.c
    team/loren/sdp-parser/tests/test_pbx.c
    team/loren/sdp-parser/tests/test_sched.c
    team/loren/sdp-parser/tests/test_skel.c
    team/loren/sdp-parser/tests/test_stringfields.c
    team/loren/sdp-parser/tests/test_strings.c
    team/loren/sdp-parser/tests/test_substitution.c
    team/loren/sdp-parser/tests/test_time.c
    team/loren/sdp-parser/tests/test_utils.c

Propchange: team/loren/sdp-parser/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/loren/sdp-parser/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/loren/sdp-parser/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul 15 02:32:16 2010
@@ -1,1 +1,2 @@
 /be/branches/C.3:256426
+/trunk:274094-276571

Propchange: team/loren/sdp-parser/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jul 15 02:32:16 2010
@@ -1,1 +1,1 @@
-/trunk:1-274088
+/trunk:1-276572

Modified: team/loren/sdp-parser/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/CHANGES?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/CHANGES (original)
+++ team/loren/sdp-parser/CHANGES Thu Jul 15 02:32:16 2010
@@ -69,6 +69,8 @@
    Charge messages to snom phones.
  * Added support for G.719 media streams.
  * Added support for 16khz signed linear media streams.
+ * SIP is now able to bind to and communicate with IPv6 addresses. In addition,
+   RTP has been outfitted with the same abilities.
 
 IAX2 Changes
 -----------
@@ -91,12 +93,6 @@
 ------------
  * Added 'p' option to PickupChan() to allow for picking up channel by the first
    match to a partial channel name.
- * Added "ready" option to QUEUE_MEMBER counting to count free agents whose wrap-up
-   timeout has expired.
- * Added 'R' option to app_queue.  This option stops moh and indicates ringing
-   to the caller when an Agent's phone is ringing.  This can be used to indicate
-   to the caller that their call is about to be picked up, which is nice when
-   one has been on hold for an extened period of time.
  * Added .m3u support for Mp3Player application.
  * Added progress option to the app_dial D() option.  When progress DTMF is
    present, those values are sent immediately upon receiving a PROGRESS message
@@ -165,6 +161,9 @@
  * Two new applications are provided for declining counting phrases in multiple
    languages.  See the application notes for SayCountedNoun and SayCountedAdj for
    more information.
+ * Voicemail now runs the externnotify script when pollmailboxes is activated and
+   notices a change.
+ * Voicemail now includes rdnis within msgXXXX.txt file.
 
 Dialplan Functions
 ------------------
@@ -230,6 +229,7 @@
    on hold or is a call waiting call.
  * Added option to dialplan function CDR(), the 'f' option
    allows for high resolution times for billsec and duration fields.
+ * FILE() now supports line-mode and writing.
 
 Dialplan Variables
 ------------------
@@ -248,57 +248,63 @@
 
 Queue changes
 -------------
-  * A new config option, penaltymemberslimit, has been added to queues.conf.
-    When set this option will disregard penalty settings when a queue has too
-    few members.
-  * A new option, 'I' has been added to both app_queue and app_dial.
-    By setting this option, Asterisk will not update the caller with
-    connected line changes or redirecting party changes when they occur.
-  * A 'relative-peroidic-announce' option has been added to queues.conf.  When
-    enabled, this option will cause periodic announce times to be calculated
-    from the end of announcements rather than from the beginning.
-  * The autopause option in queues.conf can be passed a new value, "all." The
-    result is that if a member becomes auto-paused, he will be paused in all
-	queues for which he is a member, not just the queue that failed to reach
-	the member.
+ * Added "ready" option to QUEUE_MEMBER counting to count free agents whose wrap-up
+   timeout has expired.
+ * Added 'R' option to app_queue.  This option stops moh and indicates ringing
+   to the caller when an Agent's phone is ringing.  This can be used to indicate
+   to the caller that their call is about to be picked up, which is nice when
+   one has been on hold for an extened period of time.
+ * A new config option, penaltymemberslimit, has been added to queues.conf.
+   When set this option will disregard penalty settings when a queue has too
+   few members.
+ * A new option, 'I' has been added to both app_queue and app_dial.
+   By setting this option, Asterisk will not update the caller with
+   connected line changes or redirecting party changes when they occur.
+ * A 'relative-peroidic-announce' option has been added to queues.conf.  When
+   enabled, this option will cause periodic announce times to be calculated
+   from the end of announcements rather than from the beginning.
+ * The autopause option in queues.conf can be passed a new value, "all." The
+   result is that if a member becomes auto-paused, he will be paused in all
+   queues for which he is a member, not just the queue that failed to reach
+   the member.
 
 mISDN channel driver (chan_misdn) changes
 ----------------------------------------
-  * Added display_connected parameter to misdn.conf to put a display string
-    in the CONNECT message containing the connected name and/or number if
-    the presentation setting permits it.
-  * Added display_setup parameter to misdn.conf to put a display string
-    in the SETUP message containing the caller name and/or number if the
-    presentation setting permits it.
-  * Made misdn.conf parameters localdialplan and cpndialplan take a -1 to
-    indicate the dialplan settings are to be obtained from the asterisk
-    channel.
-  * Made misdn.conf parameter callerid accept the "name" <number> format
-    used by the rest of the system.
-  * Made use the nationalprefix and internationalprefix misdn.conf
-    parameters to prefix any received number from the ISDN link if that
-    number has the corresponding Type-Of-Number.  NOTE:  This includes
-    comparing the incoming call's dialed number against the MSN list.
-  * Added the following new parameters: unknownprefix, netspecificprefix,
-    subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
-    received number from the ISDN link if that number has the corresponding
-    Type-Of-Number.
-  * Added new dialplan application misdn_command which permits controlling
-    the CCBS/CCNR functionality.
-  * Added new dialplan function mISDN_CC which permits retrieval of various
-    values from an active call completion record.
-  * For PTP, you should manually send the COLR of the redirected-to party
-    for an incomming redirected call if the incoming call could experience
-    further redirects.  Just set the REDIRECTING(to-num,i) = ${EXTEN} and
-    set the REDIRECTING(to-pres) to the COLR.  A call has been redirected
-    if the REDIRECTING(from-num) is not empty.
-  * For outgoing PTP redirected calls, you now need to use the inhibit(i)
-    option on all of the REDIRECTING statements before dialing the
-    redirected-to party.  You still have to set the REDIRECTING(to-xxx,i)
-    and the REDIRECTING(from-xxx,i) values.  The PTP call will update the
-    redirecting-to presentation (COLR) when it becomes available.
-  * Added outgoing_colp parameter to misdn.conf to filter outgoing COLP
-    information.
+ * Added display_connected parameter to misdn.conf to put a display string
+   in the CONNECT message containing the connected name and/or number if
+   the presentation setting permits it.
+ * Added display_setup parameter to misdn.conf to put a display string
+   in the SETUP message containing the caller name and/or number if the
+   presentation setting permits it.
+ * Made misdn.conf parameters localdialplan and cpndialplan take a -1 to
+   indicate the dialplan settings are to be obtained from the asterisk
+   channel.
+ * Made misdn.conf parameter callerid accept the "name" <number> format
+   used by the rest of the system.
+ * Made use the nationalprefix and internationalprefix misdn.conf
+   parameters to prefix any received number from the ISDN link if that
+   number has the corresponding Type-Of-Number.  NOTE:  This includes
+   comparing the incoming call's dialed number against the MSN list.
+ * Added the following new parameters: unknownprefix, netspecificprefix,
+   subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
+   received number from the ISDN link if that number has the corresponding
+   Type-Of-Number.
+ * Added new dialplan application misdn_command which permits controlling
+   the CCBS/CCNR functionality.
+ * Added new dialplan function mISDN_CC which permits retrieval of various
+   values from an active call completion record.
+ * For PTP, you should manually send the COLR of the redirected-to party
+   for an incomming redirected call if the incoming call could experience
+   further redirects.  Just set the REDIRECTING(to-num,i) = ${EXTEN} and
+   set the REDIRECTING(to-pres) to the COLR.  A call has been redirected
+   if the REDIRECTING(from-num) is not empty.
+ * For outgoing PTP redirected calls, you now need to use the inhibit(i)
+   option on all of the REDIRECTING statements before dialing the
+   redirected-to party.  You still have to set the REDIRECTING(to-xxx,i)
+   and the REDIRECTING(from-xxx,i) values.  The PTP call will update the
+   redirecting-to presentation (COLR) when it becomes available.
+ * Added outgoing_colp parameter to misdn.conf to filter outgoing COLP
+   information.
 
 thirdparty mISDN enhancements
 -----------------------------
@@ -508,7 +514,8 @@
  * The addition of G.719 pass-through support.
  * Added support for 16khz Speex audio.  This can be enabled by using 'allow=speex16'
    during device configuration.
-
+ * The UNISTIM channel driver (chan_unistim) has been updated to support devices that
+   have less than 3 lines on the LCD.
 
 CLI Changes
 -----------

Modified: team/loren/sdp-parser/CREDITS
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/CREDITS?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/CREDITS (original)
+++ team/loren/sdp-parser/CREDITS Thu Jul 15 02:32:16 2010
@@ -174,6 +174,8 @@
 Cedric Hans - Development of chan_unistim
   cedric.hans(AT)mlkj.net
 
+Takao Takahashi & Mina Naguib - chan_unistim improvements for smaller devices
+
 Sergio Fadda - console_video: video support for chan_oss and chan_alsa
 
 Marta Carbone - console_video and the astobj2 framework

Modified: team/loren/sdp-parser/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/UPGRADE.txt?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/UPGRADE.txt (original)
+++ team/loren/sdp-parser/UPGRADE.txt Thu Jul 15 02:32:16 2010
@@ -82,6 +82,9 @@
   of a Mailbox or Password, will, if it exists, jump to the 'a' extension in
   the current dialplan context.
 
+* The CALLERPRES() dialplan function is deprecated in favor of
+  CALLERID(num-pres) and CALLERID(name-pres).
+
 * Environment variables that start with "AST_" are reserved to the system and
   may no longer be set from the dialplan.
 
@@ -91,6 +94,10 @@
 * The CDR handling of billsec and duration field has changed. If your table
   definition specifies those fields as float,double or similar they will now
   be logged with microsecond accuracy instead of a whole integer.
+
+* chan_sip will no longer set up a local call forward when receiving a
+  482 Loop Detected response. The dialplan will just continue from where it
+  left off.
 
 From 1.6.1 to 1.6.2:
 

Modified: team/loren/sdp-parser/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/addons/chan_ooh323.c?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/addons/chan_ooh323.c (original)
+++ team/loren/sdp-parser/addons/chan_ooh323.c Thu Jul 15 02:32:16 2010
@@ -460,6 +460,7 @@
 {
 	struct ooh323_pvt *pvt = NULL;
 	struct sockaddr_in ouraddr;
+	struct ast_sockaddr tmp;
 	struct in_addr ipAddr;
 	if (gH323Debug)
 		ast_verbose("---   ooh323_alloc\n");
@@ -481,8 +482,10 @@
 		return NULL;
 	}
 
+	ouraddr.sin_family = AF_INET;
 	ouraddr.sin_addr = ipAddr;
-	if (!(pvt->rtp = ast_rtp_instance_new("asterisk", sched, &ouraddr, NULL))) {
+	ast_sockaddr_from_sin(&tmp, &ouraddr);
+	if (!(pvt->rtp = ast_rtp_instance_new("asterisk", sched, &tmp, NULL))) {
 		ast_log(LOG_WARNING, "Unable to create RTP session: %s\n", 
 				  strerror(errno));
 		ast_mutex_unlock(&pvt->lock);
@@ -919,24 +922,23 @@
 	}
 	ast_mutex_lock(&p->lock);
 	ast_set_flag(p, H323_OUTGOING);
-	if (ast->connected.id.number) {
-     		if(p->callerid_num)   free(p->callerid_num);
-		p->callerid_num = strdup(ast->connected.id.number);
-	}
-
-	if (ast->connected.id.name) {
-      		if(p->callerid_name)
-			free(p->callerid_name);
-		p->callerid_name = strdup(ast->connected.id.name);
-	} else if (ast->connected.id.number) {
-      		if(p->callerid_name)
-			free(p->callerid_name);
-		p->callerid_name = strdup(ast->connected.id.number);
+	if (ast->connected.id.number.valid && ast->connected.id.number.str) {
+		free(p->callerid_num);
+		p->callerid_num = strdup(ast->connected.id.number.str);
+	}
+
+	if (ast->connected.id.name.valid && ast->connected.id.name.str) {
+		free(p->callerid_name);
+		p->callerid_name = strdup(ast->connected.id.name.str);
+	} else if (ast->connected.id.number.valid && ast->connected.id.number.str) {
+		free(p->callerid_name);
+		p->callerid_name = strdup(ast->connected.id.number.str);
 	} else {
-		ast->connected.id.name = strdup(gCallerID);
-      		if(p->callerid_name)
-			free(p->callerid_name);
-		p->callerid_name = strdup(ast->connected.id.name);
+		ast->connected.id.name.valid = 1;
+		free(ast->connected.id.name.str);
+		ast->connected.id.name.str = strdup(gCallerID);
+		free(p->callerid_name);
+		p->callerid_name = strdup(ast->connected.id.name.str);
 	}
 
 	/* Retrieve vars */
@@ -1238,13 +1240,15 @@
 	case AST_CONTROL_SRCCHANGE:
 		ast_rtp_instance_change_source(p->rtp);
 		break;
-       	case AST_CONTROL_CONNECTED_LINE:
-		if (!ast_strlen_zero(ast->connected.id.name)) {
-			if (gH323Debug)
-				ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
-				callToken, ast->connected.id.name);
-			ooSetANI(callToken, ast->connected.id.name);
-		}
+	case AST_CONTROL_CONNECTED_LINE:
+		if (!ast->connected.id.name.valid
+			|| ast_strlen_zero(ast->connected.id.name.str)) {
+			break;
+		}
+		if (gH323Debug)
+			ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
+				callToken, ast->connected.id.name.str);
+		ooSetANI(callToken, ast->connected.id.name.str);
 		break;
 
       case AST_CONTROL_T38_PARAMETERS:
@@ -1536,10 +1540,15 @@
 
 	if (call->remoteDisplayName) {
 		struct ast_party_connected_line connected;
+		struct ast_set_party_connected_line update_connected;
+
+		memset(&update_connected, 0, sizeof(update_connected));
+		update_connected.id.name = 1;
 		ast_party_connected_line_init(&connected);
-		connected.id.name = (char *) call->remoteDisplayName;
+		connected.id.name.valid = 1;
+		connected.id.name.str = (char *) call->remoteDisplayName;
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-		ast_channel_queue_connected_line_update(c, &connected);
+		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
@@ -1587,10 +1596,15 @@
 
 	if (call->remoteDisplayName) {
 		struct ast_party_connected_line connected;
+		struct ast_set_party_connected_line update_connected;
+
+		memset(&update_connected, 0, sizeof(update_connected));
+		update_connected.id.name = 1;
 		ast_party_connected_line_init(&connected);
-		connected.id.name = (char *) call->remoteDisplayName;
+		connected.id.name.valid = 1;
+		connected.id.name.str = (char *) call->remoteDisplayName;
 		connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-		ast_channel_queue_connected_line_update(c, &connected);
+		ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 	}
 	if (c->_state != AST_STATE_UP)
 		ast_setstate(c, AST_STATE_RINGING);
@@ -1980,10 +1994,15 @@
 
 			if (call->remoteDisplayName) {
 				struct ast_party_connected_line connected;
+				struct ast_set_party_connected_line update_connected;
+
+				memset(&update_connected, 0, sizeof(update_connected));
+				update_connected.id.name = 1;
 				ast_party_connected_line_init(&connected);
-				connected.id.name = (char *) call->remoteDisplayName;
+				connected.id.name.valid = 1;
+				connected.id.name.str = (char *) call->remoteDisplayName;
 				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-				ast_channel_queue_connected_line_update(c, &connected);
+				ast_channel_queue_connected_line_update(c, &connected, &update_connected);
 			}
 
 			ast_queue_control(c, AST_CONTROL_ANSWER);
@@ -3803,6 +3822,7 @@
 	struct ooh323_pvt *p;
 	struct sockaddr_in them;
 	struct sockaddr_in us;
+	struct ast_sockaddr tmp;
 	int mode;
 
 	if (gH323Debug)
@@ -3818,8 +3838,10 @@
 		ast_log(LOG_ERROR, "No Private Structure, this is bad\n");
 		return -1;
 	}
-	ast_rtp_instance_get_remote_address(rtp, &them);
-	ast_rtp_instance_get_local_address(rtp, &us);
+	ast_rtp_instance_get_remote_address(rtp, &tmp);
+	ast_sockaddr_to_sin(&tmp, &them);
+	ast_rtp_instance_get_local_address(rtp, &tmp);
+	ast_sockaddr_to_sin(&tmp, &us);
 	return 0;
 }
 
@@ -3829,6 +3851,7 @@
 int configure_local_rtp(struct ooh323_pvt *p, ooCallData *call)
 {
 	struct sockaddr_in us;
+	struct ast_sockaddr tmp;
 	ooMediaInfo mediaInfo;
 	int x;
 	format_t format = 0;
@@ -3849,7 +3872,8 @@
 				 p->rtp, p->dtmfcodec, "audio", "cisco-telephone-event", 0);
 		}
 		/* figure out our local RTP port and tell the H.323 stack about it*/
-		ast_rtp_instance_get_local_address(p->rtp, &us);
+		ast_rtp_instance_get_local_address(p->rtp, &tmp);
+		ast_sockaddr_to_sin(&tmp, &us);
 
 		if (p->rtptimeout) {
 			ast_rtp_instance_set_timeout(p->rtp, p->rtptimeout);
@@ -3913,6 +3937,7 @@
 {
 	struct ooh323_pvt *p = NULL;
 	struct sockaddr_in them;
+	struct ast_sockaddr tmp;
 
 	if (gH323Debug)
 		ast_verbose("---   setup_rtp_connection %s:%d\n", remoteIp, remotePort);
@@ -3928,7 +3953,8 @@
 	them.sin_family = AF_INET;
 	them.sin_addr.s_addr = inet_addr(remoteIp); /* only works for IPv4 */
 	them.sin_port = htons(remotePort);
-	ast_rtp_instance_set_remote_address(p->rtp, &them);
+	ast_sockaddr_from_sin(&tmp, &them);
+	ast_rtp_instance_set_remote_address(p->rtp, &tmp);
 
 	if (p->writeformat & AST_FORMAT_G726_AAL2) 
                 ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(p->rtp), p->rtp, 2,

Modified: team/loren/sdp-parser/apps/app_alarmreceiver.c
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/apps/app_alarmreceiver.c?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/apps/app_alarmreceiver.c (original)
+++ team/loren/sdp-parser/apps/app_alarmreceiver.c Thu Jul 15 02:32:16 2010
@@ -298,18 +298,22 @@
 	int res = 0;
 	struct timeval t;
 	struct ast_tm now;
-	char *cl,*cn;
+	char *cl;
+	char *cn;
 	char workstring[80];
 	char timestamp[80];
 	
 	/* Extract the caller ID location */
-	if (chan->cid.cid_num)
-		ast_copy_string(workstring, chan->cid.cid_num, sizeof(workstring));
-	workstring[sizeof(workstring) - 1] = '\0';
-
-	ast_callerid_parse(workstring, &cn, &cl);
-	if (cl)
-		ast_shrink_phone_number(cl);
+	ast_copy_string(workstring,
+		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, ""),
+		sizeof(workstring));
+	ast_shrink_phone_number(workstring);
+	if (ast_strlen_zero(workstring)) {
+		cl = "<unknown>";
+	} else {
+		cl = workstring;
+	}
+	cn = S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>");
 
 	/* Get the current time */
 	t = ast_tvnow();
@@ -319,27 +323,27 @@
 	ast_strftime(timestamp, sizeof(timestamp), time_stamp_format, &now);
 
 	res = fprintf(logfile, "\n\n[metadata]\n\n");
-
-	if (res >= 0)
+	if (res >= 0) {
 		res = fprintf(logfile, "PROTOCOL=%s\n", signalling_type);
-
-	if (res >= 0)
-		res = fprintf(logfile, "CALLINGFROM=%s\n", (!cl) ? "<unknown>" : cl);
-
-	if (res >- 0)
-		res = fprintf(logfile, "CALLERNAME=%s\n", (!cn) ? "<unknown>" : cn);
-
-	if (res >= 0)
+	}
+	if (res >= 0) {
+		res = fprintf(logfile, "CALLINGFROM=%s\n", cl);
+	}
+	if (res >= 0) {
+		res = fprintf(logfile, "CALLERNAME=%s\n", cn);
+	}
+	if (res >= 0) {
 		res = fprintf(logfile, "TIMESTAMP=%s\n\n", timestamp);
-
-	if (res >= 0)
+	}
+	if (res >= 0) {
 		res = fprintf(logfile, "[events]\n\n");
-
+	}
 	if (res < 0) {
 		ast_verb(3, "AlarmReceiver: can't write metadata\n");
 		ast_debug(1,"AlarmReceiver: can't write metadata\n");
-	} else
+	} else {
 		res = 0;
+	}
 
 	return res;
 }

Modified: team/loren/sdp-parser/apps/app_amd.c
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/apps/app_amd.c?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/apps/app_amd.c (original)
+++ team/loren/sdp-parser/apps/app_amd.c Thu Jul 15 02:32:16 2010
@@ -188,8 +188,10 @@
 		AST_APP_ARG(argMaximumWordLength);
 	);
 
-	ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name, chan->cid.cid_ani,
-		chan->redirecting.from.number, ast_getformatname(chan->readformat));
+	ast_verb(3, "AMD: %s %s %s (Fmt: %s)\n", chan->name,
+		S_COR(chan->caller.ani.number.valid, chan->caller.ani.number.str, "(N/A)"),
+		S_COR(chan->redirecting.from.number.valid, chan->redirecting.from.number.str, "(N/A)"),
+		ast_getformatname(chan->readformat));
 
 	/* Lets parse the arguments. */
 	if (!ast_strlen_zero(parse)) {

Modified: team/loren/sdp-parser/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/loren/sdp-parser/apps/app_dial.c?view=diff&rev=276615&r1=276614&r2=276615
==============================================================================
--- team/loren/sdp-parser/apps/app_dial.c (original)
+++ team/loren/sdp-parser/apps/app_dial.c Thu Jul 15 02:32:16 2010
@@ -722,13 +722,6 @@
 	}
 }
 
-/*! \brief free the buffer if allocated, and set the pointer to the second arg */
-#define S_REPLACE(s, new_val) \
-	do {                      \
-		ast_free(s);          \
-		s = (new_val);        \
-	} while (0)
-
 static int onedigit_goto(struct ast_channel *chan, const char *context, char exten, int pri)
 {
 	char rexten[2] = { exten, '\0' };
@@ -773,9 +766,11 @@
 		"UniqueID: %s\r\n"
 		"DestUniqueID: %s\r\n"
 		"Dialstring: %s\r\n",
-		src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
-		S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
-		dst->uniqueid, dialstring ? dialstring : "");
+		src->name, dst->name,
+		S_COR(src->caller.id.number.valid, src->caller.id.number.str, "<unknown>"),
+		S_COR(src->caller.id.name.valid, src->caller.id.name.str, "<unknown>"),
+		src->uniqueid, dst->uniqueid,
+		dialstring ? dialstring : "");
 }
 
 static void senddialendevent(struct ast_channel *src, const char *dialstatus)
@@ -859,28 +854,34 @@
 			ast_rtp_instance_early_bridge_make_compatible(c, in);
 		}
 
-		ast_channel_set_redirecting(c, &original->redirecting);
+		ast_channel_set_redirecting(c, &original->redirecting, NULL);
 		ast_channel_lock(c);
 		while (ast_channel_trylock(in)) {
 			CHANNEL_DEADLOCK_AVOIDANCE(c);
 		}
-		if (ast_strlen_zero(c->redirecting.from.number)) {
+		if (!c->redirecting.from.number.valid
+			|| ast_strlen_zero(c->redirecting.from.number.str)) {
 			/*
 			 * The call was not previously redirected so it is
 			 * now redirected from this number.
 			 */
-			S_REPLACE(c->redirecting.from.number,
-				ast_strdup(S_OR(in->macroexten, in->exten)));
-		}
-
-		c->cid.cid_tns = in->cid.cid_tns;
+			ast_party_number_free(&c->redirecting.from.number);
+			ast_party_number_init(&c->redirecting.from.number);
+			c->redirecting.from.number.valid = 1;
+			c->redirecting.from.number.str =
+				ast_strdup(S_OR(in->macroexten, in->exten));
+		}
+
+		c->dialed.transit_network_select = in->dialed.transit_network_select;
 
 		if (ast_test_flag64(o, OPT_FORCECLID)) {
-			S_REPLACE(c->cid.cid_num, ast_strdup(S_OR(in->macroexten, in->exten)));
-			S_REPLACE(c->cid.cid_name, NULL);
+			ast_party_id_free(&c->caller.id);
+			ast_party_id_init(&c->caller.id);
+			c->caller.id.number.valid = 1;
+			c->caller.id.number.str = ast_strdup(S_OR(in->macroexten, in->exten));
 			ast_string_field_set(c, accountcode, c->accountcode);
 		} else {
-			ast_party_caller_copy(&c->cid, &in->cid);
+			ast_party_caller_copy(&c->caller, &in->caller);
 			ast_string_field_set(c, accountcode, in->accountcode);
 		}
 		ast_party_connected_line_copy(&c->connected, &original->connected);
@@ -897,7 +898,7 @@
 			while (ast_channel_trylock(c)) {
 				CHANNEL_DEADLOCK_AVOIDANCE(in);
 			}
-			ast_channel_update_redirecting(in, &c->redirecting);
+			ast_channel_update_redirecting(in, &c->redirecting, NULL);
 			ast_channel_unlock(c);
 		}
 
@@ -985,10 +986,10 @@
 
 		if (!ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE) && !ast_test_flag64(outgoing, DIAL_CALLERID_ABSENT)) {
 			ast_channel_lock(outgoing->chan);
-			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->cid);
+			ast_connected_line_copy_from_caller(&connected_caller, &outgoing->chan->caller);
 			ast_channel_unlock(outgoing->chan);
 			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-			ast_channel_update_connected_line(in, &connected_caller);
+			ast_channel_update_connected_line(in, &connected_caller, NULL);
 			ast_party_connected_line_free(&connected_caller);
 		}
 	}
@@ -1045,14 +1046,14 @@
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 						if (o->pending_connected_update) {
 							if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
-								ast_channel_update_connected_line(in, &o->connected);
+								ast_channel_update_connected_line(in, &o->connected, NULL);
 							}
 						} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 							ast_channel_lock(c);
-							ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+							ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 							ast_channel_unlock(c);
 							connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-							ast_channel_update_connected_line(in, &connected_caller);
+							ast_channel_update_connected_line(in, &connected_caller, NULL);
 							ast_party_connected_line_free(&connected_caller);
 						}
 					}
@@ -1115,14 +1116,14 @@
 						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 							if (o->pending_connected_update) {
 								if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
-									ast_channel_update_connected_line(in, &o->connected);
+									ast_channel_update_connected_line(in, &o->connected, NULL);
 								}
 							} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
 								ast_channel_lock(c);
-								ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
+								ast_connected_line_copy_from_caller(&connected_caller, &c->caller);
 								ast_channel_unlock(c);
 								connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-								ast_channel_update_connected_line(in, &connected_caller);
+								ast_channel_update_connected_line(in, &connected_caller, NULL);
 								ast_party_connected_line_free(&connected_caller);
 							}
 						}
@@ -1240,7 +1241,7 @@
 						ast_verb(3, "%s connected line has changed. Saving it until answer for %s\n", c->name, in->name);
 						ast_party_connected_line_set_init(&connected, &o->connected);
 						ast_connected_line_parse_data(f->data.ptr, f->datalen, &connected);
-						ast_party_connected_line_set(&o->connected, &connected);
+						ast_party_connected_line_set(&o->connected, &connected, NULL);
 						ast_party_connected_line_free(&connected);
 						o->pending_connected_update = 1;
 					} else {
@@ -1617,8 +1618,9 @@
 	char *l;
 	int silencethreshold;
 
-	if (!ast_strlen_zero(chan->cid.cid_num)) {
-		l = ast_strdupa(chan->cid.cid_num);
+	if (chan->caller.id.number.valid
+		&& !ast_strlen_zero(chan->caller.id.number.str)) {
+		l = ast_strdupa(chan->caller.id.number.str);
 		ast_shrink_phone_number(l);
 		if (ast_test_flag64(opts, OPT_PRIVACY) ) {
 			ast_verb(3, "Privacy DB is '%s', clid is '%s'\n", opt_args[OPT_ARG_PRIVACY], l);
@@ -2060,11 +2062,16 @@
 		memset(&tc->whentohangup, 0, sizeof(tc->whentohangup));
 
 		/* If the new channel has no callerid, try to guess what it should be */
-		if (ast_strlen_zero(tc->cid.cid_num)) {
-			if (!ast_strlen_zero(chan->connected.id.number)) {
-				ast_set_callerid(tc, chan->connected.id.number, chan->connected.id.name, chan->connected.ani);
-			} else if (!ast_strlen_zero(chan->cid.cid_dnid)) {
-				ast_set_callerid(tc, chan->cid.cid_dnid, NULL, NULL);
+		if (!tc->caller.id.number.valid) {
+			if (chan->connected.id.number.valid) {
+				struct ast_party_caller caller;
+
+				ast_party_caller_set_init(&caller, &tc->caller);
+				caller.id = chan->connected.id;
+				caller.ani = chan->connected.ani;
+				ast_channel_set_caller_event(tc, &caller, NULL);
+			} else if (!ast_strlen_zero(chan->dialed.number.str)) {
+				ast_set_callerid(tc, chan->dialed.number.str, NULL, NULL);
 			} else if (!ast_strlen_zero(S_OR(chan->macroexten, chan->exten))) {
 				ast_set_callerid(tc, S_OR(chan->macroexten, chan->exten), NULL, NULL);
 			}
@@ -2076,25 +2083,33 @@
 			int pres;
 
 			ast_party_connected_line_set_init(&connected, &tmp->chan->connected);
-			connected.id.number = cid_num;
-			connected.id.name = cid_name;
-			connected.id.tag = cid_tag;
 			if (cid_pres) {
 				pres = ast_parse_caller_presentation(cid_pres);
-				if (pres >= 0) {
-					connected.id.number_presentation = pres;
+				if (pres < 0) {
+					pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
 				}
 			} else {
-				connected.id.number_presentation = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
-			}
-			ast_channel_set_connected_line(tmp->chan, &connected);
+				pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
+			}
+			if (cid_num) {
+				connected.id.number.valid = 1;
+				connected.id.number.str = cid_num;
+				connected.id.number.presentation = pres;
+			}
+			if (cid_name) {
+				connected.id.name.valid = 1;
+				connected.id.name.str = cid_name;
+				connected.id.name.presentation = pres;
+			}
+			connected.id.tag = cid_tag;
+			ast_channel_set_connected_line(tmp->chan, &connected, NULL);
 		} else {
-			ast_connected_line_copy_from_caller(&tc->connected, &chan->cid);
+			ast_connected_line_copy_from_caller(&tc->connected, &chan->caller);
 		}
 
 		ast_party_redirecting_copy(&tc->redirecting, &chan->redirecting);
 
-		tc->cid.cid_tns = chan->cid.cid_tns;
+		tc->dialed.transit_network_select = chan->dialed.transit_network_select;
 
 		if (!ast_strlen_zero(chan->accountcode)) {
 			ast_string_field_set(tc, peeraccount, chan->accountcode);
@@ -2350,6 +2365,11 @@
 		}
 
 		if (chan && peer && ast_test_flag64(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) {
+			/* chan and peer are going into the PBX, they both
+			 * should probably get CDR records. */
+			ast_clear_flag(chan->cdr, AST_CDR_FLAG_DIALED);
+			ast_clear_flag(peer->cdr, AST_CDR_FLAG_DIALED);
+
 			replace_macro_delimiter(opt_args[OPT_ARG_GOTO]);
 			ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
 			/* peer goes to the same context and extension as chan, so just copy info from chan*/
@@ -2611,7 +2631,9 @@
 
 		strcpy(peer->context, chan->context);
 
-		if (ast_test_flag64(&opts, OPT_PEER_H) && ast_exists_extension(peer, peer->context, "h", 1, peer->cid.cid_num)) {

[... 19692 lines stripped ...]



More information about the svn-commits mailing list