Upgrade 3CX to v18 and get it hosted free!

SER example accounting

Author image

SIP Express Router

example: accounting calls to numerical destinations

 

  1. $Id: acc.cfg,v 1.3 2003/06/03 03:18:12 jiri Exp $

 

  1. —————— module loading ———————————-

loadmodule “modules/tm/tm.so”
loadmodule “modules/acc/acc.so”
loadmodule “modules/sl/sl.so”
loadmodule “modules/maxfwd/maxfwd.so”
loadmodule “modules/rr/rr.so”

  1. —————– setting module-specific parameters —————

 

  1. — acc params —
  2. set the reporting log level

modparam(“acc”, “log_level”, 1)

  1. number of flag, which will be used for accounting; if a message is
  2. labeled with this flag, its completion status will be reported

modparam(“acc”, “log_flag”, 1 )

  1. ————————- request routing logic ——————-

 

  1. main routing logic

route{

/* ********* ROUTINE CHECKS ********************************** */

  1. filter too old messages

if (!mf_process_maxfwd_header(“10”)) {
log(“LOG: Too many hops\n”);
sl_send_reply(“483″,”Too Many Hops”);
break;
};
if (len_gt( max_len )) {
sl_send_reply(“513”, “Wow — Message too large”);
break;
};

  1. Process record-routing

if (loose_route()) { t_relay(); break; };

 

  1. labeled all transaction for accounting

setflag(1);

  1. record-route INVITES to make sure BYEs will visit our server too

if (method==”INVITE”) record_route();

  1. forward the request statefuly now; (we need *stateful* forwarding,
  2. because the stateful mode correlates requests with replies and
  3. drops retranmissions; otherwise, we would have to report on
  4. every single message received)

if (!t_relay()) {
sl_reply_error();
break;
};

}

See also


Back to SER tips and tricks


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.