deal with sips legacy bs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8862 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
978486d139
commit
b84b74e9d3
|
@ -224,8 +224,8 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
|
|||
int sip_cause = hangup_cause_to_sip(cause);
|
||||
const char *ps_cause = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE);
|
||||
|
||||
if (!switch_strlen_zero(ps_cause) && !strncasecmp(ps_cause, "sip:", 4)) {
|
||||
int new_cause = atoi(ps_cause + 4);
|
||||
if (!switch_strlen_zero(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
|
||||
int new_cause = atoi(sofia_glue_strip_proto(ps_cause));
|
||||
if (new_cause) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Overriding SIP cause %d with %d from the other leg\n",
|
||||
switch_channel_get_name(channel), sip_cause, new_cause);
|
||||
|
@ -1454,7 +1454,7 @@ static int contact_callback(void *pArg, int argc, char **argv, char **columnName
|
|||
char *contact;
|
||||
|
||||
if (!switch_strlen_zero(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
|
||||
cb->stream->write_function(cb->stream, "%ssofia/%s/%s,", argv[1], cb->profile->name, contact + 4);
|
||||
cb->stream->write_function(cb->stream, "%ssofia/%s/%s,", argv[1], cb->profile->name, sofia_glue_strip_proto(contact));
|
||||
free(contact);
|
||||
}
|
||||
|
||||
|
@ -1773,7 +1773,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
|||
}
|
||||
|
||||
if (!strchr(dest, '@')) {
|
||||
tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s@%s", dest, gateway_ptr->register_proxy + 4);
|
||||
tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s@%s", dest, sofia_glue_strip_proto(gateway_ptr->register_proxy));
|
||||
} else {
|
||||
tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s", dest);
|
||||
}
|
||||
|
|
|
@ -645,4 +645,5 @@ void sofia_presence_event_thread_start(void);
|
|||
void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id);
|
||||
switch_status_t sofia_glue_tech_choose_video_port(private_object_t *tech_pvt, int force);
|
||||
switch_status_t sofia_glue_tech_set_video_codec(private_object_t *tech_pvt, int force);
|
||||
const char *sofia_glue_strip_proto(const char *uri);
|
||||
|
||||
|
|
|
@ -2880,6 +2880,18 @@ int sofia_glue_get_user_host(char *in, char **user, char **host)
|
|||
return 1;
|
||||
}
|
||||
|
||||
const char *sofia_glue_strip_proto(const char *uri)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if ((p = strchr(uri, ':'))) {
|
||||
return p+1;
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
|
Loading…
Reference in New Issue