Skinny: corrections to call info:

- channel vars are caller_ and not callee_
- inbound/outbound are reversed from the skinny POV
- use displayname
This commit is contained in:
Mathieu Parent 2010-05-11 23:28:59 +02:00
parent 19fb75740d
commit 3b0f1711ba
1 changed files with 13 additions and 13 deletions

View File

@ -270,8 +270,8 @@ switch_status_t skinny_session_send_call_info(switch_core_session_t *session, li
private_t *tech_pvt; private_t *tech_pvt;
switch_channel_t *channel; switch_channel_t *channel;
const char *calling_party_name; const char *caller_party_name;
const char *calling_party_number; const char *caller_party_number;
const char *called_party_name; const char *called_party_name;
const char *called_party_number; const char *called_party_number;
uint32_t call_type = 0; uint32_t call_type = 0;
@ -282,13 +282,13 @@ switch_status_t skinny_session_send_call_info(switch_core_session_t *session, li
switch_assert(tech_pvt->caller_profile != NULL); switch_assert(tech_pvt->caller_profile != NULL);
/* Calling party */ /* Calling party */
if (zstr((calling_party_name = switch_channel_get_variable(channel, "effective_callee_id_name"))) && if (zstr((caller_party_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) &&
zstr((calling_party_name = switch_channel_get_variable(channel, "callee_id_name")))) { zstr((caller_party_name = switch_channel_get_variable(channel, "caller_id_name")))) {
calling_party_name = SWITCH_DEFAULT_CLID_NAME; caller_party_name = SWITCH_DEFAULT_CLID_NAME;
} }
if (zstr((calling_party_number = switch_channel_get_variable(channel, "effective_callee_id_number"))) && if (zstr((caller_party_number = switch_channel_get_variable(channel, "effective_caller_id_number"))) &&
zstr((calling_party_number = switch_channel_get_variable(channel, "callee_id_number")))) { zstr((caller_party_number = switch_channel_get_variable(channel, "caller_id_number")))) {
calling_party_number = "0000000000"; caller_party_number = "0000000000";
} }
/* Called party */ /* Called party */
if (zstr((called_party_name = switch_channel_get_variable(channel, "effective_called_id_name"))) && if (zstr((called_party_name = switch_channel_get_variable(channel, "effective_called_id_name"))) &&
@ -300,13 +300,13 @@ switch_status_t skinny_session_send_call_info(switch_core_session_t *session, li
called_party_number = "0000000000"; called_party_number = "0000000000";
} }
if (switch_channel_test_flag(channel, CF_OUTBOUND)) { if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
call_type = SKINNY_OUTBOUND_CALL;
} else {
call_type = SKINNY_INBOUND_CALL; call_type = SKINNY_INBOUND_CALL;
} else {
call_type = SKINNY_OUTBOUND_CALL;
} }
skinny_send_call_info(listener, skinny_send_call_info(listener,
calling_party_name, /* char calling_party_name[40], */ caller_party_name, /* char calling_party_name[40], */
calling_party_number, /* char calling_party[24], */ caller_party_number, /* char calling_party[24], */
called_party_name, /* char called_party_name[40], */ called_party_name, /* char called_party_name[40], */
called_party_number, /* char called_party[24], */ called_party_number, /* char called_party[24], */
line_instance, /* uint32_t line_instance, */ line_instance, /* uint32_t line_instance, */
@ -511,7 +511,7 @@ switch_status_t skinny_create_ingoing_session(listener_t *listener, uint32_t *li
/* First create the caller profile in the patterns Dialplan */ /* First create the caller profile in the patterns Dialplan */
if (!(tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(nsession), if (!(tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(nsession),
NULL, listener->profile->patterns_dialplan, NULL, listener->profile->patterns_dialplan,
button->shortname, button->name, button->displayname, button->shortname,
listener->remote_ip, NULL, NULL, NULL, listener->remote_ip, NULL, NULL, NULL,
"skinny" /* modname */, "skinny" /* modname */,
listener->profile->patterns_context, listener->profile->patterns_context,