[sr-dev] Kamailio Scripting for SIP Routing

Daniel-Constantin Mierla miconda at gmail.com
Tue Dec 22 13:07:27 CET 2015


Hello,

as I said in a previous email, you have to describe what match_dialog()
and fix_route_dialog() do in order to be able to help you. It is very
unlikely someone here has any knowledge of other sip servers apart of
Kamailio, as you write to kamailio dev list.

If you don't know why are those function in your config and what they
are supposed to do, then it is better to remove them anyhow.

As another guess to try helping:

- replace:

if (match_dialog()) {

- with:

 if(is_known_dlg()) {

Then remove completely:

                       if ($DLG_status==NULL) {
                                xlog("Dialog NULL");
                        }
                        else {
                                fix_route_dialog();
                        }

Test and see if it works as you need.

This is the last attempt to give you blind guidelines. If you want
further assistance, you have to describe what you need to get as SIP
routing. Nobody will spend time to read on internet for you and more
important, if you don't know what is supposed to do in terms of SIP
routing, then you are doing it all wrong.

I am saying it because in case you do a telephony service without
properly understanding what you do with kamailio (or other voip system
such as asterisk, freeswitch, ...), it will not last long until someone
breaks your voip system, which can cost you a lot in damages.

Daniel

On 22/12/15 12:52, yasir ay wrote:
> Hai Daniel,
>
> Am using Kamailio 4.4.0
>
> version: kamailio 4.4.0-dev8 (x86_64/linux) a2e3c0
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
> USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
> SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY,
> USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
> USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
> MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: a2e3c0
> compiled on 05:33:57 Dec 18 2015 with gcc 4.8.5
>
> Now I have a routing scripting written in opensips going to change
> into kamailio.cfg.
> But am facing some issues about functions and modules paramaeters,
> So please help me a good documents to write kamailio script,
> i dnt which function to mathc_dialog,fix_route_dialog..etc....
>
>
>
>    if (has_totag()) {
>                  if (match_dialog()) {
>                         if ($DLG_status==NULL) {
>                                 xlog("Dialog NULL");
>                         }
>                         else {
>                                 fix_route_dialog();
>                         }
>                         if (is_method("BYE")) {
>                                 remove_hf("User-Agent:");
>                                 t_relay();
>                         }
>                         else if (is_method("INVITE")) {
>                                 record_route();
>                                 route(RELAY);
>                         }
>                         else {
>                                 route(RELAY);
>                         }
>                 }
>                 else {
>                         if ( is_method("ACK")) {
>                                 remove_hf("Route:");
>                                 if ( t_check_trans() ) {
>                                         t_relay();
>                                         exit;
>                                 }
>                                 else {
>                                         exit;
>                                 }
>                         }
>                         sl_send_reply("404","Not here");
>                 }
>                 exit;
>         }
> The above scriptis from opensip.cfg please show by changing above part
> into kamailio.cfg
>
> Thanks& Regards
> Yasir
>
> http://about.me/mhdyas

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20151222/fd30a9bc/attachment-0001.html>


More information about the sr-dev mailing list