You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sems/doc/Readme.announce_transfer

54 lines
1.5 KiB

Announcement then call transfer
This application plays an announcement and then REFERs the caller
to either the uri configured in P-Refer-To header, or if his is not
configured, the request URI of the first INVITE.
If refer is not accepted, succeeds, or fails, a BYE is sent.
Example ser configuration appends:
#appends: parameter for announce_transfer
modparam( "tm", "tw_append",
"announce_transfer_headers:P-Refer-To=avp[$refer_to]")
# 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("sip:callme@example.com","$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;
}