Re: [Freeswitch-users] dp+ prefixed on From URI
-----Original Message----- From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125| Test message."
Then the From header:
From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it was intended for this "dp+" to be prefixed in the Jingle protocol under certain circumstances not SIP.... looks very suspicious... John
It's not a bug, you are being presumptuous. Every chat interface has a proto prefix that helps FS to route the messages to the right module. you sent it from mod_commands which chose the dp realm to advertise dp+ if you came in from SIP it is sip+ and conference are conf+ etc..... On Wed, Jan 19, 2011 at 1:43 PM, John Rose <johnrose@comtex.net> wrote:
-----Original Message----- From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125| Test message."
Then the From header:
From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it was intended for this "dp+" to be prefixed in the Jingle protocol under certain circumstances not SIP.... looks very suspicious...
John
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Well from switch_core_chat_send it's hardcoded "dp" as the protocol when argv[0] is the actual protocol being passed from the chat API argument. //-------------------------------------------------------------------------- ----------------- SWITCH_STANDARD_API(chat_api_function) { char *lbuf = NULL, *argv[5]; int argc = 0; if (!zstr(cmd) && (lbuf = strdup(cmd)) && (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) { if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "") == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "Sent"); } else { stream->write_function(stream, "Error! Message Not Sent"); } } else { stream->write_function(stream, "Invalid"); } switch_safe_free(lbuf); return SWITCH_STATUS_SUCCESS; } //-------------------------------------------------------------------------- ----------------- Then here in sophia_prescence.c it prepends "dp+" to the sip From URI. The "dp+" can cause issues downstream when the sip MESSAGE is gets routed outbound from the FS box... should be an option to turn it off. From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n John //-------------------------------------------------------------------------- ----------------- if (!strcasecmp(proto, SOFIA_CHAT_PROTO)) { from = hint; } else { char *fp, *p = NULL; fp = strdup(from); if (!fp) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); goto end; } if ((p = strchr(fp, '@'))) { *p++ = '\0'; } if (zstr(p)) { p = profile->domain_name; if (zstr(p)) { p = host; } } ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fp, proto, fp, p); from = ffrom; switch_safe_free(fp); } //-------------------------------------------------------------------------- -----------------
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-
It's not a bug, you are being presumptuous.
Every chat interface has a proto prefix that helps FS to route the messages to
the right module.
you sent it from mod_commands which chose the dp realm to advertise dp+
if you came in from SIP it is sip+ and conference are conf+ etc.....
On Wed, Jan 19, 2011 at 1:43 PM, John Rose < <mailto:johnrose@comtex.net> johnrose@comtex.net> wrote:
-----Original Message-----
From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I
call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125
|
Test message."
Then the From header:
From: \"+15186819448\"
<sip:dp++15186819448@65.41.13.124>;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it
was intended for this "dp+" to be prefixed in the Jingle protocol
under certain circumstances not SIP.... looks very suspicious...
John
John, you should read what he wrote one more time. The code shows precisely what he said. I am going to quote here: "you sent it from mod_commands which chose the dp realm to advertise dp+" If you _received_ a message from SIP, you would've seen the sip+ prefix and if you sent from the conference module, you would've seen the conf+ prefix on the event. Makes more sense now? Regards, João Mesquita On Thu, Jan 20, 2011 at 12:10 AM, John Rose <johnrose@comtex.net> wrote:
Well from *switch_core_chat_send* it's hardcoded "dp" as the protocol when *argv[0]* is the actual protocol being passed from the *chat* API argument.
//-------------------------------------------------------------------------------------------
SWITCH_STANDARD_API(chat_api_function)
{
char *lbuf = NULL, *argv[5];
int argc = 0;
if (!zstr(cmd) && (lbuf = strdup(cmd))
&& (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "") == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "Sent");
} else {
stream->write_function(stream, "Error! Message Not Sent" );
}
} else {
stream->write_function(stream, "Invalid");
}
switch_safe_free(lbuf);
return SWITCH_STATUS_SUCCESS;
}
//-------------------------------------------------------------------------------------------
Then here in sophia_prescence.c it prepends “dp+” to the sip *From* URI. The “dp+” can cause issues downstream when the sip *MESSAGE* is gets routed outbound from the FS box... should be an option to turn it off…
From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124<sip%3Adp%2B%2B15186819448@65.41.13.124>
;tag=FUetK564c4egm\\r\\n
John
//-------------------------------------------------------------------------------------------
if (!strcasecmp(proto, SOFIA_CHAT_PROTO)) {
from = hint;
} else {
char *fp, *p = NULL;
fp = strdup(from);
if (!fp) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
goto end;
}
if ((p = strchr(fp, '@'))) {
*p++ = '\0';
}
if (zstr(p)) {
p = profile->domain_name;
if (zstr(p)) {
p = host;
}
}
ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fp, proto, fp, p);
from = ffrom;
switch_safe_free(fp);
}
//-------------------------------------------------------------------------------------------
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-
It's not a bug, you are being presumptuous.
Every chat interface has a proto prefix that helps FS to route the messages to
the right module.
you sent it from mod_commands which chose the dp realm to advertise dp+
if you came in from SIP it is sip+ and conference are conf+ etc.....
On Wed, Jan 19, 2011 at 1:43 PM, John Rose <johnrose@comtex.net> wrote:
-----Original Message-----
From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I
call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125<sip%3A%2B12062990047@65.41.13.125>
|
Test message."
Then the From header:
From: \"+15186819448\"
<sip:dp++15186819448@65.41.13.124<sip%3Adp%2B%2B15186819448@65.41.13.124> ;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it
was intended for this "dp+" to be prefixed in the Jingle protocol
under certain circumstances not SIP.... looks very suspicious...
John
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yes but there should be an option to turn it off. When a UA receives the MESSAGE Request the dp+ gets displayed on some clients which is confusing and the reply needs to route back potentially though many sip hops with lookups etc.. Having a dp+ prepended on the From URI may not be the best sip based solution for that, maybe adding a custom header perhaps? John From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of João Mesquita Sent: Wednesday, January 19, 2011 8:15 PM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] dp+ prefixed on From URI John, you should read what he wrote one more time. The code shows precisely what he said. I am going to quote here: "you sent it from mod_commands which chose the dp realm to advertise dp+" If you _received_ a message from SIP, you would've seen the sip+ prefix and if you sent from the conference module, you would've seen the conf+ prefix on the event. Makes more sense now? Regards, João Mesquita On Thu, Jan 20, 2011 at 12:10 AM, John Rose <johnrose@comtex.net> wrote: Well from switch_core_chat_send it's hardcoded "dp" as the protocol when argv[0] is the actual protocol being passed from the chat API argument. //-------------------------------------------------------------------------- ----------------- SWITCH_STANDARD_API(chat_api_function) { char *lbuf = NULL, *argv[5]; int argc = 0; if (!zstr(cmd) && (lbuf = strdup(cmd)) && (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) { if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "") == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "Sent"); } else { stream->write_function(stream, "Error! Message Not Sent"); } } else { stream->write_function(stream, "Invalid"); } switch_safe_free(lbuf); return SWITCH_STATUS_SUCCESS; } //-------------------------------------------------------------------------- ----------------- Then here in sophia_prescence.c it prepends dp+ to the sip From URI. The dp+ can cause issues downstream when the sip MESSAGE is gets routed outbound from the FS box... should be an option to turn it off From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124 <mailto:sip%3Adp%2B%2B15186819448@65.41.13.124> >;tag=FUetK564c4egm\\r\\n John //-------------------------------------------------------------------------- ----------------- if (!strcasecmp(proto, SOFIA_CHAT_PROTO)) { from = hint; } else { char *fp, *p = NULL; fp = strdup(from); if (!fp) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n"); goto end; } if ((p = strchr(fp, '@'))) { *p++ = '\0'; } if (zstr(p)) { p = profile->domain_name; if (zstr(p)) { p = host; } } ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s <sip:%25s+%25s@%25s> >", fp, proto, fp, p); from = ffrom; switch_safe_free(fp); } //-------------------------------------------------------------------------- -----------------
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-
It's not a bug, you are being presumptuous.
Every chat interface has a proto prefix that helps FS to route the messages to
the right module.
you sent it from mod_commands which chose the dp realm to advertise dp+
if you came in from SIP it is sip+ and conference are conf+ etc.....
On Wed, Jan 19, 2011 at 1:43 PM, John Rose < <mailto:johnrose@comtex.net> johnrose@comtex.net> wrote:
-----Original Message-----
From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I
call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125 <mailto:sip%3A%2B12062990047@65.41.13.125>
|
Test message."
Then the From header:
From: \"+15186819448\"
<sip:dp++15186819448@65.41.13.124 <mailto:sip%3Adp%2B%2B15186819448@65.41.13.124> >;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it
was intended for this "dp+" to be prefixed in the Jingle protocol
under certain circumstances not SIP.... looks very suspicious...
John
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Someone else will have to kick in now, I haven't played with SIMPLE or the chat api yet. Regards, João Mesquita On Thu, Jan 20, 2011 at 12:31 AM, John Rose <johnrose@comtex.net> wrote:
Yes but there should be an option to turn it off. When a UA receives the MESSAGE Request the “dp+” gets displayed on some clients which is confusing and the reply needs to route back potentially though many sip hops with lookups etc.. Having a “dp+” prepended on the From URI may not be the best sip based solution for that, maybe adding a custom header perhaps?
John
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *João Mesquita *Sent:* Wednesday, January 19, 2011 8:15 PM *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] dp+ prefixed on From URI
John, you should read what he wrote one more time. The code shows precisely what he said. I am going to quote here:
"you sent it from mod_commands which chose the dp realm to advertise dp+"
If you _received_ a message from SIP, you would've seen the sip+ prefix and if you sent from the conference module, you would've seen the conf+ prefix on the event. Makes more sense now?
Regards,
João Mesquita
On Thu, Jan 20, 2011 at 12:10 AM, John Rose <johnrose@comtex.net> wrote:
Well from *switch_core_chat_send* it's hardcoded "dp" as the protocol when *argv[0]* is the actual protocol being passed from the *chat* API argument.
//-------------------------------------------------------------------------------------------
SWITCH_STANDARD_API(chat_api_function)
{
char *lbuf = NULL, *argv[5];
int argc = 0;
if (!zstr(cmd) && (lbuf = strdup(cmd))
&& (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3], !zstr(argv[4]) ? argv[4] : NULL, "") == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "Sent");
} else {
stream->write_function(stream, "Error! Message Not Sent" );
}
} else {
stream->write_function(stream, "Invalid");
}
switch_safe_free(lbuf);
return SWITCH_STATUS_SUCCESS;
}
//-------------------------------------------------------------------------------------------
Then here in sophia_prescence.c it prepends “dp+” to the sip *From* URI. The “dp+” can cause issues downstream when the sip *MESSAGE* is gets routed outbound from the FS box... should be an option to turn it off…
From: \"+15186819448\" <sip:dp++15186819448@65.41.13.124<sip%3Adp%2B%2B15186819448@65.41.13.124>
;tag=FUetK564c4egm\\r\\n
John
//-------------------------------------------------------------------------------------------
if (!strcasecmp(proto, SOFIA_CHAT_PROTO)) {
from = hint;
} else {
char *fp, *p = NULL;
fp = strdup(from);
if (!fp) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
goto end;
}
if ((p = strchr(fp, '@'))) {
*p++ = '\0';
}
if (zstr(p)) {
p = profile->domain_name;
if (zstr(p)) {
p = host;
}
}
ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fp, proto, fp, p);
from = ffrom;
switch_safe_free(fp);
}
//-------------------------------------------------------------------------------------------
-----Original Message-----
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-
It's not a bug, you are being presumptuous.
Every chat interface has a proto prefix that helps FS to route the messages to
the right module.
you sent it from mod_commands which chose the dp realm to advertise dp+
if you came in from SIP it is sip+ and conference are conf+ etc.....
On Wed, Jan 19, 2011 at 1:43 PM, John Rose <johnrose@comtex.net> wrote:
-----Original Message-----
From: John Rose [mailto:johnrose@comtex.net]
Why does the chat API command prefix a "dp+" onto the From URI when I
call the chat API? Here is an argument that I am using:
"sip|+15186819448@65.41.13.124|external/sip:+12062990047@65.41.13.125<sip%3A%2B12062990047@65.41.13.125>
|
Test message."
Then the From header:
From: \"+15186819448\"
<sip:dp++15186819448@65.41.13.124<sip%3Adp%2B%2B15186819448@65.41.13.124> ;tag=FUetK564c4egm\\r\\n
Argh, after looking through the code I think this is a FS bug where it
was intended for this "dp+" to be prefixed in the Jingle protocol
under certain circumstances not SIP.... looks very suspicious...
John
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Anthony Minessale
-
John Rose
-
João Mesquita