mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 14:44:17 +00:00
cleanup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4831 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
6326d5c7c2
commit
2b76e3e72f
6 files changed
+280
-10
No files matched your search
@@ -1,3 +1,37 @@
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Anthony Minessale II <anthmct@yahoo.com>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Anthony Minessale II <anthmct@yahoo.com>
|
||||
* Ken Rice, Asteria Solutions Group, Inc <ken@asteriasgi.com>
|
||||
* Paul D. Tinsley <pdt at jackhammer.org>
|
||||
* Bret McDanel <trixter AT 0xdecafbad.com>
|
||||
*
|
||||
*
|
||||
* sofia_glue.c -- SOFIA SIP Endpoint (code to tie sofia to freeswitch)
|
||||
*
|
||||
*/
|
||||
#include "mod_sofia.h"
|
||||
|
||||
|
||||
@@ -1107,4 +1141,32 @@ void sofia_glue_execute_sql(char *dbname, char *sql, switch_mutex_t * mutex)
|
||||
}
|
||||
|
||||
|
||||
int sofia_glue_get_user_host(char *in, char **user, char **host)
|
||||
{
|
||||
char *p, *h, *u = in;
|
||||
|
||||
*user = NULL;
|
||||
*host = NULL;
|
||||
|
||||
if (!strncasecmp(u, "sip:", 4)) {
|
||||
u += 4;
|
||||
}
|
||||
|
||||
if ((h = strchr(u, '@'))) {
|
||||
*h++ = '\0';
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
p = h + strlen(h) - 1;
|
||||
|
||||
if (p && (*p == ':' || *p == ';' || *p == ' ')) {
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
*user = u;
|
||||
*host = h;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user