Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] simple originate / bridge js


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
paparoga at mailinator...
Guest





PostPosted: Wed Jul 08, 2009 11:05 am    Post subject: [Freeswitch-users] simple originate / bridge js Reply with quote

Hi all,

I'm attempting to setup a simple alarm handling machine.

It should be triggered by an external event, dial a phone number (depending on
the alarm type), and play a few wav files indicating the failure happened.

Using Free, up to now, I've created a simple IVR and connected it to my EXT.
118.

Connecting a softphone to the ext. 1001 and dialing the ext 118 the IVR is ok.

Also using the following Free command from the console all is ok:

originate sofia/zz.xxx.200.29/1001 118

My softphone at ext 1001 get ringed and then connected to the IVR at ext. 118.

I cannot get the same from a simple js.

I tried:
=====================================
session = new Session("sofia/zz.xxx.200.29/1001");
//session = new Session();
//session.originate(session, "sofia/zz.yyy.200.29/118");
session.execute("bridge", "sofia/default/118");
=====================================
and almost all possibles variations, but I'get this result:

2009-07-08 16:23:00 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 16:23:00 [WARNING] mod_sofia.c:2495 sofia_outgoing_channel() Cannot
locate registered user 118@default
2009-07-08 16:23:00 [NOTICE] mod_sofia.c:2591 sofia_outgoing_channel() Close
Channel N/A [CS_NEW]

How can I tell to the script that the EXT. 118 is an IVR and not a registered
USER?

By the way, I attempted also the 'transfer' function, but I get the following:

2009-07-08 16:35:43 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 16:35:50 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 16:35:50 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[sofia/default/118@default]
2009-07-08 16:35:50 [NOTICE] mod_spidermonkey.c:2994 session_destroy() Hangup
sofia/internal/1001 [CS_ROUTING] [NORMAL_CLEARING]
2009-07-08 16:35:50 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 8 (sofia/internal/1001) Ended
2009-07-08 16:35:50 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]


Any suggestion?

Regards

Kowalsky

_______________________________________________
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
anthony.minessale at g...
Guest





PostPosted: Wed Jul 08, 2009 11:41 am    Post subject: [Freeswitch-users] simple originate / bridge js Reply with quote

in the first example you are transferring to 118
in the script you are calling a sip address but you are not supplying the domain

try
var my_domain = "1.2.3.4"
session.execute("bridge", "sofia/default/118%" + my_domain);

where you set my_domain to whatever domain your phone registered with.



On Wed, Jul 8, 2009 at 9:41 AM, <paparoga@mailinator.com (paparoga@mailinator.com)> wrote:
Quote:
Hi all,

I'm attempting to setup a simple alarm handling machine.

It should be triggered by an external event, dial a phone number (depending on
the alarm type), and play a few wav files indicating the failure happened.

Using Free, up to now, I've created a simple IVR and connected it to my EXT.
118.

Connecting a softphone to the ext. 1001 and dialing the ext 118 the IVR is ok.

Also using the following Free command from the console all is ok:

originate sofia/zz.xxx.200.29/1001 118

My softphone at ext 1001 get ringed and then connected to the IVR at ext. 118.

I cannot get the same from a simple js.

I tried:
=====================================
session = new Session("sofia/zz.xxx.200.29/1001");
//session = new Session();
//session.originate(session, "sofia/zz.yyy.200.29/118");
session.execute("bridge", "sofia/default/118");
=====================================
and almost all possibles variations, but I'get this result:

2009-07-08 16:23:00 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 16:23:00 [WARNING] mod_sofia.c:2495 sofia_outgoing_channel() Cannot
locate registered user 118@default
2009-07-08 16:23:00 [NOTICE] mod_sofia.c:2591 sofia_outgoing_channel() Close
Channel N/A [CS_NEW]

How can I tell to the script that the EXT. 118 is an IVR and not a registered
USER?

By the way, I attempted also the 'transfer' function, but I get the following:

2009-07-08 16:35:43 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 16:35:50 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 16:35:50 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[sofia/default/118@default]
2009-07-08 16:35:50 [NOTICE] mod_spidermonkey.c:2994 session_destroy() Hangup
sofia/internal/1001 [CS_ROUTING] [NORMAL_CLEARING]
2009-07-08 16:35:50 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 8 (sofia/internal/1001) Ended
2009-07-08 16:35:50 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]


Any suggestion?

Regards

Kowalsky

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
msc at freeswitch.org
Guest





PostPosted: Wed Jul 08, 2009 11:49 am    Post subject: [Freeswitch-users] simple originate / bridge js Reply with quote

On Wed, Jul 8, 2009 at 7:41 AM, <paparoga@mailinator.com (paparoga@mailinator.com)> wrote:
Quote:
Hi all,

I'm attempting to setup a simple alarm handling machine.

It should be triggered by an external event, dial a phone number (depending on
the alarm type), and play a few wav files indicating the failure happened.

Using Free, up to now, I've created a simple IVR and connected it to my EXT.
118.

Connecting a softphone to the ext. 1001 and dialing the ext 118 the IVR is ok.

Also using the following Free command from the console all is ok:

originate sofia/zz.xxx.200.29/1001 118

My softphone at ext 1001 get ringed and then connected to the IVR at ext. 118.

I cannot get the same from a simple js.

I tried:
=====================================
session = new Session("sofia/zz.xxx.200.29/1001");
//session = new Session();
//session.originate(session, "sofia/zz.yyy.200.29/118");
session.execute("bridge", "sofia/default/118");
=====================================
and almost all possibles variations, but I'get this result:

2009-07-08 16:23:00 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 16:23:00 [WARNING] mod_sofia.c:2495 sofia_outgoing_channel() Cannot
locate registered user 118@default
2009-07-08 16:23:00 [NOTICE] mod_sofia.c:2591 sofia_outgoing_channel() Close
Channel N/A [CS_NEW]

How can I tell to the script that the EXT. 118 is an IVR and not a registered
USER?

It looks like 118 is defined in your dialplan so use transfer instead of bridge:
 session.execute("transfer", "118 XML default");

-MC
Back to top
paparoga at mailinator...
Guest





PostPosted: Wed Jul 08, 2009 3:21 pm    Post subject: [Freeswitch-users] simple originate / bridge js Reply with quote

First of all I apologise for my long post.

In the meantime I reworked the simple js as suggested (adding the domain or
using transfer instead of bridge) but yet the script doesn't work.

Let me add some other info.

I just cloned the '5000' demo_ivr and reworked a little to reach my target.

Next I added:

<!-- a sample IVR -->
<extension name="ivr_demo_alarm">
<condition field="destination_number" expression="^118$">
<action application="answer"/>
<action application="sleep" data="2000"/>
<action application="ivr" data="demo_ivr_alarm"/>
</condition>
</extension>

into the default.xml dialplan.

Now all is ok if I connect Ekiga to FreeSwitch as user 1001 (for example) and
than I dial '118'.

The IVR works fine.

Next from the console:

originate sofia/my.freeswitch.address/1001 118

I get my Ekiga Phone ringing and connecter to the ext. 118 (the ivr)

That is the log:
=========================================================
originate sofia/10.0.0.33/1001 118

2009-07-08 21:56:57 [NOTICE] switch_channel.c:567 switch_channel_set_name()
New Channel sofia/internal/1001 [7e660b20-6bf9-11de-b2fa-f3963e050c84]
2009-07-08 21:56:57 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 21:57:00 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 21:57:00 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[118@default]
API CALL [originate(sofia/10.0.0.33/1001 118)] output:
+OK 7e660b20-6bf9-11de-b2fa-f3963e050c84

freeswitch@Linux61> 2009-07-08 21:57:00 [INFO] mod_dialplan_xml.c:233
dialplan_hunt() Processing FreeSWITCH->118 in context default
2009-07-08 21:57:02 [WARNING] switch_core_file.c:119
switch_core_perform_file_open() Sample rate doesn't match
2009-07-08 21:57:15 [WARNING] switch_core_file.c:119
switch_core_perform_file_open() Sample rate doesn't match
2009-07-08 21:57:21 [NOTICE] sofia.c:3279 sofia_handle_sip_i_state() Hangup
sofia/internal/1001 [CS_EXECUTE] [NORMAL_CLEARING]
2009-07-08 21:57:25 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 33 (sofia/internal/1001) Ended
2009-07-08 21:57:25 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]
====================================================

Using the js instead it looks like if the bridge commands looks for a
REGISTERED user at ext. 118, and so it fails.

Using the transfer option, as suggested, the Ekiga user (1001) get to be
connected to the ext 118, bur the connection drops immediately after.

====================================================
freeswitch@Linux61> jsrun alarm.js
API CALL [jsrun(alarm.js)] output:
OK

freeswitch@Linux61> 2009-07-08 22:03:47 [NOTICE] switch_channel.c:567
switch_channel_set_name() New Channel sofia/internal/1001
[7267f936-6bfa-11de-b2fa-f3963e050c84]
2009-07-08 22:03:47 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 22:03:51 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 22:03:51 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[118@default]
2009-07-08 22:03:51 [NOTICE] mod_spidermonkey.c:2994 session_destroy() Hangup
sofia/internal/1001 [CS_ROUTING] [NORMAL_CLEARING]
2009-07-08 22:03:51 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 35 (sofia/internal/1001) Ended
2009-07-08 22:03:51 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]
==================================================

May be I'm on the wrong way, but this is my target:

1) From the external Perl freeswitch interface call a simple js
2) Make this script dial a sip/pstn phone number at the assistance location
3) Connect the just dialled assistance location to the IVR at ext 118 and let
the support people hear some info about the raising fault.

Thanks in advance for any suggestion.



Roberto

_______________________________________________
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
anthony.minessale at g...
Guest





PostPosted: Wed Jul 08, 2009 3:45 pm    Post subject: [Freeswitch-users] simple originate / bridge js Reply with quote

you also have to set
session.setAutoHangup(0);

or it will hangup as soon as it exits the script.


On Wed, Jul 8, 2009 at 3:15 PM, <paparoga@mailinator.com (paparoga@mailinator.com)> wrote:
Quote:
First of all I apologise for my long post.

In the meantime I reworked the simple js as suggested (adding the domain or
using transfer instead of bridge) but yet the script doesn't work.

Let me add some other info.

I just cloned the '5000' demo_ivr and reworked a little to reach my target.

Next I added:

 <!-- a sample IVR  -->
   <extension name="ivr_demo_alarm">
     <condition field="destination_number" expression="^118$">
       <action application="answer"/>
       <action application="sleep" data="2000"/>
       <action application="ivr" data="demo_ivr_alarm"/>
     </condition>
   </extension>

into the default.xml dialplan.

Now all is ok if I connect Ekiga to FreeSwitch as user 1001 (for example) and
than I dial '118'.

The IVR works fine.

Next from the console:

originate sofia/my.freeswitch.address/1001 118

I get my Ekiga Phone ringing and connecter to the ext. 118 (the ivr)

That is the log:
=========================================================
originate sofia/10.0.0.33/1001 118

2009-07-08 21:56:57 [NOTICE] switch_channel.c:567 switch_channel_set_name()
New Channel sofia/internal/1001 [7e660b20-6bf9-11de-b2fa-f3963e050c84]
2009-07-08 21:56:57 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 21:57:00 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 21:57:00 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[118@default]
API CALL [originate(sofia/10.0.0.33/1001 118)] output:
+OK 7e660b20-6bf9-11de-b2fa-f3963e050c84

freeswitch@Linux61> 2009-07-08 21:57:00 [INFO] mod_dialplan_xml.c:233
dialplan_hunt() Processing FreeSWITCH->118 in context default
2009-07-08 21:57:02 [WARNING] switch_core_file.c:119
switch_core_perform_file_open() Sample rate doesn't match
2009-07-08 21:57:15 [WARNING] switch_core_file.c:119
switch_core_perform_file_open() Sample rate doesn't match
2009-07-08 21:57:21 [NOTICE] sofia.c:3279 sofia_handle_sip_i_state() Hangup
sofia/internal/1001 [CS_EXECUTE] [NORMAL_CLEARING]
2009-07-08 21:57:25 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 33 (sofia/internal/1001) Ended
2009-07-08 21:57:25 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]
====================================================

Using the js instead it looks like if the bridge commands looks for a
REGISTERED user at ext. 118, and so it fails.

Using the transfer option, as suggested, the Ekiga user (1001) get to be
connected to the ext 118, bur the connection drops immediately after.

====================================================
freeswitch@Linux61> jsrun alarm.js
API CALL [jsrun(alarm.js)] output:
OK

freeswitch@Linux61> 2009-07-08 22:03:47 [NOTICE] switch_channel.c:567
switch_channel_set_name() New Channel sofia/internal/1001
[7267f936-6bfa-11de-b2fa-f3963e050c84]
2009-07-08 22:03:47 [NOTICE] sofia.c:2782 sofia_handle_sip_i_state()
Ring-Ready sofia/internal/1001!
2009-07-08 22:03:51 [NOTICE] sofia.c:3220 sofia_handle_sip_i_state() Channel
[sofia/internal/1001] has been answered
2009-07-08 22:03:51 [NOTICE] switch_ivr.c:1343 switch_ivr_session_transfer()
Transfer sofia/internal/1001 to XML[118@default]
2009-07-08 22:03:51 [NOTICE] mod_spidermonkey.c:2994 session_destroy() Hangup
sofia/internal/1001 [CS_ROUTING] [NORMAL_CLEARING]
2009-07-08 22:03:51 [NOTICE] switch_core_session.c:970
switch_core_session_thread() Session 35 (sofia/internal/1001) Ended
2009-07-08 22:03:51 [NOTICE] switch_core_session.c:972
switch_core_session_thread() Close Channel sofia/internal/1001 [CS_HANGUP]
==================================================

May be I'm on the wrong way, but this is my target:

1) From the external Perl freeswitch interface call a simple js
2) Make this script dial a sip/pstn phone number at the assistance location
3) Connect the just dialled assistance location to the IVR at ext 118 and let
the support people hear some info about the raising fault.

Thanks in advance for any suggestion.



Roberto

_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
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
Page 1 of 1

 
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