The linewrapping by gmail of the patch file makes it difficult to read.
So, I added it as an attachment for any interested readers.
--
-Bob
--- asterisk-1.8.0-beta2.orig/channels/chan_sip.c 2010-07-26 15:59:03.000000000 -0400
+++ asterisk-1.8.0-beta2/channels/chan_sip.c 2010-11-05 12:18:53.000000000 -0400
@@ -722,6 +755,7 @@ static unsigned int global_cos_video;
static unsigned int global_cos_text; /*!< 802.1p class of service for text RTP packets */
static unsigned int recordhistory; /*!< Record SIP history. Off by default */
static unsigned int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
+static char global_contactoption[AST_MAX_EXTENSION]; /*!< string to append to Contact: for the SIP channel */
static char global_useragent[AST_MAX_EXTENSION]; /*!< Useragent for the SIP channel */
static char global_sdpsession[AST_MAX_EXTENSION]; /*!< SDP session name for the SIP channel */
static char global_sdpowner[AST_MAX_EXTENSION]; /*!< SDP owner name for the SIP channel */
@@ -10936,12 +12018,14 @@ static void extract_uri(struct sip_pvt *
static void build_contact(struct sip_pvt *p)
{
if (p->socket.type == SIP_TRANSPORT_UDP) {
- ast_string_field_build(p, our_contact, "<sip:%s%s%s>", p->exten,
- ast_strlen_zero(p->exten) ? "" : "@", ast_sockaddr_stringify(&p->ourip));
+ ast_string_field_build(p, our_contact, "<sip:%s%s%s%s%s>", p->exten,
+ ast_strlen_zero(p->exten) ? "" : "@", ast_sockaddr_stringify(&p->ourip),
+ ast_strlen_zero(global_contactoption) ? "" : ";", global_contactoption);
} else {
- ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s>", p->exten,
+ ast_string_field_build(p, our_contact, "<sip:%s%s%s;transport=%s%s%s>", p->exten,
ast_strlen_zero(p->exten) ? "" : "@", ast_sockaddr_stringify(&p->ourip),
- get_transport(p->socket.type));
+ get_transport(p->socket.type),
+ ast_strlen_zero(global_contactoption) ? "" : ";", global_contactoption);
}
}
@@ -26403,6 +28341,8 @@ static int reload_config(enum channelrel
global_relaxdtmf = ast_true(v->value);
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "contactoption")) {
+ ast_copy_string(global_contactoption, v->value, sizeof(global_contactoption));
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%30d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users