Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Possible problem in adding channel variab

Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
jbr at consiglia.dk
Guest





PostPosted: Fri Sep 19, 2008 8:10 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

I have tested the option of adding channel variables to the bridge
string, and it does not work.
This dialplan works:
<extension name="External calls">
<condition field="destination_number" expression="^(\d{8})$">
<action application="set" data="effective_caller_id_number=45161061"/>
<action application="bridge" data="sofia/gateway/45161061/$1"/>
</condition>
</extension>

While this one does not work, it is rejected by the gateway:
<extension name="External calls">
<condition field="destination_number" expression="^(\d{8})$">
<action application="bridge"
data="[effective_caller_id_number=45161061]sofia/gateway/45161061/$1"/>
</condition>
</extension>
The INVITE Remote-Party-ID header differs. In the firs case it is:
"Extension 1000"
<sip:45161061@jbconsulting.v2tel.dk>;screen=yes;privacy=off
And in the second case it is:
"Extension 1000" <sip:1000@jbconsulting.v2tel.dk>;screen=yes;privacy=off

Is this an error on my behalf, or do we have a bug?


_______________________________________________
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
Back to top
mike at jerris.com
Guest





PostPosted: Fri Sep 19, 2008 8:22 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

On Sep 19, 2008, at 9:07 AM, Jon Bruel wrote:

Quote:
I have tested the option of adding channel variables to the bridge
string, and it does not work.
This dialplan works:
<extension name="External calls">
<condition field="destination_number" expression="^(\d{8})$">
<action application="set" data="effective_caller_id_number=45161061"/>
<action application="bridge" data="sofia/gateway/45161061/$1"/>
</condition>
</extension>

While this one does not work, it is rejected by the gateway:
<extension name="External calls">
<condition field="destination_number" expression="^(\d{8})$">
<action application="bridge"
data="[effective_caller_id_number=45161061]sofia/gateway/
45161061/$1"/>
</condition>
</extension>
The INVITE Remote-Party-ID header differs. In the firs case it is:
"Extension 1000"
<sip:45161061@jbconsulting.v2tel.dk>;screen=yes;privacy=off
And in the second case it is:
"Extension 1000" <sip:
1000@jbconsulting.v2tel.dk>;screen=yes;privacy=off

Is this an error on my behalf, or do we have a bug?

effective_caller_id_number is meant to be set on the a leg, not the b
leg.

Mike

_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 8:44 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Also if the far side is Asterisk and they don't have trustrpid=yes
then you have to set the param on the gatway:

<param name="caller-id-in-from" value="true"/>

/b

On Sep 19, 2008, at 8:20 AM, Michael Jerris wrote:

Quote:
effective_caller_id_number is meant to be set on the a leg, not the b
leg.

Mike


_______________________________________________
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
Back to top
jbr at consiglia.dk
Guest





PostPosted: Fri Sep 19, 2008 9:04 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Mike, you answered: effective_caller_id_number is meant to be set on the
a leg, not the b-leg.
Well I need to control the "effective_caller_id_number" (or whatever it
is called in the B-leg) individually for each location when I bridge to
many destinations. In my case, I need to have different identities
(A-numbers) for local calls and for external calls. I have followed the
WIKI:
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall#Calling_
multiple_destinations, though. Anyhow how is this solved? Could it be
possible to loopback to the dialplan as in Asterisk local channel or to
go through some steps before dial attemps are made, but after the bridge
application?
Jon



------------------------------

Message: 4
Date: Fri, 19 Sep 2008 09:22:51 -0400
From: Michael Jerris <mike@jerris.com>
Subject: Re: [Freeswitch-users] dialpaln
To: freeswitch-users@lists.freeswitch.org
Message-ID: <B017FCD2-1BF2-4EA3-83AA-786BC26BE141@jerris.com>
Content-Type: text/plain; charset="us-ascii"


On Sep 19, 2008, at 9:18 AM, Gopal krishnan wrote:

Quote:
Hi,

Since I am not able to make the outbound call, when I use this
command <oz dump 1 a> in the console, I used to get the all the 31
channels , for a refrence I am posing one channel block here,

span_id: 1
chan_id: 31
physical_span_id: 1
physical_chan_id: 31
type: B
state: DOWN
last_state: DOWN
cid_date:
cid_name:
cid_num:
ani:
aniII:
dnis:
rdnis:
cause: NONE

In this I am seeing that the state seems to be DOWN, but when I try
wantouer status, it show as connected like ,



in openzap, state down is like on-hook... we should change that name
maybe.


Quote:
Wanrouter Status:

Device name | Protocol | Station | Status |
wanpipe1 | AFT HDLC | N/A | Connected |
wanpipe2 | AFT HDLC | N/A | Connecting |

where I am using is Sangoma A102D card with hardware echo
cancellation. And when I try to dial from the softphone in the
console I get this as,

freeswitch@dialer.optimus.co.in> 2008-09-19 18:38:58 [NOTICE]
switch_channel.c:538 switch_channel_set_name() New Channel
sofia/internal/1002@172.20.176.31
Quote:
[a75028c4-554a-473e-a8cc-8c52d7f72df4]
2008-09-19 18:38:58 [INFO] mod_dialplan_xml.c:232 dialplan_hunt()
Processing FreeSwitch->99841799874 in context default
2008-09-19 18:38:58 [NOTICE] switch_channel.c:538
switch_channel_set_name() New Channel OpenZAP/1:1/9841799874
[bd977e0d-e078-4193-a005-d751bdb26db8]
2008-09-19 18:39:28 [NOTICE] sofia.c:2705 sofia_handle_sip_i_state()
Hangup sofia/internal/1002@172.20.176.31 [CS_EXECUTE]
[ORIGINATOR_CANCEL]
2008-09-19 18:39:28 [NOTICE] switch_ivr_originate.c:1321
switch_ivr_originate() Hangup OpenZAP/1:1/9841799874
[CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL]
2008-09-19 18:39:28 [INFO] mod_dptools.c:1814
audio_bridge_function() Originate Failed. Cause: ORIGINATOR_CANCEL
2008-09-19 18:39:28 [NOTICE] switch_core_session.c:812
switch_core_session_thread() Session 1
(sofia/internal/1002@172.20.176.31
Quote:
) Ended
2008-09-19 18:39:28 [NOTICE] switch_core_session.c:814
switch_core_session_thread() Close Channel
sofia/internal/1002@172.20.176.31
Quote:
[CS_HANGUP]
2008-09-19 18:39:28 [NOTICE] switch_core_session.c:812
switch_core_session_thread() Session 2 (OpenZAP/1:1/9841799874) Ended
2008-09-19 18:39:28 [NOTICE] switch_core_session.c:814
switch_core_session_thread() Close Channel OpenZAP/1:1/9841799874
[CS_HANGUP]

So where i am wrong, can you please correct me.



It looks like the hang-up is coming from the sip side of things, can
you take a look at the sip trace and confirm there is really a cancel
on sip.

Mike

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080
919/59c1da81/attachment-0001.html

------------------------------

Message: 5
Date: Fri, 19 Sep 2008 18:53:27 +0530
From: "Gopal krishnan" <saigop@gmail.com>
Subject: Re: [Freeswitch-users] Asiterisk Dialplan for Freeswitch
To: freeswitch-users@lists.freeswitch.org
Message-ID:
<2ea4d47e0809190623p512999feg2d2de4a9b630afce@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

Basically I just want to test outbound alone with freeswitch, so I can
use
extensions.conf in the conf directory rite?
--
Thank you with regards,
Gopal,
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080
919/7951fd9a/attachment-0001.html

------------------------------

Message: 6
Date: Fri, 19 Sep 2008 19:04:43 +0530
From: "Gopal krishnan" <saigop@gmail.com>
Subject: Re: [Freeswitch-users] dialpaln
To: freeswitch-users@lists.freeswitch.org
Message-ID:
<2ea4d47e0809190634r2fd83e08r934813ef21ba8517@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi Mike,

I changed the name in openzap.conf and also in default.xml, but the
same
thing persisting, this hangup I terminated from the softphone, its not
like
coming from the sip phone automatically. so Is there anything else I
need to
check?
--
Thank you with regards,
Gopal,
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080
919/f1ab278c/attachment-0001.html

------------------------------

Message: 7
Date: Fri, 19 Sep 2008 09:35:51 -0400
From: "Richard Open Source" <oss.richard@gmail.com>
Subject: Re: [Freeswitch-users] Asynchronous communication with
FreeSWITCH's mod_event_socket
To: freeswitch-users@lists.freeswitch.org
Message-ID:
<db80c4090809190635l155d4125tc514dd7b8448ecae@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I agree.

I have started working on a library like asterisk-java (now onhold but
hopefully can continue working on it in a couple of weeks) using groovy
(will name it fs-groovy Smile)

The way I check if the command was successful is to look for the Event
with
CHANNEL_EXECUTE_COMPLETE and Application and ApplicationData.

Here is how I implemented it. Still needs more work though.
--

2<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L2>
3<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L3>
import
org.apache.mina.common.IoSession
4<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L4>
import
java.util.concurrent.BlockingQueue
5<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L5>
import
java.util.concurrent.Executors
6<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L6>
import
java.util.concurrent.ExecutorService
7<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L7>
import
java.util.concurrent.Future
8<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L8>
import
java.util.concurrent.Callable
9<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protus
/freeswitch/Session.groovy?rev=241#L9>
import
java.util.concurrent.ExecutionException
10<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L10>
import
java.util.concurrent.TimeoutException
11<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L11>
import
java.util.concurrent.TimeUnit
12<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L12>
13<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L13>
14<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L14>
15<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L15>
class
Session {
16<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L16>
private IoSession session
17<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L17>
private FSEventHandler handler
18<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L18>
private BlockingQueue<String> msgQ
19<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L19>
private final ExecutorService executor =
Executors.newSingleThreadExecutor()
20<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L20>
private final static long DEFAULT_TIMEOUT = 5000
21<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L21>

22<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L22>
def data
23<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L23>

24<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L24>
def Session(IoSession s, BlockingQueue q) {
25<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L25>
session = s
26<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L26>
msgQ = q
27<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L27>
}
28<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L28>
29<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L29>
private def executeAndWait(Closure task, long timeout=0) {
30<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L30>
Future <CommandResult> f = executor.submit(task as Callable)
31<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L31>
def result
32<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L32>
def boolean success = false
33<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L33>
try {
34<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L34>
if (timeout != 0) {
35<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L35>
result = f.get(timeout,
TimeUnit.MILLISECONDS)
36<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L36>
} else {
37<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L37>
result = f.get()
38<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L38>
}
39<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L39>
if (result.code == CommandResult.OK) data =
result.data
40<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L40>
} catch (ExecutionException e) {
41<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L41>
// Should log here
42<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L42>
} catch (TimeoutException e) {
43<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L43>
f.cancel(true)
44<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L44>
}
45<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L45>

46<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L46>
return result
47<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L47>
}
48<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L48>

49<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L49>
def answer() {
50<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L50>
def task = {
51<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L51>
def done = false
52<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L52>
def r = new CommandResult()
53<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L53>
sendMessage("answer")
54<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L54>
while (! done) {
55<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L55>
def m = msgQ.take()
56<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L56>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE") && (m?.Application == "answer")) {
57<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L57>
done = true
58<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L58>
r.code = CommandResult.OK
59<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L59>
r.data = m
60<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L60>
}
61<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L61>
}
62<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L62>
return r
63<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L63>
}
64<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L64>
executeAndWait(task, DEFAULT_TIMEOUT)
65<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L65>
}
66<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L66>

67<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L67>
def unset(var) {
68<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L68>
def task = {
69<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L69>
def done = false
70<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L70>
def r = new CommandResult()
71<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L71>
sendMessage("unset", var)
72<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L72>
while (! done) {
73<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L73>
def m = msgQ.take()
74<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L74>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
75<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L75>
&& (m?.Application
==
"unset")
76<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L76>
&&
(m?.ApplicationData
== var)) {
77<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L77>
done = true
78<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L78>
r.code =
CommandResult.OK
79<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L79>
r.data = m
80<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L80>
}

81<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L81>
}
82<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L82>
return r
83<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L83>
}
84<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L84>
executeAndWait(task, DEFAULT_TIMEOUT)
85<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L85>
}
86<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L86>

87<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L87>
def queueDtmf(dtmfs) {
88<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L88>
def task = {
89<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L89>
def done = false
90<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L90>
def r = new CommandResult()
91<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L91>
sendMessage("queue_dtmf", dtmfs)
92<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L92>
while (! done) {
93<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L93>
def m = msgQ.take()
94<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L94>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
95<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L95>
&& (m?.Application
==
"queue_dtmf")
96<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L96>
&&
(m?.ApplicationData
== dtmfs)) {
97<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L97>
done = true
98<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L98>
r.code =
CommandResult.OK
99<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/protu
s/freeswitch/Session.groovy?rev=241#L99>
r.data = m
100<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L100>
}

101<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L101>
}
102<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L102>
return r
103<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L103>
}
104<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L104>
executeAndWait(task, DEFAULT_TIMEOUT)
105<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L105>
}
106<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L106>

107<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L107>
/*
108<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L108>
def hangup() {
109<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L109>
def task = {
110<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L110>
def done = false
111<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L111>
def r = new CommandResult()
112<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L112>
sendMessage("hangup")
113<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L113>
while (! done) {
114<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L114>
def m = msgQ.take()
115<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L115>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
116<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L116>
&& (m?.Application
==
"queue_dtmf")
117<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L117>
&&
(m?.ApplicationData
== dtmfs)) {
118<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L118>
done = true
119<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L119>
r.code =
CommandResult.OK
120<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L120>
r.data = m
121<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L121>
}

122<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L122>
}
123<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L123>
return r
124<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L124>
}
125<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L125>
executeAndWait(task, DEFAULT_TIMEOUT)
126<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L126>
}
127<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L127>
*/

128<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L128>
129<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L129>
def setVariable(String var, String value) {
130<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L130>
def task = {
131<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L131>
def done = false
132<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L132>
def r = new CommandResult()
133<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L133>
sendMessage("set", "${var}=${value}")
134<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L134>
while (! done) {
135<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L135>
def m = msgQ.take()
136<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L136>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
137<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L137>
&& (m?.Application
==
"set")
138<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L138>
&&
(m?.ApplicationData
== "${var}=${value}")) {
139<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L139>
done = true
140<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L140>
r.code =
CommandResult.OK
141<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L141>
r.data = m
142<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L142>
}

143<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L143>
}
144<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L144>
return r
145<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L145>
}
146<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L146>
executeAndWait(task, DEFAULT_TIMEOUT)
147<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L147>

148<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L148>
}
149<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L149>

150<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L150>
def export(String var) {
151<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L151>
set("export_vars", var)
152<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L152>
}
153<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L153>

154<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L154>
def bridge(String number) {
155<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L155>
def task = {
156<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L156>
def done = false
157<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L157>
def r = new CommandResult()
158<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L158>
sendMessage("bridge", number)
159<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L159>
while (! done) {
160<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L160>
def m = msgQ.take()
161<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L161>
//
println m
162<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L162>
if (((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
163<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L163>
&& (m?.Application
==
"bridge")
164<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L164>
&&
(m?.ApplicationData
== number)) ||
165<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L165>
((m?.event?.Name
==
"CHANNEL_UNBRIDGE")
166<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L166>
&&
(m?.variable.bridge_channel == number)) || (m?.SESSIONCLOSED == "true"))
{
167<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L167>
done = true
168<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L168>
r.code =
CommandResult.OK
169<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L169>
r.data = m
170<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L170>
}

171<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L171>
}
172<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L172>
return r
173<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L173>
}
174<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L174>
executeAndWait(task)
175<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L175>
}
176<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L176>

177<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L177>
def promptForDigits(int min, int max, String soundFile, String
variableName, long timeout, String terminator) {
178<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L178>
def task = {
179<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L179>
def done = false
180<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L180>
def r = new CommandResult()
181<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L181>
def appData = "${min} ${max} ${soundFile}
${variableName} ${timeout} ${terminator}"
182<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L182>
sendMessage("read", appData, true)
183<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L183>
while (! done) {
184<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L184>
def m = msgQ.take()
185<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L185>
if ((m?.event?.Name ==
"CHANNEL_EXECUTE_COMPLETE")
186<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L186>
&& (m?.Application
==
"read")
187<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L187>
&&
(m?.ApplicationData
== appData)) {
188<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L188>
done = true
189<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L189>
r.code =
CommandResult.OK
190<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L190>
r.data = m
191<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L191>
}

192<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L192>
}
193<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L193>
return r
194<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L194>
}
195<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L195>
executeAndWait(task, timeout)
196<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L196>
}
197<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L197>

198<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L198>
def originate(String url) {
199<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L199>
sendMessage("originate", url, true)
200<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L200>
}
201<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L201>

202<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L202>
def sleep(int sec) {
203<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L203>
sendMessage("sleep", new Integer(sec*1000).toString())
204<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L204>
}
205<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L205>

206<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L206>
def say(String phrase) {
207<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L207>
sendMessage("phrase", "spell,$phrase")
208<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L208>
}
209<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L209>

210<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L210>
def script() {
211<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L211>
return "jeprox"
212<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L212>
}
213<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L213>

214<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L214>
private def sendMessage(String app, String arg=null, boolean
event_lock=false) {
215<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L215>
String msg = "sendmsg\ncall-command:
execute\nexecute-app-name: ${app}"
216<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L216>
if (arg) {
217<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L217>
msg += "\nexecute-app-arg: ${arg}"
218<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L218>
}
219<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L219>
if (event_lock) {
220<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L220>
msg += "\nevent-lock: ${event_lock}"
221<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L221>
}
222<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L222>
System.out.println(msg)
223<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L223>
session.write("$msg\n\n")
224<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L224>
}
225<http://trac.protus.org/trac/browser/myfreeswitch/src/groovy/org/prot
us/freeswitch/Session.groovy?rev=241#L225>
}
On Thu, Sep 18, 2008 at 5:49 PM, Luke Graybill <killarny@gmail.com>
wrote:

Quote:
I've been doing a lot of work recently with FreeSWITCH's
mod_event_socket,
Quote:
and I wanted to comment a bit about the syntax used for commands
through the
Quote:
socket while using asynchronous mode. I haven't tried the synchronous
mode
Quote:
yet, as I always want to be free to be able to execute commands
without
Quote:
waiting for other commands to finish. For instance, I need to be able
to
Quote:
collect DTMF events while I'm playing a sound file, so that the user
can do
Quote:
things like select menu items without listening to the entire menu
first.
Quote:

Asterisk's AMI protocol allows you to specify an ActionID along with
every
Quote:
command that you send. Asterisk then includes this ActionID with every
event
Quote:
that is related to that command, making it cake to coordinate an
asynchronous client.

However, even in async mode, FreeSWITCH's mod_event_socket doesn't
communicate any identifying information for command responses, or for
events
Quote:
triggered by a previous command, unless one uses the bgapi command
set. This
Quote:
command set is not applicable to every situation, though. It only
applies to
Quote:
commands which manipulate the call; if one needs to manipulate the
channel,
Quote:
then messages must be used through the sendmsg command set, which
doesn't
Quote:
provide any specific identifying information.

Now, to complicate things, with all commands (even bgapi) the protocol
works something like this: you send a command, and wait for a response
from
Quote:
mod_event_socket. This response is assumed to be immediate before
anything
Quote:
else the client might receive from mod_event_socket, and in the case
of
Quote:
bgapi, this response will contain a job-id to use for comparing
job-related
Quote:
events later.

For example, for the following command:

sendmsg
call-command: execute
execute-app-name: answer\n\n

The response is this:

Content-Type: command/reply
Reply-Text: +OK

That response is generic to nearly every single command sent, and is
only
Quote:
really saying "The last transmission was a valid command, and didn't
immediately fail". The command may actually fail later, and command
specific
Quote:
feedback is generally contained in later events (which have no unique
identifying information).

My issue here is that this seems to be forcing an asynchronous client
to
Quote:
rely upon a synchronous ordering of response directly following
command,
Quote:
thus violating the very concepts of an asynchronous protocol in which
there
Quote:
should be no assumed order. Not only that, but this method increases
the
Quote:
complexity of a client, which must be aware of limitations that
wouldn't
Quote:
ordinarily be required by a true asynchronous protocol. An
asynchronous
Quote:
client should be unconcerned with listening for a synchronous response
to
Quote:
every command.

My suggested solution is to apply the job-id concept from bgapi to
messages
Quote:
as well, and to go a step further; borrow the Asterisk idea of
transmitting
Quote:
an identifier along with each command. Every response and event
related to
Quote:
that command should then contain the very same identifier in the
header.
Quote:

_______________________________________________
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
Quote:
http://www.freeswitch.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080
919/cd821a4d/attachment.html

------------------------------

_______________________________________________
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


End of Freeswitch-users Digest, Vol 27, Issue 132
*************************************************


_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 9:16 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

The effective_caller_id_name/number variables can be set on the A leg but those will be used to override those values on the b-legs if they spawn off the a-leg

/b

On Sep 19, 2008, at 9:02 AM, Jon Bruel wrote:
Quote:

Mike, you answered: effective_caller_id_number is meant to be set on the
a leg, not the b-leg.
Well I need to control the "effective_caller_id_number" (or whatever it
is called in the B-leg) individually for each location when I bridge to
many destinations. In my case, I need to have different identities
(A-numbers) for local calls and for external calls. I have followed the
WIKI:
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall#Calling_
multiple_destinations, though. Anyhow how is this solved? Could it be
possible to loopback to the dialplan as in Asterisk local channel or to
go through some steps before dial attemps are made, but after the bridge
application?
Jon
Back to top
anthony.minessale at g...
Guest





PostPosted: Fri Sep 19, 2008 9:25 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

On Fri, Sep 19, 2008 at 9:02 AM, Jon Bruel <jbr@consiglia.dk (jbr@consiglia.dk)> wrote:
Quote:

Mike, you answered: effective_caller_id_number is meant to be set on the
a leg, not the b-leg.
Well I need to control the "effective_caller_id_number" (or whatever it
is called in the B-leg) individually for each location when I bridge to
many destinations. In my case, I need to have different identities
(A-numbers) for local calls and for external calls. I have followed the
WIKI:
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridgecall#Calling_
multiple_destinations, though. Anyhow how is this solved? Could it be
possible to loopback to the dialplan as in Asterisk local channel or to
go through some steps before dial attemps are made, but after the bridge
application?
Jon




vars inside {} in the very beginning of the string are global to each dial string listed henceforth
vars inside [] prior to each channel in a , or | separated list are unique to just the first subsequent dial string.

data="[origination_caller_id_number=1234]sofia/default/test1@foo.com (test1@foo.com),[origination_caller_id_number=4321]sofia/default/test2@foo.com (test2@foo.com)"
Back to top
jbr at consiglia.dk
Guest





PostPosted: Fri Sep 19, 2008 10:59 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

None of the suggestions worked, and I still can't control the A-number
individually when bridging to multiple destinations.
I have tried to change the dialplan using
[origination_caller_id_number=1234]
As a part of the string in the bridge data, but an info after bridge did
not show the variable. I also tried with an unknown variable such as
new_var=1234, but it did not show up after the bridge using the info
application. Do we have a bug, or has the format been changed..




_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 11:11 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Is the far side Asterisk? If so then I suspect they aren't trusting
the RPID you're sending. They'll have to trustrpid.

/b

On Sep 19, 2008, at 10:56 AM, Jon Bruel wrote:

Quote:
None of the suggestions worked, and I still can't control the A-number
individually when bridging to multiple destinations.
I have tried to change the dialplan using
[origination_caller_id_number=1234]
As a part of the string in the bridge data, but an info after bridge
did
not show the variable. I also tried with an unknown variable such as
new_var=1234, but it did not show up after the bridge using the info
application. Do we have a bug, or has the format been changed..


_______________________________________________
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
Back to top
jbr at consiglia.dk
Guest





PostPosted: Fri Sep 19, 2008 12:39 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

No the far side is BroadWorks, and as I said in the first mail, the only
difference between an accepted and a rejected INVITE is in the contents
of the Remote-Party-ID header. Generally in many European countries, the
operators limit the A-number to the actual number of the line dialled
out on.




_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 12:50 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Can you show me a side by side comparison of working vs non-working?

/b

On Sep 19, 2008, at 12:37 PM, Jon Bruel wrote:

Quote:
No the far side is BroadWorks, and as I said in the first mail, the
only
difference between an accepted and a rejected INVITE is in the
contents
of the Remote-Party-ID header. Generally in many European countries,
the
operators limit the A-number to the actual number of the line dialled
out on.


_______________________________________________
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
Back to top
jbr at consiglia.dk
Guest





PostPosted: Fri Sep 19, 2008 4:47 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Yes I can, but somehow I start to repeat myself. An INVITE is sent
allright every time, but one of the headers differs:
Works:
Remote-Party-ID:
<sip:45161061@jbconsulting.v2tel.dk>;screen=yes;privacy=off
Doesn't work:
Remote-Party-ID: "Extension 1000"
<sip:1000@jbconsulting.v2tel.dk>;screen=yes;privacy=off
I have tried with different variable names in the bridge data:
<action application="bridge"
data="[effective_caller_id_number=45161061]sofia/gateway/45161061/$1"/>
as well as: origination_caller_id_number
data="[origination_caller_id_number=45161061]sofia/gateway/45161061/$1"/
the latter combined with: <param name="caller-id-in-from"
value="true"/>.
But the only thing which works is setting the effective_caller_id_number
in the dialplan before the bridge. That would be fine, unless I want to
bridge to several destinations. Every time the call is rejected, the
Remote-Party-ID-header hasn't the right value.
I have tried to execute another dialplan at bridge, testing with other
variables, and the info application doesn't reveal the variable I try to
include in square brackets in the bridge data string. So maybe its not
passed over to the B-leg.
If you need more data, let me know, and I'll package it during the
weekend.
Jon


_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 4:58 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Let me show you some examples that I'm doing right now that work fine.

I do this at the CLI and it works:
originate {origination_caller_id_number=9184238080}sofia/gateway/
asterlink.com/1918XXXXXXX 9999

And this is in my dialplan works:

<extension name="asterlink.com">
<condition field="destination_number" expression="^(1\d+)$">
<action application="export"
data="nolocal:absolute_codec_string=PCMU"/>
<action application="set"
data="effective_caller_id_number=9184238080"/>
<action application="bridge" data="sofia/gateway/asterlink.com/
$1"/>
</condition>
</extension>


/b





On Sep 19, 2008, at 4:44 PM, Jon Bruel wrote:

Quote:
Yes I can, but somehow I start to repeat myself. An INVITE is sent
allright every time, but one of the headers differs:
Works:
Remote-Party-ID:
<sip:45161061@jbconsulting.v2tel.dk>;screen=yes;privacy=off
Doesn't work:
Remote-Party-ID: "Extension 1000"
<sip:1000@jbconsulting.v2tel.dk>;screen=yes;privacy=off
I have tried with different variable names in the bridge data:
<action application="bridge"
data="[effective_caller_id_number=45161061]sofia/gateway/
45161061/$1"/>
as well as: origination_caller_id_number
data="[origination_caller_id_number=45161061]sofia/gateway/
45161061/$1"/
the latter combined with: <param name="caller-id-in-from"
value="true"/>.
But the only thing which works is setting the
effective_caller_id_number
in the dialplan before the bridge. That would be fine, unless I want
to
bridge to several destinations. Every time the call is rejected, the
Remote-Party-ID-header hasn't the right value.
I have tried to execute another dialplan at bridge, testing with other
variables, and the info application doesn't reveal the variable I
try to
include in square brackets in the bridge data string. So maybe its not
passed over to the B-leg.
If you need more data, let me know, and I'll package it during the
weekend.
Jon


_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 6:59 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Jon,

I did this originate at the CLI and each one has its own callerid:

originate [origination_caller_id_number=666666666]sofia/x.x.x.x/1000,
[origination_caller_id_number=999999999]sofia/x.x.x.x/1001 9999

And this in the dialplan:

<extension name="test">
<condition field="destination_number" expression="^886$">
<action application="bridge"
data="[origination_caller_id_number=666666666]sofia/x.x.x.x/1000,
[origination_caller_id_number=999999999]sofia/x.x.x.x/1001"/>
</condition>
</extension>

This is confirmed working as is my previous email. You have to watch
and make sure you're looking at the correct invite. Also remove the
caller-id-in-from.

My RPID looks like:

Remote-Party-ID: "Extension 1005" <sip:
999999999@x.x.x.x>;screen=yes;privacy=off
Remote-Party-ID: "Extension 1005" <sip:
666666666@x.x.x.x>;screen=yes;privacy=off

I have even tried this out to the PSTN to my cellphone and it works.

/b


On Sep 19, 2008, at 4:44 PM, Jon Bruel wrote:

Quote:
Yes I can, but somehow I start to repeat myself. An INVITE is sent
allright every time, but one of the headers differs:
Works:
Remote-Party-ID:
<sip:45161061@jbconsulting.v2tel.dk>;screen=yes;privacy=off
Doesn't work:
Remote-Party-ID: "Extension 1000"
<sip:1000@jbconsulting.v2tel.dk>;screen=yes;privacy=off
I have tried with different variable names in the bridge data:
<action application="bridge"
data="[effective_caller_id_number=45161061]sofia/gateway/
45161061/$1"/>
as well as: origination_caller_id_number
data="[origination_caller_id_number=45161061]sofia/gateway/
45161061/$1"/
the latter combined with: <param name="caller-id-in-from"
value="true"/>.
But the only thing which works is setting the
effective_caller_id_number
in the dialplan before the bridge. That would be fine, unless I want
to
bridge to several destinations. Every time the call is rejected, the
Remote-Party-ID-header hasn't the right value.
I have tried to execute another dialplan at bridge, testing with other
variables, and the info application doesn't reveal the variable I
try to
include in square brackets in the bridge data string. So maybe its not
passed over to the B-leg.
If you need more data, let me know, and I'll package it during the
weekend.
Jon


_______________________________________________
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
Back to top
brian at freeswitch.org
Guest





PostPosted: Fri Sep 19, 2008 7:03 pm    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Also what is "version" and make sure you're on svn trunk if possible.
That [] had a bug in it at some point and I can't recall the exact rev
we fixed it in. But I'm on svn trunk here working to nail down bugs
so we can release 1.0.2.

/b


_______________________________________________
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
Back to top
jbr at consiglia.dk
Guest





PostPosted: Sat Sep 20, 2008 2:16 am    Post subject: [Freeswitch-users] Possible problem in adding channel variab Reply with quote

Both suggestions work: If I include the effective_caller_id_number in the dialplan before bridging, or if I include {origination_caller_id_number=45161061} or [origination_caller_id_number=45161061] as a part of the first parameter after a originate command.
But skipping the “set” command in the dialplan, and trying to use:

<action application="bridge" data="[effective_caller_id_number=45161061]sofia/gateway/45161061/$1"/>

or:

<action application="bridge" data="[origination_caller_id_number=45161061]sofia/gateway/45161061/$1"/>

does not work. Same thing when using curled brackets.
I need to be able to pass parameters individually to each of the bridge destinations, not just for the A-number, but also for other stuff to be used for post processing of the call. An alternative would be to emulate the Asterisk chan_local by making some kind of loopback to the dialplan, using IAX or SIP, but this is a inelegant way of solving it.
Jon
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services