body
This commit is contained in:
parent
47267a1af6
commit
1b16ad9959
@ -36,7 +36,8 @@
|
||||
* $INBOUND
|
||||
* $CONNECT,
|
||||
* $CALLERID,
|
||||
* $RC
|
||||
* $RC,
|
||||
* $PEERNAME
|
||||
*/
|
||||
int session_run_command(const char *execstr)
|
||||
{
|
||||
@ -112,6 +113,10 @@ int session_run_command(const char *execstr)
|
||||
if( state.cidstr && *state.cidstr )
|
||||
exec_env_add(&eopts, "CALLERID", state.cidstr);
|
||||
|
||||
if( state.peername && *state.peername )
|
||||
exec_env_add(&eopts, "PEERNAME", state.peername);
|
||||
|
||||
|
||||
if( state.session_rc >= 0 )
|
||||
{
|
||||
sprintf(sbuf, "%d", state.session_rc);
|
||||
|
@ -311,14 +311,36 @@ int session_set_inbound(void)
|
||||
struct stat st;
|
||||
char *p_inb;
|
||||
|
||||
if( (p_inb = conf_string(cf_inbound_directory)) )
|
||||
{
|
||||
state.inbound = (char*)xstrcpy(p_inb);
|
||||
p_inb = conf_string(cf_inbound_directory);
|
||||
if( !p_inb ) {
|
||||
log("no inbound specified, assume current directory");
|
||||
p_inb = "./";
|
||||
}
|
||||
else
|
||||
{
|
||||
log("no inbound specified, assume \"./\"");
|
||||
state.inbound = (char*)xstrcpy("./");
|
||||
|
||||
if( conf_boolean(cf_split_inbound) ) {
|
||||
char buf[500];
|
||||
if( state.node.addr.point ) {
|
||||
sprintf( buf, "%s%d:%d/%d.%d/%s-in/",
|
||||
p_inb,
|
||||
state.node.addr.zone,
|
||||
state.node.addr.net,
|
||||
state.node.addr.node,
|
||||
state.node.addr.point,
|
||||
state.protected? "pwd": "unchecked" );
|
||||
} else {
|
||||
sprintf( buf, "%s%d:%d/%d/%s-in/",
|
||||
p_inb,
|
||||
state.node.addr.zone,
|
||||
state.node.addr.net,
|
||||
state.node.addr.node,
|
||||
state.protected? "pwd": "unchecked" );
|
||||
}
|
||||
log("inbound: %s", buf);
|
||||
state.inbound = (char*)xstrcpy(buf);
|
||||
sprintf( buf, "/bin/mkdir -p %s -m 700", state.inbound );
|
||||
system( buf );
|
||||
} else {
|
||||
state.inbound = (char*)xstrcpy(p_inb);
|
||||
}
|
||||
|
||||
state.tinbound = (char*)xstrcpy(state.inbound);
|
||||
|
Loading…
x
Reference in New Issue
Block a user