git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4880 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-04-07 03:04:46 +00:00
parent 303c38cd7f
commit 951e771524
4 changed files with 16 additions and 3 deletions

View File

@ -16,6 +16,8 @@
<!--<param name="proxy" value="asterlink.com"/>-->
<!--/// expire in seconds: *optional* 3600, if blank ///-->
<!--<param name="expire-seconds" value="60"/>-->
<!--/// do not register ///-->
<!--<param name="register" value="false"/>-->
<!--</gateway>-->
</gateways>
<settings>

View File

@ -27,6 +27,7 @@
* Ken Rice, Asteria Solutions Group, Inc <ken@asteriasgi.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Marcel Barbulescu <marcelbarbulescu@gmail.com>
*
*
* mod_sofia.h -- SOFIA SIP Endpoint
@ -159,7 +160,8 @@ typedef enum {
REG_STATE_REGISTER,
REG_STATE_REGED,
REG_STATE_FAILED,
REG_STATE_EXPIRED
REG_STATE_EXPIRED,
REG_STATE_NOREG
} reg_state_t;
struct outbound_reg {

View File

@ -27,6 +27,7 @@
* Ken Rice, Asteria Solutions Group, Inc <ken@asteriasgi.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Marcel Barbulescu <marcelbarbulescu@gmail.com>
*
*
* sofia.c -- SOFIA SIP Endpoint (sofia code)
@ -668,7 +669,7 @@ switch_status_t config_sofia(int reload)
}
if ((gateway = switch_core_alloc(profile->pool, sizeof(*gateway)))) {
char *scheme = "Digest",
char *register_str = "true", *scheme = "Digest",
*realm = NULL,
*username = NULL, *password = NULL, *extension = NULL, *proxy = NULL, *context = "default", *expire_seconds = "3600";
@ -682,7 +683,9 @@ switch_status_t config_sofia(int reload)
char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcmp(var, "scheme")) {
if (!strcmp(var, "register")) {
register_str = val;
} else if (!strcmp(var, "scheme")) {
scheme = val;
} else if (!strcmp(var, "realm")) {
realm = val;
@ -725,6 +728,9 @@ switch_status_t config_sofia(int reload)
proxy = realm;
}
if (!switch_true(register_str)) {
gateway->state = REG_STATE_NOREG;
}
gateway->register_scheme = switch_core_strdup(gateway->pool, scheme);
gateway->register_context = switch_core_strdup(gateway->pool, context);
gateway->register_realm = switch_core_strdup(gateway->pool, realm);

View File

@ -27,6 +27,7 @@
* Ken Rice, Asteria Solutions Group, Inc <ken@asteriasgi.com>
* Paul D. Tinsley <pdt at jackhammer.org>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Marcel Barbulescu <marcelbarbulescu@gmail.com>
*
*
* sofia_ref.c -- SOFIA SIP Endpoint (registration code)
@ -56,6 +57,8 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
reg_state_t ostate = gateway_ptr->state;
switch (ostate) {
case REG_STATE_NOREG:
break;
case REG_STATE_REGISTER:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "registered %s\n", gateway_ptr->name);
gateway_ptr->expires = now + gateway_ptr->freq;