Ok.. I may/may not be doing this right.
I wanted to call the "echo" application from a dsm, and now know you had to
loop it back into SEMS to get it to work... no problem...
So, I created an extra "lo" interface, and added the sip_ip, media_ip,
rtp_low_port, and rtp_high_port.
Then I set up app_mapping to redirect the call where I want it.
Dial echo app directly... works fine!
I tried dialing in through "b2b" connect app, and didn't get anything...
So I tried playing a file:
Call in directly using "65432@SEMSIP" and the audio file plays perfectly...
Call in using the testout -> b2b to localhost -> beep and it sounds like crap
(choppy audio)....
Any ideas?
sems.conf:
additional_interfaces=lo
sip_ip_lo=127.0.0.1
media_ip_lo=127.0.0.1
rtp_low_port_lo=10000
rtp_high_port_lo=65535
sip_port=5060
100rel=disabled
loglevel=3
syslog_facility=LOCAL0
logevents=yes
load_plugins=wav;uac_auth;session_timer;dsm;echo
application=$(mapping)
dsm.conf
run_invite_event=no
preload_mods=mod_py
diag_path=/usr/local/lib/sems/dsm/
mod_path=/usr/local/lib/sems/dsm/
load_diags=outbound_call,testout,beep
register_apps=outbound_call,testout,beep
app_maping.conf
^sip:54321=>echo
^sip:65432=>beep
^sip:.*=>testout
I'm also testing some functionality so here are a couple DSM's I'm using:
testout.dsm (this is the "main one")
initial state START
enter {
-- set($num=10000-16403)
set($num=65432)
-- set($domain=74.205.223.38)
set($domain=localhost)
-- set($domain=192.168.1.129)
};
state END enter {log(1,ENTER END FROM TESTOUT)};
transition "DOIT" START - / {callFSM(outbound_call);} -> END;
That calls "outbound_call.dsm":
initial state START;
transition "starting" START - sessionStart / {
set($remote=sip:);
append($remote, $num);
append($remote, @);
append($remote, $domain);
log(1,$remote);
-- connect in B2BUA mode
-- B2B.clearHeaders();
-- B2B.addHeader("P-Call-Source: MEDIA\r\n");
B2B.connectCallee($remote, $remote)
} -> CONNECTING;
state CONNECTING;
-- received BYE from caller
transition "bye while connecting" CONNECTING - hangup / {
log(1, bye while connecting);
B2B.terminateOtherLeg();
stop(false);
} -> END;
-- provisional reply in callee leg
transition "provisional reply" CONNECTING - B2B.otherReply(#code < 200) / {
log(1, received provisional reply)
log(1, #code)
log(1, #reason)
} -> CONNECTING;
-- positive reply in callee leg
transition "positive reply" CONNECTING - B2B.otherReply(#code < 300) / {
log(1, received positive reply)
log(1, #code)
log(1, #reason)
} -> CONNECTED;
-- negative reply in callee leg, try again
transition "negative reply" CONNECTING - B2B.otherReply() / {
log(1, received negative reply)
log(1, #code)
log(1, #reason)
} -> END;
state CONNECTED;
transition "bye recvd" CONNECTED - hangup / B2B.terminateOtherLeg();
stop(false) -> END;
transition "bye on other leg" CONNECTED - B2B.otherBye() / stop(true) -> END;
state END enter {returnFSM()};
Which then calls my "beep.dsm" from app_module:
initial state START
enter {
playFile(/var/spool/sounds/you-have-reached-a-test-number.wav);
};
state END;
transition "doit" START - noAudio() / {stop(true);}-> END;
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems