[Freeswitch-svn] [commit] r2421 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Mon Aug 28 21:27:23 EDT 2006
Author: anthm
Date: Mon Aug 28 21:27:23 2006
New Revision: 2421
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
update
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Mon Aug 28 21:27:23 2006
@@ -110,6 +110,7 @@
char *extsipip;
char *username;
char *url;
+ char *sipdomain;
int sip_port;
char *codec_string;
char *codec_order[SWITCH_MAX_CODECS];
@@ -1250,11 +1251,9 @@
sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
sdp_session_t *sdp;
uint8_t match = 0;
-
- tech_pvt->contact = sip_contact_create(tech_pvt->home, URL_STRING_MAKE("sip:1000 at 208.64.200.40"), NULL);
-
+
if (tech_pvt->num_codecs) {
if ((sdp = sdp_session(parser))) {
match = negotiate_sdp(session, sdp);
@@ -1367,6 +1366,7 @@
snprintf(username, sizeof(username), "%s@%s", (char *) from->a_url->url_user, (char *) from->a_url->url_host);
attach_private(session, profile, tech_pvt, username);
+ tech_pvt->contact = sip_contact_create(tech_pvt->home, URL_STRING_MAKE(username), NULL);
channel = switch_core_session_get_channel(session);
switch_channel_set_variable(channel, "endpoint_disposition", "INBOUND CALL");
@@ -1538,10 +1538,11 @@
TAG_END()); /* Last tag should always finish the sequence */
nua_set_params(profile->nua,
- NUTAG_EARLY_MEDIA(1),
- SIPTAG_SUPPORTED_STR("100rel, precondition"),
+ NUTAG_EARLY_MEDIA(1),
NUTAG_AUTOANSWER(0),
- NUTAG_AUTOALERT(0));
+ NUTAG_AUTOALERT(0),
+ SIPTAG_SUPPORTED_STR("100rel, precondition")
+ );
for (node = profile->aliases; node; node = node->next) {
@@ -1549,16 +1550,12 @@
event_callback, /* Callback for processing events */
profile, /* Additional data to pass to callback */
NUTAG_URL(node->url),
- NUTAG_EARLY_MEDIA(1),
- SIPTAG_SUPPORTED_STR("100rel, precondition"),
- NUTAG_AUTOANSWER(0),
- NUTAG_AUTOALERT(0),
TAG_END()); /* Last tag should always finish the sequence */
nua_set_params(node->nua,
NUTAG_EARLY_MEDIA(1),
- SIPTAG_SUPPORTED_STR("100rel, precondition"),
NUTAG_AUTOANSWER(0),
+ SIPTAG_SUPPORTED_STR("100rel, precondition"),
NUTAG_AUTOALERT(0));
}
@@ -1655,6 +1652,8 @@
profile->rtpip = switch_core_strdup(profile->pool, val);
} else if (!strcmp(var, "sip-ip")) {
profile->sipip = switch_core_strdup(profile->pool, val);
+ } else if (!strcmp(var, "sip-domain")) {
+ profile->sipdomain = switch_core_strdup(profile->pool, val);
} else if (!strcmp(var, "ext-sip-ip")) {
profile->extsipip = switch_core_strdup(profile->pool, val);
} else if (!strcmp(var, "username")) {
@@ -1709,6 +1708,9 @@
profile->dialplan = switch_core_strdup(profile->pool, "default");
}
+ if (!profile->sipdomain) {
+ profile->sipdomain = switch_core_strdup(profile->pool, profile->sipip);
+ }
snprintf(url, sizeof(url), "sip:%s:%d", profile->sipip, profile->sip_port);
profile->url = switch_core_strdup(profile->pool, url);
More information about the Freeswitch-svn
mailing list