Endpoints offline and CDR
Forum » WikiPBX / Technical Support » Endpoints offline and CDR
Started by: visuallinuxvisuallinux
On: 1244084776|%e %b %Y, %H:%M %Z|agohover
Number of posts: 18
rss icon RSS: New posts
Endpoints offline and CDR
visuallinuxvisuallinux 1244084776|%e %b %Y, %H:%M %Z|agohover

Dear All,

I am testing wikipbx with PostgreSQL and all works very well, but i have a questions:

1) I have few endpoints and gateways working fine, but in the Wikipbx the endpoints are offline; when yes are registered on FreeSwitch and i can receive and originate calls from it's, for example endpoint 101 are offline in Wikipbx but in FS_CLI is registered:

Call-ID: 3c267fbd83d6-u21iz1ru31i8@snom300-000413259778
User: 442.891.111.002|101#442.891.111.002|101
Contact: "101" <sip:601.531.68.002|101#601.531.68.002|101:59337;line=phtjisef;fs_nat=yes>
Agent: snom300/6.2.3
Status: Registered(AUTO-NAT)(unknown) EXP(2009-06-03 22:44:31)
Host: fs
IP: 200.86.135.106
Port: 59337
Auth-User: 101
Auth-Realm: 200.111.198.244

Any idea?

2) For every call i have 2 tuples in the database; for example:

id | account_id | uuid | caller_id_number | destination_number | chan_name | answered_time | hangup_time
-+--+--------+----+----+---+----—+----
418 | 1 | 42020642-5052-11de-afcf-67f40bb67bf9 | 42452904 | 56968482060 | 56968482060 | 2009-06-03 11:22:01-04 | 2009-06-03 11:22:22-04

id | account_id | uuid | caller_id_number | destination_number | chan_name | answered_time | hangup_time
-+--+--------+----+----+-----+----+----
419 | 1 | 41dfbd08-5052-11de-afcf-67f40bb67bf9 | 42452904 | 56968482060 | 521.71.802.091|40925424#521.71.802.091|40925424 | 2009-06-03 11:22:01-04 | 2009-06-03 11:22:22-04

The differece between both tuples is in column chan_name where in the tuple id = 418 is 56968482060 and the tuple id = 419 is 521.71.802.091|40925424#521.71.802.091|40925424

My questions is: for i will could sending CDR to my customers, i only get from the table wikipbx_completecall all calls where destination_number = chan_name so i not duplicate the CDR?.

3) And how i can assign every gateway with some account; example gateway 1 and gateway 2 to accountcode X; for i could do billing for every accountcode?

I hope you understand me and excuse my english.

Beste regards.

Fernando Villarroel.

Reply  |  Options
Unfold Endpoints offline and CDR by visuallinuxvisuallinux, 1244084776|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
stas_shtinstas_shtin 1244104746|%e %b %Y, %H:%M %Z|agohover

1. Looks like wikipbx missed registration events. I've found a bug in wikipbx registration handling that could cause this, so please update wikipbx and try againg.

Also, I think that the registration status gets set only when wikipbx is running. So if you've started freeswitch, then the endpoint registered, then you've started wikipbx, it won't see the registration event.

2. I suppose that we receive a CDR for each call leg here. If you aren't interested in both records, you could discard one of them in wikipbxweb.views.add_cdr function, so they won't get to the database at all. However, this may not work for both inbound and outbound calls, so test it if you'll use both directions.

3. Every gateway is assigned to a certain account in its settings page. Account's ID used for call is saved in the wikipbxweb_completedcall table in the account_id field. So you shouldn't have much difficulties with billing.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by stas_shtinstas_shtin, 1244104746|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1244144155|%e %b %Y, %H:%M %Z|agohover

Also, I think that the registration status gets set only when wikipbx is running. So if you've started freeswitch, then the endpoint registered, then you've started wikipbx, it won't see the registration event.

Yes, that is true, and it should be fixed. I think when a user loads that page to show all endpoints, it should probably just issue an event socket request to get all the registrations for a given profile/account and show the status based on the returned results. Any thoughts?

I suppose that we receive a CDR for each call leg here.

I just checked on my PBX .. I didn't see that happening. At least not for inbound calls from a gateway. I will test outbound calls later..

Every gateway is assigned to a certain account in its settings page. Account's ID used for call is saved in the wikipbxweb_completedcall table in the account_id field. So you shouldn't have much difficulties with billing.

Right. A gateway is associated with a single account. However, ANY account can add some dialplan XML to use any gateway defined in the system, even for other accounts, which I feel is a bug in WikiPBX since it should be more compartmentalized.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by tleydentleyden, 1244144155|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1244150382|%e %b %Y, %H:%M %Z|agohover

Hello.

Yes effectively the account_id is a foreing key to the table wikipbx_account.

So i will need identify another gateways or endpoints with other account_id, i will do another Web User with Is Admin True, and later i will login and create new gateway or endpoints with this new account admin?.

Fernando Villarroel.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1244150382|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1244150936|%e %b %Y, %H:%M %Z|agohover

Suppose you have two accounts (aka "Tenants"): Foo and Bar. Each needs an admin user, like joe@foo.com and joe@bar.com. To manage gateways for the Foo account, you should login as joe@foo.com.

I would prepend the account name to the gateway name. For example if you have a gateway called Acme, and it is used by both accounts using different gateway credentials, you could create the Foo_Acme gateway owned by the Foo account and the Bar_Acme gateway owned by the Bar account. Should prevent things from getting mixed up between accounts.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by tleydentleyden, 1244150936|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1244164685|%e %b %Y, %H:%M %Z|agohover

Ok thank you for your examples i understand now.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1244164685|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1246938031|%e %b %Y, %H:%M %Z|agohover

Dear,

If i have my system on IP 10.0.0.1 and my wikipbx use this IP as external_sip_ip and external_rtp_ip; but when i try to create another account admin with: external_sip IP 10.0.0.1 and sip port 5060, i receive a exception UNIQUE KEY:

«wikipbxweb_account_sip_port_key» UNIQUE, btree (sip_port, ext_sip_ip)

So for each admin's account i use differents sip port 5061, 5062….., it's fine?

Other questions; how i can use field "extension" on the dial plan (extensions of wikipbx) when i create a new Gateway?; is similar to context name of Asterisk?.

Fernando

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1246938031|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1246950991|%e %b %Y, %H:%M %Z|agohover

So for each admin's account i use differents sip port 5061, 5062….., it's fine?

Yup, that is the way to do it for now. Eventually this will change, see Planned change: domain-based multi-tenancy instead of profile based multi-tenancy

Other questions; how i can use field "extension" on the dial plan (extensions of wikipbx) when i create a new Gateway?; is similar to context name of Asterisk?.

I'm confused .. what exactly are you trying to accomplish?

Reply  |  Options
Unfold Re: Endpoints offline and CDR by tleydentleyden, 1246950991|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1246983380|%e %b %Y, %H:%M %Z|agohover

When i create a new gateway from wikipbx i need complete some fields in the form, example:

Gateway name = foo
User name = foo
Password = foo
Proxy = 10.0.1.2
Extension = foo (*optional*)

Later i need create a extension for this new Gateway named "foo" for inbound calls like this:

<extension name="foo">
<action application="bridge" data="sofia/gateway/gw/$1"/>
</extension>

This is OK?

Regarding of the sip port, if i create a new admin account in port 5062 for example so the inbound calls for this new profile must going to port 5062? or if i have a new gateway on this new profile , this new gateway must send traffic to port 5062 or 5060?

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1246983380|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
stas_shtinstas_shtin 1246985301|%e %b %Y, %H:%M %Z|agohover

You're right about extension - it's the extension to use for incoming call from that gateway.

I don't understand the difference between "the inbound calls for this new profile must going to port" and "this new gateway must send traffic to port" - sounds like the same thing to me. Have a look at freeswitch profile docs.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by stas_shtinstas_shtin, 1246985301|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
stas_shtinstas_shtin 1246961381|%e %b %Y, %H:%M %Z|agohover

Freeswitch and asterisk have pretty much the same notion of extensions and contexts. However, freeswitch has dialplan actions inside an extension, while asterisk has multiple actions following each other in such cases.

Have a look at freeswitch dialplan docs.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by stas_shtinstas_shtin, 1246961381|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1246985868|%e %b %Y, %H:%M %Z|agohover

Yes, effectively i need understand how create differents extensions for end points and gateways for each profile name from Wikipbx.

In my company i have traffic retail from end points and traffic wholesale from differents customers (Gateways), and i want change my actually platform for Wikipbx & FS, but first i need understand how i can do. I f you give some example i am very grateful.

Another questions is the default config in install of FS and Wikipbx some external gateway can send traffic to my IP (FS and Wikipbx) how i can restricted this only for external gateways registered?.

Yes i know the last questions is for FreeSWITCH list, but when i consulting to list and they know that i use wikipbx i not receive support.

Also i can contribute with this project writing documentation if you want, or how i can help you with some how to?

Fernando.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1246985868|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1247079223|%e %b %Y, %H:%M %Z|agohover

I just realized something .. this question has absolutely nothing to do with "Endpoints offline and CDR" :) To keep this forum well organized, everybody must adhere by some basic posting rules .. and rule #1 is to create a new forum thread for a different topic, even though it may be slightly less work to just hijack an existing thread.

Using wikipbx and posting questions to the forum, fixing broken / misleading wiki pages is the best way to help out the project.

So for your original question, I think we should back up and look at your original requirements and then go from there. How about we start a new thread called "Retail traffic from endpoints and wholesale traffic from gateways" and you write out your requirements, and we will try to suggest a way to set this up using wikipbx and freeswitch. To me that is an interesting setup and I'm sure its interesting to a lot of people. It may expose some missing features in WIkiPBX that we need to put on the high priority list of things to fix.

Try to explain it using fake retail/wholesale customer names and describe what service you want to provide to each. For example:

  • Joe, Bill, and Bob from foo.com register to my pbx. They can call eachother, or they can dial to the PSTN out of their gateway X.
  • bar.com sends SIP traffic to my box and I bridge out of gateway Y. I need to authenticate bar.com so that only bar.com can send out of gateway Y.

Etc..

Unfold Re: Endpoints offline and CDR by tleydentleyden, 1247079223|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1247178988|%e %b %Y, %H:%M %Z|agohover

Ok tleyden excuse, i will do.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1247178988|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1244144222|%e %b %Y, %H:%M %Z|agohover

2) For every call i have 2 tuples in the database

Is this for inbound calls, outbound calls, or both?

Can you post some examples of the dialplan you are using?

Reply  |  Options
Unfold Re: Endpoints offline and CDR by tleydentleyden, 1244144222|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1244148937|%e %b %Y, %H:%M %Z|agohover

Hello,

This is for inbound calls; i create a extensions for gateway Dialout as the follow:

Extension # ^(569)([5-9])(\d{7})$

Action XML:

<action application="set" data="proxy_media=true"/>
<action application="bridge" data="sofia/gateway/ubb/$1$2$3"/>

I have enable proxy media for that i am using mod_g729 Passthru.

Fernando Villarroel N.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1244148937|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
tleydentleyden 1244150440|%e %b %Y, %H:%M %Z|agohover

Ok, well I think it makes sense to get two CDR's here. In theory you might want to bill different rates for the incoming DID minutes and the outgoing minutes out of the gateway.

In your case do you only care about billing the outgoing minutes and want to ignore the incoming call leg?

Looking at the CDR XML, I don't see an obvious way to differentiate between incoming and outgoing calls. Maybe somewhere on the freeswitch wiki or someone on the freeswitch list would know ..

Reply  |  Options
Unfold Re: Endpoints offline and CDR by tleydentleyden, 1244150440|%e %b %Y, %H:%M %Z|agohover
Re: Endpoints offline and CDR
visuallinuxvisuallinux 1244163881|%e %b %Y, %H:%M %Z|agohover

Ok, very well i am understanding now.

It's perfect; i can does billing for inbound calls and outbound calls.

Thank you.

Reply  |  Options
Unfold Re: Endpoints offline and CDR by visuallinuxvisuallinux, 1244163881|%e %b %Y, %H:%M %Z|agohover
New Post
page_revision: 0, last_edited: 1226259295|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License