[OpenSIPS-Users] Need opensips only send accounting requests at BYE to aaa radius

Ahmed Shabana a.shabana at cequens.com
Fri Dec 15 14:52:04 EST 2017


Dears , I am facing a strange issue and spending so many hours on it .
We have two environment Development and staging ,
opensips use Radius as accounting backend
, opensips.cfg generated from template that should only apply each environment IPs and VAR
Vimdiff show that files identical except in params of each environment  .
We use do_accounting("aaa", "cdr") at initial INVITE as below

@ Initial INVITE
13         $acc_extra(extra_au) = $au ;
12         $acc_extra(extra_ru) = $ru;
11         $acc_extra(extra_rpid) = $avp(rpid);
10         $acc_extra(extra_si) = $si;
  9         $acc_extra(extra_username) = $au;
  8         $acc_extra(extra_ar) = $ar;
  7         $acc_extra(extra_rd) = $rd;
  6         $acc_extra(extra_fU) = $fU;
  5         $acc_extra(extra_rU) = $rU+"@"+$rd;
  1           xlog("---- current Dialog.Status is :$DLG_status " ) ; # the output of this log $DLG_Status = 1 as expected
  2         do_accounting("aaa","cdr");



@ is_method("BYE")
  do_accounting("aaa", "cdr|failed|missed");


The problem now is :
When apply radsniff at Development , it behaves exactly as we plan
Send Accounting request only at Acct-Status-Type Stop with all params
-----------------------------------------------------------
Access-Request Id 230   192.168.13.1:35549 -> 192.168.13.11:1812        +0.000
        User-Name = "restcomm.test at 192.168.1.100"
        Digest-Attributes = 0x0a0f72657374636f6d6d2e74657374
        Digest-Attributes = 0x010f3139322e3136382e312e313030
        Digest-Attributes = 0x0232356133343233643730303030303038383464323865663661373330393464386362656566303664333862373964326537
        Digest-Attributes = 0x04217369703a2b393636353633373032323638403139322e3136382e312e313030
        Digest-Attributes = 0x0308494e56495445
        Digest-Response = "4bfc6f0ecee7b25d81cf4e68f52243db"
        Service-Type = IAPP-Register
        Sip-Uri-User = "1234"
        Acct-Session-Id = "d6cd5b2bec619771f02e050c3c92ca7e at 172.19.0.2"
        NAS-Port = 5060
        NAS-IP-Address = 192.168.13.1

Access-Accept Id 230    192.168.13.11:1812 -> 192.168.13.1:35549        +0.001

Accounting-Request Id 231       192.168.13.1:32887 -> 192.168.13.11:1813        +0.048
        Acct-Status-Type = Stop
        Service-Type = IAPP-Register
        Sip-Response-Code = 200
        Sip-Method = Invite
        Event-Timestamp = "Dec 15 2017 19:34:17 UTC"
        Sip-From-Tag = "81019376_9b1d9904_57a5b08a_ef03d73c"
        Sip-To-Tag = "as2ae5edf5"
        Acct-Session-Id = "d6cd5b2bec619771f02e050c3c92ca7e at 172.19.0.2"
        Sip-Call-Duration = 0
        Sip-Call-MSDuration = 367
        Sip-Call-Setuptime = Route-IP-No
        Sip-Translated-Request-URI = "sip:+966563702268 at 192.168.13.12:5060"
        Sip-Src-IP = "\002"
        User-Name = "rxt.test"
        SIP-AVP = "192.168.13.12"
        Calling-Station-Id = "1234"
        Called-Station-Id = "966563702268 at 192.168.13.12"
        Sip-Group = "ACae6e420f425248d6a26948c17a9e2acf"
        NAS-Port = 5060
        Acct-Delay-Time = 0
        NAS-IP-Address = 192.168.13.1




At Staging environment ,
It Send Accounting-Request for both Acct-Status-Type Start and Stop !!!

Access-Request Id 199    192.168.104.109:43417 -> 192.168.105.241:1812               +1901.364
                User-Name = "restcomm.test at 192.168.104.109"
                Digest-Attributes = 0x0a0f72657374636f6d6d2e74657374
                Digest-Attributes = 0x01113139322e3136382e3130342e313039
                Digest-Attributes = 0x0232356133343161366630303030303030313563633834333862343365306633386439303764313230303564373230633334
                Digest-Attributes = 0x04237369703a2b323031313135353433363236403139322e3136382e3130342e313039
                Digest-Attributes = 0x0308494e56495445
                Digest-Response = "3d8cccd86495bddedbdae41999820898"
                Service-Type = Sip-Session
                Sip-Uri-User = "2979666"
                Acct-Session-Id = "68d55cd505be7b9f3ad4adae150a693e at 192.168.104.207"
                NAS-Port = 5060
                NAS-IP-Address = 192.168.104.109

Access-Accept Id 199      192.168.105.241:1812 -> 192.168.104.109:43417               +1901.371





Accounting-Request Id 200           192.168.104.109:41734 -> 192.168.105.241:1813               +1911.726
                Acct-Status-Type = Start
                Service-Type = Sip-Session
                Sip-Response-Code = 200
                Sip-Method = INVITE
                Event-Timestamp = "Dec 15 2017 18:54:19 UTC"
                Sip-From-Tag = "74898207_03603651_57a5b08a_059b89a0"
                Sip-To-Tag = "23712318_6772d868_bd252ab2-7f19-4b4b-9d64-8543b3e60525"
                Acct-Session-Id = "68d55cd505be7b9f3ad4adae150a693e at 192.168.104.207"
                Digest-Attributes = 0x0a0f72657374636f6d6d2e74657374
                Sip-Translated-Request-URI = "sip:201115543626 at ceq.pstn.ie1.twilio.com"
                Sip-Src-IP = "\317h\250\300[\0324Z"
                User-Name = "rxt.test"
                Attr-111 = 0x3139322e3136382e3130342e313039
                SIP-AVP = "ceq.pstn.ie1.twilio.com"
                Calling-Station-Id = "2979666"
                Called-Station-Id = "201115543626 at ceq.pstn.ie1.twilio.com"
                Sip-Group = "ACae6e420f425248d6a26948c17a9e2acf"
                NAS-Port = 5060
                Acct-Delay-Time = 0
                NAS-IP-Address = 192.168.104.109

Accounting-Response Id 200        192.168.105.241:1813 -> 192.168.104.109:41734               +1911.727

Access-Request Id 201    192.168.104.109:34342 -> 192.168.105.241:1812               +2545.558
                User-Name = "restcomm.test at 192.168.104.109"
                Digest-Attributes = 0x0a0f72657374636f6d6d2e74657374
                Digest-Attributes = 0x01113139322e3136382e3130342e313039
                Digest-Attributes = 0x0232356133343163663330303030303030306534383762636339316161333161616532643938666336623535313831346235
                Digest-Attributes = 0x04237369703a2b323031313135353433363236403139322e3136382e3130342e313039
                Digest-Attributes = 0x0308494e56495445
                Digest-Response = "aa768ad30a7ec76ba70c2a1507920ff6"
                Service-Type = Sip-Session
                Sip-Uri-User = "2979666"
                Acct-Session-Id = "bf121b81b4413a8f5ccf5a3f703d89cc at 192.168.104.207"
                NAS-Port = 5060
                NAS-IP-Address = 192.168.104.109

Access-Accept Id 201      192.168.105.241:1812 -> 192.168.104.109:34342               +2545.560




Which make the custom SQL statement we build at /etc/freeradius/sql/mysql/dialup.conf not function , which only handle accounting_stop_query

Your support is so much appreciated


Best regards ,
Shabana

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171215/f75775d3/attachment-0001.html>


More information about the Users mailing list