Don't remove file path when starting a file transfer path.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5432 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
3cddebbc9e
commit
4249bd40d0
|
@ -560,7 +560,8 @@ static bool s_offerP2PTransport = false; // Offer P2P UDP transport on
|
|||
static bool s_offerGRawTransport = false; // Offer Google RAW UDP transport on outgoing sessions
|
||||
static int s_priority = 0; // Resource priority for presence generated by this module
|
||||
static unsigned int s_redirectCount = 0; // Redirect counter
|
||||
static int s_dtmfMeth; // Default DTMF method to use
|
||||
static int s_dtmfMeth = YJGDriver::DtmfJingle; // Default DTMF method to use
|
||||
static bool s_clearFilePath = false; // Clear file path when sending a file transfer
|
||||
static JGSession::Version s_sessVersion = JGSession::VersionUnknown; // Default jingle session version for outgoing calls
|
||||
static int s_ringFlags = 0; // Default channel ring flags
|
||||
static String s_capsNode = "http://yate.null.ro/yate/jingle/caps"; // node for entity capabilities
|
||||
|
@ -3859,6 +3860,7 @@ void YJGDriver::initialize()
|
|||
int redir = sect->getIntValue("redirectcount");
|
||||
s_redirectCount = (redir >= 0) ? redir : 0;
|
||||
s_dtmfMeth = sect->getIntValue("dtmfmethod",s_dictDtmfMeth,DtmfJingle);
|
||||
s_clearFilePath = sect->getBoolValue("clear_file_path");
|
||||
// set max chans
|
||||
maxChans(sect->getIntValue("maxchans",maxChans()));
|
||||
|
||||
|
@ -4060,11 +4062,13 @@ bool YJGDriver::msgExecute(Message& msg, String& dest)
|
|||
if (format && *format == "data") {
|
||||
// Check file. Remove path if present
|
||||
file = msg.getValue("file_name");
|
||||
int pos = file.rfind('/');
|
||||
if (pos == -1)
|
||||
pos = file.rfind('\\');
|
||||
if (pos != -1)
|
||||
file = file.substr(pos + 1);
|
||||
if (file && msg.getBoolValue(YSTRING("clear_file_path"),s_clearFilePath)) {
|
||||
int pos = file.rfind('/');
|
||||
if (pos == -1)
|
||||
pos = file.rfind('\\');
|
||||
if (pos != -1)
|
||||
file = file.substr(pos + 1);
|
||||
}
|
||||
if (file.null()) {
|
||||
Debug(this,DebugNote,"Jingle call failed. File transfer request with no file");
|
||||
msg.setParam("error","failure");
|
||||
|
|
Loading…
Reference in New Issue