add mod_snom

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9145 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-07-23 18:19:56 +00:00
parent 9837444ee0
commit da2e0d710f
11 changed files with 262 additions and 2 deletions
+7 -1
View File
@@ -2120,11 +2120,17 @@ static void general_event_handler(switch_event_t *event)
sofia_profile_t *profile;
nua_handle_t *nh;
if (profile_name && ct && body && user && host && (profile = sofia_glue_find_profile(profile_name))) {
if (profile_name && ct && body && user && host) {
char *id = NULL;
char *contact, *p;
char buf[512] = "";
if (!(profile = sofia_glue_find_profile(profile_name))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile %s\n", profile_name);
return;
}
if (!sofia_reg_find_reg_url(profile, user, host, buf, sizeof(buf))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find user %s@%s\n", user, host);
return;
+1
View File
@@ -551,6 +551,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
NUTAG_APPL_METHOD("INFO"),
NUTAG_AUTOANSWER(0),
NUTAG_AUTOALERT(0),
NUTAG_ENABLEMESSENGER(1),
TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")),
TAG_IF((profile->mflags & MFLAG_REFER), NUTAG_ALLOW("REFER")),
NUTAG_ALLOW("INFO"),
+6 -1
View File
@@ -58,6 +58,11 @@ switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char
nua_handle_t *msg_nh;
char *contact;
switch_status_t status = SWITCH_STATUS_FALSE;
const char *ct = "text/html";
if (subject && strchr(subject, '/')) {
ct = subject;
}
if (!to) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing To: header.\n");
@@ -112,7 +117,7 @@ switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char
SIPTAG_CONTACT_STR(profile->url), TAG_END());
switch_safe_free(contact);
nua_message(msg_nh, SIPTAG_CONTENT_TYPE_STR("text/html"), SIPTAG_PAYLOAD_STR(body), TAG_END());
nua_message(msg_nh, SIPTAG_CONTENT_TYPE_STR(ct), SIPTAG_PAYLOAD_STR(body), TAG_END());
end: