Author: rco
Date: 2010-05-26 11:16:58 +0200 (Wed, 26 May 2010)
New Revision: 1931
Modified:
trunk/doc/Howtostart_voicemail.txt
trunk/doc/Readme.announce_transfer.txt
trunk/doc/Readme.conference.txt
trunk/doc/Readme.early_announce.txt
trunk/doc/Readme.mailbox.txt
trunk/doc/Readme.sw_prepaid_sip.txt
Log:
- updated doc to only use t_relay_to(), instead of t_write_unix() in SER config
examples.
Modified: trunk/doc/Howtostart_voicemail.txt
===================================================================
--- trunk/doc/Howtostart_voicemail.txt 2010-05-25 14:42:10 UTC (rev 1930)
+++ trunk/doc/Howtostart_voicemail.txt 2010-05-26 09:16:58 UTC (rev 1931)
@@ -145,9 +145,8 @@
This should be added to native SIP destinations which are not found in
usrloc, i.e. instead of replying 480 User temporarily not available,
and in FAILURE_ROUTE:
- append_hf("P-App-Name: voicemail\r\n");
- append_hf("P-App-Param:
mod=%$t.voicemail%|;eml='%$t.email%|';us...@ruri.
-user%|;snd='%[email protected]%|';[email protected]%|;uid=%$t.uid%|;did=%$t.did%|;");
+ append_hf_value("P-App-Name","voicemail");
+
append_hf_value("P-App-Param","mod=%$t.voicemail%|;eml='%$t.email%|';[email protected]%|;snd='%[email protected]%|';[email protected]%|;uid=%$t.uid%|;did=%$t.did%|;");
rewritehostport("voicemail.domain.net:5080");
route(FORWARD);
@@ -155,9 +154,8 @@
This should be added to SITE-SPECIFIC route:
if (uri=~"^sip:1000") { # 1000 is voicebox access number
- append_hf("P-App-Name: voicebox\r\n");
- append_hf("P-App-Param:
[email protected]%|;[email protected]%|;lng
-=%$f.lang%|;uid=%$f.uid%|;did=%$f.did%|;\r\n");
+ append_hf_value("P-App-Name","voicebox");
+
append_hf_value("P-App-Param","[email protected]%|;[email protected]%|;lng=%$f.lang%|;uid=%$f.uid%|;did=%$f.did%|;");
rewritehostport("voicemail.domain.net:5080");
route(FORWARD);
}
@@ -167,9 +165,8 @@
This is very similar to the one above, and should be added to
SITE_SPECIFIC as well:
if (uri=~"^sip:1001") { # 1001 is recod greeting number
- append_hf("P-App-Name: annrecorder\r\n");
- append_hf("P-App-Param:
[email protected]%|;[email protected]%|;lng
-=%$f.lang%|;uid=%$f.uid%|;did=%$f.did%|;typ=vm;\r\n");
+ append_hf_value("P-App-Name","annrecorder");
+
append_hf_value("P-App-Param","[email protected]%|;[email protected]%|;lng=%$f.lang%|;uid=%$f.uid%|;did=%$f.did%|;typ=vm;");
rewritehostport("voicemail.domain.net:5080");
route(FORWARD);
}
Modified: trunk/doc/Readme.announce_transfer.txt
===================================================================
--- trunk/doc/Readme.announce_transfer.txt 2010-05-25 14:42:10 UTC (rev
1930)
+++ trunk/doc/Readme.announce_transfer.txt 2010-05-26 09:16:58 UTC (rev
1931)
@@ -1,53 +1,16 @@
Announcement then call transfer
-This application plays an announcement and then REFERs the caller
-to either the uri configured in the Refer-To session parameter,
-or, if his is not set, the request URI of the first INVITE.
+This application plays an announcement and then sends a REFER to
+the caller. The Refer-To header field is set to either the uri
+configured in the Refer-To session parameter, or, if it is not set,
+to the request URI of the first INVITE.
-If refer is not accepted, succeeds, or fails, a BYE is sent.
+Once the REFER request has been replied, a BYE is sent to the caller.
-Example ser configuration appends:
+Example ser configuration file for passing parameters to announce_transfer:
-#appends: parameter for announce_transfer
-modparam( "tm", "tw_append",
- "announce_transfer_headers:P-App-Param=avp[$refer_to]")
+ append_hf("P-App-Name: announce_transfer\r\n");
+ append_hf("P-App-Param: Refer-To=sip:[email protected]\r\n");
+ # assume that SEMS is running on localhost at port 5080 (default)
+ t_relay_to("udp:localhost:5080");
-# appends for REFER NOTIFYs
-modparam( "tm", "tw_append",
- "notify_headers:hdr[Content-Length];hdr[Content-Type];hdr[Event];msg[body]")
-
-Example of invoking announce_transfer within route:
-
- if (method != "ACK" && method != "INVITE"
- && method != "CANCEL" && method != "INFO"
- && method != "NOTIFY" && method != "BYE" ){
- log("unsupported method\n");
- sl_send_reply("500","unsupported method");
- break;
- }
-
- if (method == "NOTIFY") {
- if
(!t_write_unix("/tmp/sems_sock","announce_transfer/notify_headers")){
- log("could not contact announce_transfer\n");
- t_reply("500","could not contact media server");
- break;
- }
- break;
- }
-
- if (method == "INVITE") {
- avp_write("Refer-To=sip:[email protected]","$refer_to");
- if
(!t_write_unix("/tmp/sems_sock","announce_transfer/announce_transfer_headers")){
- log("could not contact announce_transfer\n");
- t_reply("500","could not contact media server");
- break;
- }
- break;
- }
-
- if (!t_write_unix("/tmp/sems_sock","announce_transfer")){
- log("could not contact announce_transfer\n");
- t_reply("500","could not contact media server");
- break;
- }
-
Modified: trunk/doc/Readme.conference.txt
===================================================================
--- trunk/doc/Readme.conference.txt 2010-05-25 14:42:10 UTC (rev 1930)
+++ trunk/doc/Readme.conference.txt 2010-05-26 09:16:58 UTC (rev 1931)
@@ -131,17 +131,8 @@
P-Transfer-RR : route set of the call
P-Transfer-NH : next hop
- These headers must be configured in ser.cfg to be passed to the conference
- application, for example using the following tw_append:
-
- # appends for REFER
- modparam( "tm", "tw_append",
- "refer_append:hdr[P-Transfer-NH];hdr[P-Transfer-RR]")
-
- ...
-
- t_write_unix("/tmp/msp_conference_sock","conference/refer_append");
-
Note that while this request has the method 'REFER', it does not follow
rfc3515,
- for example the Refer-To header is not used.
+ for example the Refer-To header is not used. Also, the behavior implemented
by SEMS
+ here is in no way standard conform and should only be used between two SEMS
instances
+ placed behind the same last record-routing proxy.
Modified: trunk/doc/Readme.early_announce.txt
===================================================================
--- trunk/doc/Readme.early_announce.txt 2010-05-25 14:42:10 UTC (rev 1930)
+++ trunk/doc/Readme.early_announce.txt 2010-05-26 09:16:58 UTC (rev 1931)
@@ -131,12 +131,6 @@
#children=4
sip_warning=no
-# Configure Ser to create a FIFO server
-#fifo="/tmp/ser_fifo"
-
-# Configure Ser to create an unix socket server
-unix_sock="/tmp/ser_socket"
-
loadmodule "modules/sl/sl.so"
loadmodule "modules/tm/tm.so"
loadmodule "modules/rr/rr.so"
@@ -148,11 +142,7 @@
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
-modparam( "avpops", "avp_aliases", "sess_params=i:66" )
-# this is to be appended to the invite
-modparam("tm", "tw_append","early_headers:P-App-Name=avp[$sess_params]")
-
# ------------------------- request routing logic -------------------
# main routing logic
route{
@@ -179,45 +169,15 @@
};
if (uri==myself) {
- # filter unsupported requests
- if (!(method=="REGISTER" || method=="ACK" || method=="INVITE" ||
- method=="BYE" || method=="CANCEL" )) {
- sl_send_reply("501", "method not understood here");
- break;
- }
- if (method=="REGISTER") {
- # make UAs which want to register unhappy
- sl_send_reply("501","registration couldn't be
accepted");
- break;
- };
-
- if (!t_newtran()){
- sl_send_reply("500","could not create transaction");
- break;
- };
-
if (method == "INVITE") {
-
avp_write("Final-Reply-Code=405;Final-Reply-Reason=Prohiboted",
- "$sess_param");
+ append_hf("P-App-Name: early_announce\r\n");
+ append_hf("P-App-Param:
Final-Reply-Code=405;Final-Reply-Reason=Prohibited\r\n");
-
if(!t_write_unix("/tmp/sems_sock","early_announce/early_headers")){
- log("could not contact early_announce\n");
- t_reply("404","not found");
- };
- break;
-
- } else if (method=="BYE" || method=="CANCEL") {
- if(!t_write_unix("/tmp/sems_sock","bye")) {
- t_reply("500","error contacting sems");
- };
- break;
- } else if (method=="ACK"){
- # absorb ACKs
- t_relay();
- break;
- };
+ # assume that SEMS runs on locahost at port 5080
+ t_relay_to("udp:localhost:5080");
+ }
break;
}
Modified: trunk/doc/Readme.mailbox.txt
===================================================================
--- trunk/doc/Readme.mailbox.txt 2010-05-25 14:42:10 UTC (rev 1930)
+++ trunk/doc/Readme.mailbox.txt 2010-05-26 09:16:58 UTC (rev 1931)
@@ -37,18 +37,16 @@
Example for ser.cfg
===================
-# appends for INVITE to mailbox
-modparam("tm", "tw_append", "mailbox_headers:P-Iptel-Param=avp[$mailbox_url]")
-
-
-...
+# for all INVITEs that should go to mailbox
+#
# replace this with a function that loads imap url e.g. from DB
# into $mailbox_url AVP
-
avp_write("Mailbox-URL=imap://user:passw...@imapserver:143/INBOX",
- "$mailbox_url");
+ avp_write("Mailbox-URL=imap://user:passw...@imapserver:143/INBOX",
+ "$mailbox_url");
- if (!t_write_unix("/tmp/sems_sock","mailbox/mailbox_headers")){
- log("could not contact mailbox\n");
- t_reply("500","could not contact media server");
- }
- break;
\ No newline at end of file
+ append_hf_value("P-App-Name","mailbox");
+ append_hf_value("P-App-Param","%$mailbox_url");
+
+ # assume that SEMS is running at localhost:5080
+ t_relay_to("udp:localhost:5080");
+ break;
Modified: trunk/doc/Readme.sw_prepaid_sip.txt
===================================================================
--- trunk/doc/Readme.sw_prepaid_sip.txt 2010-05-25 14:42:10 UTC (rev 1930)
+++ trunk/doc/Readme.sw_prepaid_sip.txt 2010-05-26 09:16:58 UTC (rev 1931)
@@ -76,24 +76,16 @@
How to configure SEMS' sip proxy
--------------------------------
-Modify the "tw_append" parameter of the "tm" option to pass the mandatory
headers to
-SEMS:
+Using SIP router, just add a proper block to pass prepaid calls to SEMS.
-modparam("tm", "tw_append",
-
"prepaid_headers:hdr[P-Caller-Uuid];hdr[P-Proxy];hdr[P-R-Uri];hdr[P-Acc-Dest]")
+In this example, we assume that calls prefixed by "pre" are considered prepaid
+requests:
-Then add a proper block to pass prepaid calls to SEMS. In this example,
-we assume that calls prefixed by "pre" are considered prepaid requests.
-For ser-0.9.6 as SEMS' sip proxy, use something like:
-
if(uri =~ "sip:pre.+@")
{
strip(3);
- if(!t_write_unix("/tmp/sems.sock","sw_prepaid_sip/prepaid_headers"))
- {
- xlog("L_ERR", "Error contacting SEMS - M=%rm R=%ru F=%fu T=%tu
ID=%ci\n");
- t_reply("500","Could not contact B2BUA server");
- }
+ # assume that SEMS is running at localhost:5080
+ t_relay_to("udp:localhost:5080");
break;
}
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev