[Freeswitch-users] CDR Gateways

FERNANDO VILLARROEL fvillarroel at yahoo.com
Thu Jan 21 20:26:10 PST 2010


Dear All.

I have defined various gateways in ~/sip-profiles/external

My questions is if a gateway named foo that send calls from diferents IP address like x.x.x.x and x.x.x.y. How i can doing a group for both ip address where i can doing later a sql like accountcode=foo?

In this moment if i need know the traffic of customer foo, i should doing two differents cdr, one for every ip address.

It's fine or i can doing of different way?

I hope anyone could me explain how i can doing. 

my gateway foo.xml

<include>
    <gateway name="foo">
      <param name="username" value="foo"/>
      <param name="password" value="foo"/>
      <param name="realm" value="x.x.x.x"/>
      <param name="register" value="false"/>
      <param name="context" value="public"/>
    </gateway>
</include>

foo1.xml

<include>
    <gateway name="foo1">
      <param name="username" value="foo1"/>
      <param name="password" value="foo1"/>
      <param name="realm" value="x.x.x.y"/>
      <param name="register" value="false"/>
      <param name="context" value="public"/>
    </gateway>
</include>

Both gateways foo and foo1 are the same customer

my cdr_csv.conf.xml

<configuration name="cdr_csv.conf" description="CDR CSV Format">
  <settings>
    <!-- 'cdr-csv' will always be appended to log-base -->
    <!--<param name="log-base" value="/var/log"/>-->
    <param name="default-template" value="sql"/>
    <!-- This is like the info app but after the call is hung up -->
    <!--<param name="debug" value="true"/>-->
    <param name="rotate-on-hup" value="false"/>
    <!-- may be a b or ab -->
    <param name="legs" value="ab"/>
  </settings>
  <templates>
        <template name="sql">INSERT INTO v_cdr (v_id, caller_id_name, caller_id_number, destination_number, context, start_stamp, answer_stamp, end_stamp,
duration, billsec, hangup_cause, uuid, bleg_uuid, accountcode, read_codec, write_codec, remote_media_ip, network_addr) VALUES ("{v_id}", "${caller_id_name}"
,"${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}"
,"${uuid}","${bleg_uuid}", "${accountcode}", "${read_codec}", "${write_codec}", "${remote_media_ip}", "${network_addr}");</template>

The argument accountcode on my database is Blank or None for all records of gateways.
Regards.


      




More information about the FreeSWITCH-users mailing list