[Freeswitch-users] mod_xml_ldap compile issue.

2009-12-18 Thread Keith Laaks
Hi,

I am having an issue getting mod_xml_ldap to compile properly

cut-cut
making all mod_xml_cdr

making all mod_xml_ldap
Creating mod_xml_ldap.la...
/usr/bin/ld:
/home/keithl/freeswitch/freeswitch.trunk/libs/openldap-2.4.19/libraries/liblutil/liblutil.a(sasl.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a
shared object; recompile with -fPIC
/home/keithl/freeswitch/freeswitch.trunk/libs/openldap-2.4.19/libraries/liblutil/liblutil.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
cat: .libs/mod_xml_ldap.log: No such file or directory
make[5]: *** [mod_xml_ldap.la] Error 1
make[4]: *** [all] Error 1
make[3]: *** [mod_xml_ldap-all] Error 1
make[2]: *** [all-recursive] Error 1

I notice the openldap library has been bumped up to .19 - not sure if that
may have anything to do with it.

At revision 15995 on a 2.6.31-15-generic Ubuntu x86_64 GNU/Linux notebook.

mod_ldap compiles OK, but mod_xml_ldap fails as per the above.

What am I doing working here ?

Best Regards

Keith













___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


[Freeswitch-users] Adding headers to INFO messages for Advice of Charge on SNOM

2009-11-23 Thread Keith Laaks



Hi,

I have tried maintaining charging information on a SNOM 300's display
using 'display' - but found that the phone has some timer, whereby every
60 seconds it wipes out whatever happens to be on the display at that
time and replaces is with the dialled number. So not a viable option as
it impacts usability. Really annoying when the display was just updated 
with valuable information for the user and a split second later it gets
replaced. 
[If somebody knows how to disable this behaviour - please do tell...] 

I see that SNOM supports a number of features for Advice of Charge.

From their Wiki: 

http://wiki.snom.com/Advice_of_charge_%28AOC%29_in_SIP
Example of an SIP-Info Message:

-
INFO sip:b...@snom.com SIP/2.0
From: bil...@snom.com;tag=5354n3
To: u...@snom.com;tag=33rfh3
CSeq: 23423 INFO
Call-ID: 3452tw43dt354dm03
AOC: charging;state=active;
 charging-info=currency;
 currency=EUR;
 amount=2000;
 multiplier=0.001
Content-Length: 0
- 

So the question - Is there some method available today to add these additional
 'new' headers to an INFO message I can send out to these phones?

If not, I guess it's a matter of looking at enhancing the case 
SWITCH_MESSAGE_INDICATE_DISPLAY section in mod_sofia.c ?


Best Regards

Keith







___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


[Freeswitch-users] Calls dropping on SIP timer expiry due to UPDATE's being ignored.

2009-10-21 Thread Keith Laaks
Hi,

Hope someone knows how I am able to get around this one. Here goes...

Did an upgrade to trunk (from a July vintage build) last week and
noticed calls out to a provider were now failing after about 30 seconds
or so - post answer. Tried latest (15183) - same thing.

Analysing, I see that I have multiple UPDATE messages now being sent to
the provider, but no response being sent back to FS. So FS times out and
eventually kills the call.
Interestingly, it only drops the A-leg; the B-leg remains up till the B
party hangs up.

I cant recall seeing these UPDATE messages before...

The intent of the UPDATE seems to be to send the callee name  number to
the B-leg.

If its the provider's sip stack that's broken w.r.t. handling UPDATE -
is there any way to get around it by doing something in my config to
ensure these UPDATE's are not 'triggered' ?


Some traces below. 


Any suggestions welcomed...

Best Regards

Keith
Pretoria, South Africa.

--


send 1048 bytes to udp/[196.10.11.12]:5060 at 13:24:04.249269:


   INVITE sip:27835551...@196.10.11.12 SIP/2.0
   Via: SIP/2.0/UDP 10.17.10.10;rport;branch=z9hG4bKyQepDXQ5H8g5m
   Max-Forwards: 67
   From: Keith PhoneADSL sip:878050...@10.17.10.10;tag=Upa3NvXpBB1eF
   To: sip:27835551...@196.10.11.12
   Call-ID: d821359d-38e7-122d-a38e-002264cc9b93
   CSeq: 121947386 INVITE
   Contact: sip:gw+vp...@10.17.10.10:5060;transport=udp;gw=vprov
   User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-15183M
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, REGISTER,
REFER, UPDATE, NOTIFY
   Supported: timer, precondition, path, replaces
   Allow-Events: talk, refer
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 247
   X-Actually-Support: UPDATE
   Remote-Party-ID: Keith PhoneADSL
sip:878050...@10.17.10.10;party=calling;screen=yes;privacy=off
   
   v=0
   o=FreeSWITCH 1256118582 1256118583 IN IP4 10.17.10.10
   s=FreeSWITCH
   c=IN IP4 10.17.10.10
   t=0 0
   m=audio 12862 RTP/AVP 18 101
   a=rtpmap:18 G729/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-16
   a=silenceSupp:off - - - -
   a=ptime:20


2009-10-21 15:24:04.248448 [DEBUG] sofia.c:3493 Channel
sofia/vvrf/2783555 entering state [calling][0]
recv 601 bytes from udp/[196.10.11.12]:5060 at 13:24:04.307690:


   SIP/2.0 100 Trying
   Via: SIP/2.0/UDP 10.17.10.10;rport;branch=z9hG4bKyQepDXQ5H8g5m
   From: Keith PhoneADSL sip:878050...@10.17.10.10;tag=Upa3NvXpBB1eF
   To: sip:27835551...@196.10.11.12;tag=GR52RWG346-34
   Call-ID: d821359d-38e7-122d-a38e-002264cc9b93
   CSeq: 121947386 INVITE
   Contact: vprov C5CM sip:196.10.11.12:5060
   User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-15183M
   Allow-Events: talk
   Allow-Events: refer
   Content-Disposition: session
   X-Actually-Support: UPDATE
   Remote-Party-ID: Keith PhoneADSL
sip:878050...@10.17.10.10;party=calling;screen=yes;privacy=off
   Content-Length: 0
   


recv 879 bytes from udp/[196.10.11.12]:5060 at 13:24:08.508162:


   SIP/2.0 183 Session Progress
   Via: SIP/2.0/UDP 10.17.10.10;rport;branch=z9hG4bKyQepDXQ5H8g5m
   From: Keith PhoneADSL sip:878050...@10.17.10.10;tag=Upa3NvXpBB1eF
   To: sip:27835551...@196.10.11.12;tag=GR52RWG346-34
   Call-ID: d821359d-38e7-122d-a38e-002264cc9b93
   CSeq: 121947386 INVITE
   Contact: vprov C5CM sip:196.10.11.12:5060
   User-Agent: FreeSWITCH-mod_sofia/1.0.trunk-15183M
   Allow-Events: talk
   Allow-Events: refer
   Content-Disposition: session
   X-Actually-Support: UPDATE
   Remote-Party-ID: Keith PhoneADSL
sip:878050...@10.17.10.10;party=calling;screen=yes;privacy=off
   Content-Type: application/sdp
   Content-Length:   233
   
   v=0
   o=Clarent 152602 152603 IN IP4 196.10.11.15
   s=Clarent C5CM
   c=IN IP4 196.10.11.15
   t=0 0
   m=audio 5230 RTP/AVP 18 101
   a=rtpmap:18 G729/8000
   a=ptime:20
   a=fmtp:18 annexb=no
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15


2009-10-21 15:24:08.507506 [DEBUG] sofia.c:3493 Channel
sofia/vvrf/2783555 entering state [proceeding][183]
2009-10-21 15:24:08.507506 [DEBUG] sofia.c:3500 Remote SDP:
v=0
o=Clarent 152602 152603 IN IP4 196.10.11.15
s=Clarent C5CM
c=IN IP4 196.10.11.15
t=0 0
m=audio 5230 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20

2009-10-21 15:24:08.507506 [DEBUG] sofia_glue.c:3144 Audio Codec Compare
[G729:18:8000:20]/[G729:18:8000:20]
2009-10-21 15:24:08.508561 

Re: [Freeswitch-users] Ringback when running G729 codec

2009-09-30 Thread Keith Laaks
Hi,

I am testing a trunk version from the weekend and have moved configs
over from a box pre 1.04. Looks like Rev: 15011, but the box was built
by someone else - so not 100% certain of exact number.

With :
action application=pre_answer/
action application=sleep data=2/
action application=answer/

I am not getting ringback after the 'pre_answer'.

Was testing with G722 and G729 on the inbound leg.

I wonder if it's related to this?

Best Regards

Keith




On Fri, 2009-09-25 at 13:30 -0500, Anthony Minessale wrote:
 fixed in latest trunk,
 please test
 thank you
 
 On Fri, Sep 25, 2009 at 6:17 AM, Hound Dog d_ho...@ymail.com wrote:
 Hi,
 
 very happy with freeswitch as a PBX/softswitch/SBC system its
 working solidly for a few weeks now  - just great
 
 
 I have a question regarding ringback tones - custom or regular
 - I cant get freeswitch to send ringback using G729 
 
 I used the following settings ( it will just play one of the
 IVR prompts as ringback (filename
 ivr-to_repeat_these_options)  - I took it from the G729
 encoded files package , it has PCMA , G729 G723 extensions ) 
 
  extension name=inbound_routing
 condition field=destination_number
 expression=^4420885767(0\d)$
 action application=set
 
 data=ringback=/usr/local/freeswitch/sounds/en/us/callie/raw_files/ivr/ivr-to_repeat_these_options/
 action application=set
 data=instant_ringback=true/
 action application=bridge data=user/10
 $1/
 /condition
  /extension
 
 when I call with  G711 enabled , it plays the file no problems
 - see log 
 
 2009-09-25 11:29:58.641361 [DEBUG] sofia.c:3289 Channel
 sofia/external/442078562...@80.80.80.80 entering state
 [early][183]
 2009-09-25 11:29:58.641361 [DEBUG] switch_core_session.c:630
 Send signal sofia/external/442078562...@80.80.80.80 [BREAK]
 2009-09-25 11:29:58.641361 [DEBUG] switch_ivr_originate.c:1718
 Raw Codec Activation Success l...@8000hz 1 channel 20ms
 2009-09-25 11:29:58.641361 [DEBUG] switch_ivr_originate.c:1745
 Play Ringback File
 
 [/usr/local/freeswitch/sounds/en/us/callie/raw_files/ivr/ivr-to_repeat_these_options.PCMA]
 2009-09-25 11:29:58.641361 [INFO] mod_native_file.c:82 Opening
 File
 
 [/usr/local/freeswitch/sounds/en/us/callie/raw_files/ivr/ivr-to_repeat_these_options.PCMA]
  8000hz
 2009-09-25 11:29:58.889369 [DEBUG] sofia.c:3289 Channel
 sofia/internal/sip:1...@82.80.131.233:40505 entering state
 [proceeding][180]
 
 
 when I call with G729 only  - I get silence , and freeswitch
 only send the comfort noise packet and no RTP , see log 
 
 2009-09-25 11:28:57.437537 [DEBUG] sofia.c:3289 Channel
 sofia/external/442078562...@80.80.80.80 entering state
 [early][183]
 2009-09-25 11:28:57.437537 [DEBUG] switch_core_session.c:630
 Send signal sofia/external/442078562...@80.80.80.80 [BREAK]
 2009-09-25 11:28:57.685536 [DEBUG] sofia.c:3289 Channel
 sofia/internal/sip:1...@82.80.131.233:40505 entering state
 [proceeding][180]
 2009-09-25 11:28:57.685536 [NOTICE] sofia.c:3353 Ring-Ready
 sofia/internal/sip:1...@82.80.131.233:40505!
 
 mod_native_file  works well for me when used in applications
 and plays G729 files no problem 
 
 any ideas why is that happening , any suggestions on how to
 resolve ?
 
 thanks
 Ori
 
 
 
 
 
 ___
 FreeSWITCH-users mailing list
 FreeSWITCH-users@lists.freeswitch.org
 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
 
 UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
 http://www.freeswitch.org
 


___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Async JS functions?

2009-07-31 Thread Keith Laaks
Hi Nicolas,

 

I wonder if session.execute( sched_broadcast, +1 /path/file.wav
aleg) followed immediately by your 'new Session' and 'bridge' would do
the trick ?

Not sure if/how sched_broadcast functions when the call has not yet
been bridged though...

 

Let us know..

 

Best Regards

 

Keith

 

 

From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of
Nicolas Brenner
Sent: 30 July 2009 20:31
To: freeswitch-users@lists.freeswitch.org
Subject: [Freeswitch-users] Async JS functions?

 

Hi,

I have a small JS script that calls a phonenumber, when the call is
answered it plays a wave file, then it calls a second phonenumber and
bridges the calls. Is it possible to make wave-playing async, so that
the second call is generated as soon as the first is picked up? Right
now the wave file takes about 2 secs to play, but I need to extend that
time, and I don't want to delay the second call.

Thanks!

Nicolas

___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Distortion on approx first 200ms of G722prompts on DECT based CPE

2009-07-28 Thread Keith Laaks
Hi, [Thanks for the advice Anthony]

 

I tried send_silence_when_idle=true  and restarted, but did not notice
any change/improvement. 

But I had limited time to test, so will need to test more thoroughly
with this CPE. 

 

An additional test was to configure the following media path scenarios:

A: Policom-FS-DECT CPE

B: Policom-DECT CPE (media not via FS)

[The only change was to add param name=inbound-bypass-media
value=true in sip profile for B/)

 

In scenario A, whenever the Policom's VAD kicked in, it resulted in the
first 200ms of the restarting audio being distorted in the DECT CPE.

In scenario B, no problems when the Policom's VAD kicked in.

 

I also addressed the issue to the CPE vendor yesterday, who responded
today :

We have observed the RTP-stream and found the following :

 

- the RTP-stream is completely interrupted in the pause between the
announcements

- no RTP-packets are send at all during these pauses 

- jitter buffer runs empty and our device will automatically mute the
connection when no packets comes in 

- last RTP-packets before pauses don't contain the info about
comfort-noise 

We would like to ask you the following : 

- please check if it's possible to send dummy-packets during pause
instead of sending no packets at all



 

In scanning the wiki on the topic of CNG, I found at
http://wiki.freeswitch.org/wiki/VAD_and_CNG :

In FreeSWITCH the CNG options select whether or not FreeSWITCH will
generate CN RTP packets. suppress-cng sofia profile option and
suppress_cng channel variable used to set of this setting. When both
sides are supporting RFC3389 (they agree in SDP message exchange,
rtpmap:13), FreeSWITCH will send CN packets. Note: Allowing CNG in
FreeSWITCH does not mean it will generate any comfort noise into the
media channel. 

 

In case one of the parties in bridge do not handle VAD and asynchronous
RTP media, there should be an issue as the one might think hearing
perfect silence and might think the connection has been dropped. Another
example is when on one side is Asterisk or CallWeaver.

For handling these endpoints, there has been added (r9543) a new channel
variable: bridge_generate_comfort_noise which will generate fake audio

 

So the options here seem to be :

a)  Get FS to send CNG packet(s) before going into 'pauses'. From
the vendor's analysis they are not seeing this when testing (FYI, these
observations were made calling into vmail). Could this be because the
CPE is perhaps not supporting RFC3389 - FS did not see the rtpmap:13 in
the SDP ?

b)  Make sure FS keeps sending packets during pauses and silence. I
am not clear on the difference between the 'send_silence_when_idle=true'
and 'bridge_generate_comfort_noise=true' options. 

 

Ideally I would still want to leverage VAD, but then need the CNG
messages to be forwarded in scenarios where I have media passing through
FS on a call between two customers and when a customer is interacting
with vmail (or other IVR type application).

 

Any advise appreciated.

 

Best Regards

 

Keith

 

 

From: freeswitch-users-boun...@lists.freeswitch.org
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of
Anthony Minessale
Sent: 28 July 2009 02:06
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Distortion on approx first 200ms of
G722prompts on DECT based CPE

 

you can set the global var send_silence_when_idle=true in vars.xml



On Mon, Jul 27, 2009 at 4:23 PM, Keith Laaks wrote:

Hi All,

 

I am testing a range of G722 capable DECT based CPE.

With one range, I have noticed that the first 200ms or so of each
separate prompt file being played back is played out distorted from the
DECT handset.

When having a normal conversation, the quality is excellent, but when
accessing your vmail, all the individual audio files making up the menu
choices exhibit the distortion, which is pretty annoying.

The same unit using G729, alaw or ulaw works 100%.

 

I wonder if anybody else has uncounted this issue?

 

My guess at this point -

There may be a short break in the RTP between the separate files being
played out by FS that makes up any menu. 

During this time the DECT handset's AGC probably goes to MAX
amplification (as its not receiving any input during the short break in
RTP).

Then, when the RTP returns at the start of the next file, the AGC boosts
the audio into clipping zone and takes 200ms to dampen down back to
normal good levels.

 

Looks like in these devices the G722 encode/decode is actually done in
the DECT handset and not the voip-base unit.

 

Is there any parameter that can be set in FS to ensure that the RTP
keeps flowing, sending 'silence' between prompts ? Would be interesting
to validate the above 'guess'.

 

 

Best Regards

 

Keith

 


___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http

[Freeswitch-users] Distortion on approx first 200ms of G722 prompts on DECT based CPE

2009-07-27 Thread Keith Laaks
Hi All,

 

I am testing a range of G722 capable DECT based CPE.

With one range, I have noticed that the first 200ms or so of each
separate prompt file being played back is played out distorted from the
DECT handset.

When having a normal conversation, the quality is excellent, but when
accessing your vmail, all the individual audio files making up the menu
choices exhibit the distortion, which is pretty annoying.

The same unit using G729, alaw or ulaw works 100%.

 

I wonder if anybody else has uncounted this issue?

 

My guess at this point -

There may be a short break in the RTP between the separate files being
played out by FS that makes up any menu. 

During this time the DECT handset's AGC probably goes to MAX
amplification (as its not receiving any input during the short break in
RTP).

Then, when the RTP returns at the start of the next file, the AGC boosts
the audio into clipping zone and takes 200ms to dampen down back to
normal good levels.

 

Looks like in these devices the G722 encode/decode is actually done in
the DECT handset and not the voip-base unit.

 

Is there any parameter that can be set in FS to ensure that the RTP
keeps flowing, sending 'silence' between prompts ? Would be interesting
to validate the above 'guess'.

 

 

Best Regards

 

Keith

 

___
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Freeswitch taking too long to start up

2009-06-02 Thread Keith Laaks
Hi,

 

Try starting using the -nonat  switch.  

 

Best Regards

 

Keith 



 

From: Muhammad Shahzad [mailto:shaherya...@googlemail.com] 
Sent: 02 June 2009 14:39
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Freeswitch taking too long to start up

 

Yes, this resolves the problem.

Thank you.



On Tue, Jun 2, 2009 at 5:27 PM, dujinfang dujinf...@gmail.com wrote:

Actually Brain mentioned that you can comment out switch_nat_init(); in 
switch_core.c

 

On Jun 2, 2009, at 7:08 PM, Nik Middleton wrote:

As I understand it, a new ‘feature’ was added over the weekend to 
resolve NAT.  If you’re firewall is not allowing ICMP then FS waits until it 
times out.  At this time there is no option to disable it.

 

Regards

 

 





From: freeswitch-users-boun...@lists.freeswitch.org 
[mailto:freeswitch-users-boun...@lists.freeswitch.org] On Behalf Of Muhammad 
Shahzad
Sent: 02 June 2009 11:40
To: freeswitch-users@lists.freeswitch.org
Subject: [Freeswitch-users] Freeswitch taking too long to start up

 

Hi,

I have just upgraded Freeswitch from svn revision 12432 to 13544. I am 
using 32bit CentOS 5.3, make current command completes successfully without 
any errors but when i start freeswitch it take considerable time (roughly 90 - 
120 seconds) to start up. During this time no message is display on console. 
Once successfully started, it works fine. However, this initial delay is really 
annoying. Is there anyway to reduce/remove this delay?

Thank you.


-- 
Muhammad Shahzad
---
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +92 334 422 40 88
MSN: shari_78...@hotmail.com
Email: shaherya...@googlemail.com

___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

 


___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




-- 
Muhammad Shahzad
---
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +92 334 422 40 88
MSN: shari_78...@hotmail.com
Email: shaherya...@googlemail.com

___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Re: [Freeswitch-users] Javascript, Hanguphooks, CDRs and User Variables.

2009-03-31 Thread Keith Laaks
Hi,

 

Here is what I am trying to accomplish:

 

//--- completecall.js trigged via api_hangup_hook 

 

use(CURL);

 

const loglevel='notice';

var uuid = request.getHeader(Core-UUID);

var billmsec = request.getHeader(billmsec);

var urlrequest = UUID= + uuid + billmsec= + billmsec;

 

function reply_callback(string, arg) {

  string = string.substring(string.search(API)+3);

  string = string.substring(0,string.search());

  var splits = string.split(~);

  var i = 0;

  var length = splits.length;

  for (i=0; i  length; i++) {

var fv=splits[i].split(=);

console_log(loglevel, setting:  + fv[0] +  =  + fv[1] + \n);

//session.setVariable(fv[0],fv[1]); // Cant use set here as the
session is dead by now - the call has been terminated

  }

  return true;

}

 

var curl = new CURL();

console_log(loglevel,-- completecall.js - + url + ? + urlrequest +
\n);

 

var env = request.dumpENV(text);  // debug

console_log(ENV:\n, env + \n); // debug

 

curl.run(POST, http://127.0.0.1:10502/rate;, urlrequest,
reply_callback, CBrate\n);

//returns string like sometagAPIcharge=10.20/sometag

 

exit();

 

 

So the trick is that I am accessing an external system via CURL where
the call rate is calculated and returned (based on the call duration and
uuid). 

Now I need to use a 'setVariable' to get it back as one of the
parameters that the cdr module can write out for me.

Note that in the above, the external system will return 'charge=value'. 

I need to set the variable 'charge' to the value in 'value'.

Then using the config below, 'charge' can be written out as one of the
cdr fields.

 

 

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=def/

!-- This is like the info app but after the call is hung up --

param name=debug value=true/

param name=rotate-on-hup value=true/

!-- may be a b or ab --

param name=legs value=a/

  /settings

  templates

 template
name=def${accountcode},${billsec},${charge},${sip_req_user},
${hangup_cause},${uuid},${bleg_uuid}/template

  /templates

/configuration

 

 

 

Best Regards

 

Keith

 

 

From: Anthony Minessale [mailto:anthony.miness...@gmail.com] 
Sent: 31 March 2009 00:13
To: freeswitch-users@lists.freeswitch.org
Subject: Re: [Freeswitch-users] Javascript, Hanguphooks,CDRs and User
Variables.

 

in your script called via api_hangup_hook:

var env = request.dumpENV(text);

consoleLog(info, env);

all those vars are there for you, you can get the individually with 
var hval = request.getHeader(some_header);



2009/3/30 Keith Laaks kei...@voxtelecom.co.za

Hi,

 

I have an application where my Javascript hanguphook code calculates a
value (e.g. the cost of the call which can only be calculated post
hangup) and I need to have that value appear as a field in the cdrs.

 

As the 'session' object is no longer available for javascript logic post
hangup, I can't figure out how to 'set' a user variable post hangup,
such that it can be written to the cdr when the state changes from
CS_HANGUP - CS_REPORTING.  Maybe it's just not possible..? It would
be a pity to have to resort to writing out cdrs from the javascript
itself and duplicating what fs does so well already.

 

Any advice / suggestions would be appreciated.

 

Best Regards

 

Keith

 


___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_miness...@hotmail.com
mailto:msn%3aanthony_miness...@hotmail.com 
GTALK/JABBER/PAYPAL:anthony.miness...@gmail.com
mailto:paypal%3aanthony.miness...@gmail.com 
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:8...@conference.freeswitch.org
mailto:sip%3a...@conference.freeswitch.org 
iax:gu...@conference.freeswitch.org/888
googletalk:conf+...@conference.freeswitch.org
mailto:googletalk%3aconf%2b...@conference.freeswitch.org 
pstn:213-799-1400

___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


[Freeswitch-users] Javascript, Hanguphooks, CDRs and User Variables.

2009-03-30 Thread Keith Laaks
Hi,

 

I have an application where my Javascript hanguphook code calculates a
value (e.g. the cost of the call which can only be calculated post
hangup) and I need to have that value appear as a field in the cdrs.

 

As the 'session' object is no longer available for javascript logic post
hangup, I can't figure out how to 'set' a user variable post hangup,
such that it can be written to the cdr when the state changes from
CS_HANGUP - CS_REPORTING.  Maybe it's just not possible..? It would
be a pity to have to resort to writing out cdrs from the javascript
itself and duplicating what fs does so well already.

 

Any advice / suggestions would be appreciated.

 

Best Regards

 

Keith

 

___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


[Freeswitch-users] Module Mod Native File - How to handle multiple rates under the same codec.

2009-03-16 Thread Keith Laaks
Hi,

 

To minimize/eliminate transcoding, I am using mod native file, with a
set of transcoded prompts with the appropriate set of file extensions. 

Everything works as advertised when using the traditional codecs such as
pcma, g729, gsm.

 

But speex support is a bit of a challenge. 

 

Freeswitch supports: sp...@8000h@20i,  sp...@16000h@20i,
sp...@32000h@20i.

 

When I setup calls using these various codec flavors, I can see using
info (and of course detect by ear) that indeed the call is running at
the different 'rates'.

I see that regardless of which one I use, the variable_read_codec and
variable_write_codec remains SPEEX, but depending on the flavor, a
variable_read_rate and variable_write_rate of either 8000,16000 or
32000.

 

But when I try play a file when in 16000 or 32000, I get:

 

2009-03-15 16:31:13 [INFO] mod_native_file.c:81 native_file_file_open()
Opening File
[/usr/local/freeswitch/sounds/en/us/callie/all/16000/SUCCESS.SPEEX]
8000hz

2009-03-15 16:31:13 [WARNING] switch_core_file.c:119
switch_core_perform_file_open() Sample rate doesn't match.

 

I created my SPEEX files using: speexenc -w  infilename outfilename
(note the -w option for 16kHz wideband)

 

So, even though the call is setup using a wideband 16kHz codec, it
appears that mod native file is expecting a 8kHz file for all the SPEEX
flavors.

 

What am I missing here? Is this module limited to 8KHz rates?  I am on
1.0.trunk (12530M).

 

I have not yet looked at these codecs:  g7...@16000h,  g7...@32000h,
c...@32000h,  c...@48000h, but as these also have multiple rates for the
same codec - I expect same issue.

 

I am using ${ variable_read_rate } in the filename path, so fs looks at
a set of files encoded with a matching sample rate.

 

But looks like it's always looking for a 8KHz file.

 

If you have had any experience with this, please let me have your
advice.

 

Thanks

Keith

 

 

___
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org