[Freeswitch-svn] [commit] r11114 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax
FreeSWITCH SVN
gmaruzz at freeswitch.org
Sat Jan 10 10:54:35 PST 2009
Author: gmaruzz
Date: Sat Jan 10 12:54:35 2009
New Revision: 11114
Log:
skypiax: various minor adjustments
Modified:
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Sat Jan 10 12:54:35 2009
@@ -540,7 +540,7 @@
char *slash;
strncpy(interface_name, outbound_profile->destination_number, 255);
- slash=strchr(interface_name, '/');
+ slash=strrchr(interface_name, '/');
*slash='\0';
@@ -584,11 +584,12 @@
char name[128];
snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number);
+ //snprintf(name, sizeof(name), "skypiax/%s", p->name);
switch_channel_set_name(channel, name);
- //NOTICA( "outbound_profile->destination_number=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->destination_number);
- //NOTICA( "outbound_profile->username=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->username);
- //NOTICA( "outbound_profile->caller_id_name=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->caller_id_name);
- //NOTICA( "outbound_profile->caller_id_number=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->caller_id_number);
+ NOTICA( "outbound_profile->destination_number=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->destination_number);
+ NOTICA( "outbound_profile->username=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->username);
+ NOTICA( "outbound_profile->caller_id_name=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->caller_id_name);
+ NOTICA( "outbound_profile->caller_id_number=|||%s|||\n", SKYPIAX_P_LOG, outbound_profile->caller_id_number);
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
switch_channel_set_caller_profile(channel, caller_profile);
@@ -601,6 +602,7 @@
skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30, *new_session);
+
switch_channel_set_flag(channel, CF_OUTBOUND);
switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
switch_channel_set_state(channel, CS_INIT);
Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Sat Jan 10 12:54:35 2009
@@ -570,7 +570,7 @@
if (samples != SAMPLES_PER_FRAME * sizeof(short)) {
if (samples)
- ERRORA("SRV PIPE READ=====> NOT GOOD samples=%u expected=%u\n", SKYPIAX_P_LOG,
+ ERRORA("SRV PIPE READ=====> NOT GOOD samples=%u expected=%lu\n", SKYPIAX_P_LOG,
samples, SAMPLES_PER_FRAME * sizeof(short));
//do nothing
} else {
@@ -1734,9 +1734,8 @@
NULL, NULL, "mod_skypiax", "public",
"5000")) != 0) {
char name[128];
- switch_snprintf(name, sizeof(name), "skypiax/%s-%04x",
- tech_pvt->caller_profile->destination_number,
- rand() & 0xffff);
+ //switch_snprintf(name, sizeof(name), "skypiax/%s/%s", p->name, tech_pvt->caller_profile->destination_number);
+ switch_snprintf(name, sizeof(name), "skypiax/%s", p->name);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel,
tech_pvt->caller_profile);
@@ -1756,12 +1755,27 @@
private_t *tech_pvt = NULL;
switch_channel_t *channel = NULL;
+ if(p->tech_pvt){
tech_pvt = p->tech_pvt;
+ } else {
+ ERRORA("No p->tech_pvt???\n", SKYPIAX_P_LOG);
+ }
+ if(tech_pvt->session){
session = tech_pvt->session;
+ }else {
+ ERRORA("No tech_pvt->session???\n", SKYPIAX_P_LOG);
+
+ }
//session = global_session;
+ if(session){
channel = switch_core_session_get_channel(session);
//DEBUGA_SKYPE("skype_call: %s, answered\n", SKYPIAX_P_LOG, id);
switch_channel_mark_answered(channel);
+ }else {
+
+ ERRORA("No session???\n", SKYPIAX_P_LOG);
+
+ }
//switch_channel_set_state(channel, CS_EXECUTE);
@@ -1816,6 +1830,7 @@
char *rdest;
char msg_to_skype[1024];
private_t *tech_pvt;
+ switch_caller_profile_t *caller_profile;
tech_pvt = p->tech_pvt;
@@ -1845,6 +1860,9 @@
return -1;
}
tech_pvt->session = session;
+ caller_profile = tech_pvt->caller_profile;
+ caller_profile->destination_number = rdest;
+
//FIXME ast_queue_control(p->owner, SKYPIAX_CONTROL_RINGING);
return 0;
More information about the Freeswitch-svn
mailing list