[asterisk-commits] mmichelson: branch group/issue8824 r144315 - in /team/group/issue8824: channe...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 24 17:08:25 CDT 2008
Author: mmichelson
Date: Wed Sep 24 17:08:25 2008
New Revision: 144315
URL: http://svn.digium.com/view/asterisk?view=rev&rev=144315
Log:
This commit introduces the ability to make the header
used for remote party ID configurable in sip.conf.
The choices for the 'rpid_header' variable are
rpid - use "Remote-Party-ID" header
pai - use "P-Asserted-Identity" header
Modified:
team/group/issue8824/channels/chan_sip.c
team/group/issue8824/configs/sip.conf.sample
Modified: team/group/issue8824/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_sip.c?view=diff&rev=144315&r1=144314&r2=144315
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Wed Sep 24 17:08:25 2008
@@ -1067,7 +1067,10 @@
#define SIP_PROG_INBAND_NO (1 << 25)
#define SIP_PROG_INBAND_YES (2 << 25)
-#define SIP_SENDRPID (1 << 29) /*!< DP: Remote Party-ID Support */
+#define SIP_SENDRPID (3 << 29) /*!< DP: Remote Party-ID Support */
+#define SIP_SENDRPID_NO (0 << 29)
+#define SIP_SENDRPID_PAI (1 << 29) /*!< Use "P-Asserted-Identity" for rpid */
+#define SIP_SENDRPID_RPID (2 << 29) /*!< Use "Remote-Party-ID" for rpid */
#define SIP_G726_NONSTANDARD (1 << 31) /*!< DP: Use non-standard packing for G726-32 data */
/*! \brief Flags to copy from peer/user to dialog */
@@ -8172,7 +8175,11 @@
if (!ast_strlen_zero(privacy) && !ast_strlen_zero(screen))
snprintf(tmp + strlen(tmp), sizeof(tmp) - strlen(tmp), ";privacy=%s;screen=%s", privacy, screen);
- add_header(req, "Remote-Party-ID", tmp);
+ if (ast_test_flag(&p->flags[0], SIP_SENDRPID_RPID)) {
+ add_header(req, "Remote-Party-ID", tmp);
+ } else {
+ add_header(req, "P-Asserted-Identity", tmp);
+ }
return 0;
}
@@ -20792,6 +20799,16 @@
} else if (!strcasecmp(v->name, "sendrpid")) {
ast_set_flag(&mask[0], SIP_SENDRPID);
ast_set2_flag(&flags[0], ast_true(v->value), SIP_SENDRPID);
+ } else if (!strcasecmp(v->name, "rpid_header")) {
+ ast_clear_flag(&flags[0], SIP_SENDRPID);
+ if (!strcasecmp(v->value, "rpid")) {
+ ast_set_flag(&flags[0], SIP_SENDRPID_RPID);
+ } else if (!strcasecmp(v->value, "pai")) {
+ ast_set_flag(&flags[0], SIP_SENDRPID_PAI);
+ } else {
+ ast_log(LOG_NOTICE, "Unrecognized rpid_header value '%s'\n", v->value);
+ ast_set_flag(&flags[0], SIP_SENDRPID_RPID);
+ }
} else if (!strcasecmp(v->name, "g726nonstandard")) {
ast_set_flag(&mask[0], SIP_G726_NONSTANDARD);
ast_set2_flag(&flags[0], ast_true(v->value), SIP_G726_NONSTANDARD);
Modified: team/group/issue8824/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/configs/sip.conf.sample?view=diff&rev=144315&r1=144314&r2=144315
==============================================================================
--- team/group/issue8824/configs/sip.conf.sample (original)
+++ team/group/issue8824/configs/sip.conf.sample Wed Sep 24 17:08:25 2008
@@ -183,6 +183,9 @@
;relaxdtmf=yes ; Relax dtmf handling
;trustrpid = no ; If Remote-Party-ID should be trusted
;sendrpid = yes ; If Remote-Party-ID should be sent
+;rpid_header = rpid ; Which header should be used when sending Remote Party ID
+ ; 'rpid' means to send "Remote-Party-ID"
+ ; 'pai' means to send "P-Asserted-Identity"
;progressinband=never ; If we should generate in-band ringing always
; use 'never' to never use in-band signalling, even in cases
; where some buggy devices might not render it
More information about the asterisk-commits
mailing list