Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] Using Meta-app with curl together


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





PostPosted: Wed Nov 12, 2008 5:02 am    Post subject: [Freeswitch-users] Using Meta-app with curl together Reply with quote

Hi,

My freeswitch is configured with using curl to generate all the dialplan. Everything seems to be ok except with meta-app. I have setup bind_meta_app as follows:

<action application="bind_meta_app" data="1 a s execute_extension::record XML features"/>

When *1 is pressed, freeswitch will fetch another dialplan from curl, but the problem is that in the xml that is pressed to curl, there is no variable that can indicates that this is a bind_meta_app, the key being pressed, nor the context name ( which is called features in this case). Therefore, I find it difficult to handle the curl request and properly response to it. I suspect that I may have overlook a parameter or something like that.

Any clue or help will be greatly helpful.

Regards,
Doug
Back to top
brian at freeswitch.org
Guest





PostPosted: Wed Nov 12, 2008 9:51 am    Post subject: [Freeswitch-users] Using Meta-app with curl together Reply with quote

It should be requesting the record extension in the context features.
Is that not what you get?

/b

On Nov 12, 2008, at 4:02 AM, Doug Blacksone wrote:

Quote:
<action application="bind_meta_app" data="1 a s
execute_extension::record XML features"/>


_______________________________________________
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
dougblackstone at gmai...
Guest





PostPosted: Wed Nov 12, 2008 10:21 am    Post subject: [Freeswitch-users] Using Meta-app with curl together Reply with quote

Hi,

Yes, that is what I want. The problem is that in the dialplan curl request that freeswitch sends to my server, the context "features" is not found anywhere in the xml. Therefore, I have no way of determining whether to serve the dialplan xml with the features context stuff.

I am not sure if my explaination of the problem is clear enough for others to understand the problem I am facing.

To cut it short, I am looking for ways that can tell me the curl request is associated with *1 ( or a meta-data-app ), so that I can generate the xml accordingly.

Any suggestion will be nice.

Thanks,
Doug


On Wed, Nov 12, 2008 at 10:44 PM, Brian West <brian@freeswitch.org (brian@freeswitch.org)> wrote:
Quote:
It should be requesting the record extension in the context features.
Is that not what you get?

/b

On Nov 12, 2008, at 4:02 AM, Doug Blacksone wrote:

Quote:
<action application="bind_meta_app" data="1 a s
execute_extension::record XML features"/>



_______________________________________________
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
Back to top
dougblackstone at gmai...
Guest





PostPosted: Thu Nov 13, 2008 2:18 am    Post subject: [Freeswitch-users] Using Meta-app with curl together Reply with quote

Hello,

I just thought that I might be able to better explain my problem with an example. I am not sure if this is a solvable problem, and if not, then the meta-app function will not work at all.

Both a-leg and b-leg can execute record, stop_record, and attr meta_app. Even though I have included the feature context in the dialplan generated by my curl script, when *1 or *2 is pressed, Freeswitch would still go to webserver to get the dialplan for the features context. The problem is that in the xml request submitted by Freeswitch, there is nothing that mentions the name of the context it is looking for.

Here is the dialplan:
<document type="freeswitch/xml">
<section name="dialplan" description="voicemail dialplan">
<context name="public">
<extension name="test9">
<condition field="destination_number" expression="^(.*)$">
<action application="export" data="hold_music=silence" />
<action application="set" data="call_timeout=120" />
<action application="set" data="hangup_after_bridge=true" />
<action application="set" data="continue_on_fail=true" />
<action application="set" data="ringback=$${us-ring}" />
<action application="bind_meta_app" data="1 ab s execute_extension::record XML features"/>
<action application="bind_meta_app" data="2 ab s execute_extension::stoprecord XML features"/>
<action application="bind_meta_app" data="3 ab s execute_extension::att_xfer XML features"/>
<action application="bridge" data="sofia/gateway/openser/1000" />
<action application="execute_extension" data="rule XML public"/>
</condition>
</extension>
</context>
<context name="features">
<extension name="features">
<condition field="destination_number" expression="^att_xfer" break="on-true">
<action application="read" data="1 20 'tone_stream://%(10000,0,350,440)' digits 30000 #"/>
<action application="att_xfer" data="sofia/default/${digits}"/>
<action application="set" data="action=att-xfer" />
<action application="execute_extension" data="att${digits} XML public"/>
</condition>
<condition field="destination_number" expression="^record" break="on-true">
<action application="set" data="action=recording" />
<action application="execute_extension" data="rule XML public"/>
</condition>
<condition field="destination_number" expression="stoprecord" break="on-true">
<action application="gentones" data="%(500,0,800)" />
<action application="stop_record_session" data="null"/>
<action application="set" data="record_file=" />
</condition>
</extension>
</context>
</section>
</document>

Here is the xml doc Freeswitch sent out when *1 is pressed and it is shown that Freeswitch does not state the context that it is looking for:

name = Caller-Source value = mod_sofia
name = key_name value =
name = Answer-State value = answered
name = variable_sip_h_P-hint value = inbound->inbound
name = Channel-State value = CS_EXCHANGE_MEDIA
name = Unique-ID value = 5ca4a3b8-21d0-4d4a-89ac-93c6c921b0ed
name = Channel-Read-Codec-Rate value = 8000
name = Caller-Destination-Number value = 1000
name = Caller-Channel-Transfer-Time value = 0
name = variable_local_media_ip value = 192.168.1.101
name = key_value value =
name = Caller-Channel-Progress-Media-Time value = 0
name = Caller-Channel-Answered-Time value = 1226588459893881
name = Channel-Name value = sofia/external/1000
name = Other-Leg-Source value = mod_sofia
name = variable_originator value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_max_forwards value = 68
name = Caller-Unique-ID value = 5ca4a3b8-21d0-4d4a-89ac-93c6c921b0ed
name = Caller-Channel-Name value = sofia/external/1000
name = Channel-Read-Codec-Name value = PCMU
name = Other-Leg-Dialplan value = XML
name = hostname value = localhost.localdomain
name = variable_switch_m_sdp value = v=0
o=- 1480481 1480481 IN IP4 192.168.1.100
s=-
c=IN IP4 192.168.1.100
t=0 0
m=audio 16390 RTP/AVP 0 2 4 8 18 96 97 98 101
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:4 G723/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729a/8000
a=rtpmap:96 G726-40/8000
a=rtpmap:97 G726-24/8000
a=rtpmap:98 G726-16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30

name = variable_remote_media_port value = 13442
name = variable_sip_gateway_name value = openser
name = tag_name value =
name = variable_originator_codec value = PCMU@8000h@30i
name = variable_current_application value = execute_extension
name = Caller-Caller-ID-Number value = 1001
name = variable_write_codec value = PCMU
name = Other-Leg-Privacy-Hide-Name value = false
name = Channel-State-Number value = 5
name = variable_local_media_port value = 13442
name = variable_switch_r_sdp value = v=0
o=- 9 2 IN IP4 192.168.1.102
s=CounterPath X-Lite 3.0
c=IN IP4 192.168.1.102
t=0 0
m=audio 13442 RTP/AVP 0 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

name = variable_hold_music value = silence
name = Caller-Caller-ID-Name value = 1001
name = variable_remote_media_ip value = 192.168.1.102
name = variable_sip_call_id value = b68774cf-2c36-122c-778f-0022190e9476
name = Caller-Dialplan value = XML
name = Other-Leg-Unique-ID value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_read_rate value = 8000
name = variable_read_codec value = PCMU
name = Caller-Channel-Hangup-Time value = 0
name = Caller-Profile-Index value = 1
name = variable_endpoint_disposition value = ANSWER
name = Other-Leg-Username value = 1001
name = Caller-Username value = 1001
name = Other-Leg-Privacy-Hide-Number value = false
name = variable_bridge_channel value = sofia/internal/1001@192.168.1.101 (1001@192.168.1.101)
name = variable_sip_user_agent value = X-Lite release 1011s stamp 41150
name = Caller-Network-Addr value = 192.168.1.101
name = Other-Leg-Screen-Bit value = true
name = Other-Leg-Caller-ID-Name value = 1001
name = Channel-Write-Codec-Name value = PCMU
name = Other-Leg-Network-Addr value = 192.168.1.101
name = variable_signal_bond value = 57515855-62d3-445d-b174-7ccbca8f608f
name = Other-Leg-Caller-ID-Number value = 1001
name = Other-Leg-Context value = public
name = Call-Direction value = outbound
name = Caller-Screen-Bit value = true
name = Caller-Privacy-Hide-Number value = false
name = section value = dialplan
name = Caller-Channel-Created-Time value = 1226588455328603
name = variable_sofia_profile_name value = external
name = Caller-Channel-Progress-Time value = 1226588455767736
name = variable_bridge_uuid value = 57515855-62d3-445d-b174-7ccbca8f608f
name = Caller-Privacy-Hide-Name value = false
name = Other-Leg-Channel-Name value = sofia/internal/1001@192.168.1.101 (1001@192.168.1.101)
name = Caller-Context value = public
name = Channel-Write-Codec-Rate value = 8000
name = Other-Leg-Destination-Number value = 001000
name = variable_channel_name value = sofia/external/1000
name = variable_bridge_to value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_write_rate value = 8000
name = Caller-Profile-Created-Time value = 1226588455328603
name = variable_sip_destination_url value = sip:1000@192.168.1.101:5060
Back to top
anthony.minessale at g...
Guest





PostPosted: Thu Nov 13, 2008 9:29 am    Post subject: [Freeswitch-users] Using Meta-app with curl together Reply with quote

try latest trunk i think we added it.


On Thu, Nov 13, 2008 at 1:16 AM, Doug Blacksone <dougblackstone@gmail.com (dougblackstone@gmail.com)> wrote:
Quote:
Hello,

I just thought that I might be able to better explain my problem with an example. I am not sure if this is a solvable problem, and if not, then the meta-app function will not work at all.

Both a-leg and b-leg can execute record, stop_record, and attr meta_app. Even though I have included the feature context in the dialplan generated by my curl script, when *1 or *2 is pressed, Freeswitch would still go to webserver to get the dialplan for the features context. The problem is that in the xml request submitted by Freeswitch, there is nothing that mentions the name of the context it is looking for.

Here is the dialplan:
<document type="freeswitch/xml">
<section name="dialplan" description="voicemail dialplan">
<context name="public">
<extension name="test9">
<condition field="destination_number" expression="^(.*)$">
<action application="export" data="hold_music=silence" />
<action application="set" data="call_timeout=120" />
<action application="set" data="hangup_after_bridge=true" />
<action application="set" data="continue_on_fail=true" />
<action application="set" data="ringback=$${us-ring}" />
<action application="bind_meta_app" data="1 ab s execute_extension::record XML features"/>
<action application="bind_meta_app" data="2 ab s execute_extension::stoprecord XML features"/>
<action application="bind_meta_app" data="3 ab s execute_extension::att_xfer XML features"/>
<action application="bridge" data="sofia/gateway/openser/1000" />
<action application="execute_extension" data="rule XML public"/>
</condition>
</extension>
</context>
<context name="features">
<extension name="features">
<condition field="destination_number" expression="^att_xfer" break="on-true">
<action application="read" data="1 20 'tone_stream://%(10000,0,350,440)' digits 30000 #"/>
<action application="att_xfer" data="sofia/default/${digits}"/>
<action application="set" data="action=att-xfer" />
<action application="execute_extension" data="att${digits} XML public"/>
</condition>
<condition field="destination_number" expression="^record" break="on-true">
<action application="set" data="action=recording" />
<action application="execute_extension" data="rule XML public"/>
</condition>
<condition field="destination_number" expression="stoprecord" break="on-true">
<action application="gentones" data="%(500,0,800)" />
<action application="stop_record_session" data="null"/>
<action application="set" data="record_file=" />
</condition>
</extension>
</context>
</section>
</document>

Here is the xml doc Freeswitch sent out when *1 is pressed and it is shown that Freeswitch does not state the context that it is looking for:

name = Caller-Source value = mod_sofia
name = key_name value =
name = Answer-State value = answered
name = variable_sip_h_P-hint value = inbound->inbound
name = Channel-State value = CS_EXCHANGE_MEDIA
name = Unique-ID value = 5ca4a3b8-21d0-4d4a-89ac-93c6c921b0ed
name = Channel-Read-Codec-Rate value = 8000
name = Caller-Destination-Number value = 1000
name = Caller-Channel-Transfer-Time value = 0
name = variable_local_media_ip value = 192.168.1.101
name = key_value value =
name = Caller-Channel-Progress-Media-Time value = 0
name = Caller-Channel-Answered-Time value = 1226588459893881
name = Channel-Name value = sofia/external/1000
name = Other-Leg-Source value = mod_sofia
name = variable_originator value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_max_forwards value = 68
name = Caller-Unique-ID value = 5ca4a3b8-21d0-4d4a-89ac-93c6c921b0ed
name = Caller-Channel-Name value = sofia/external/1000
name = Channel-Read-Codec-Name value = PCMU
name = Other-Leg-Dialplan value = XML
name = hostname value = localhost.localdomain
name = variable_switch_m_sdp value = v=0
o=- 1480481 1480481 IN IP4 192.168.1.100
s=-
c=IN IP4 192.168.1.100
t=0 0
m=audio 16390 RTP/AVP 0 2 4 8 18 96 97 98 101
a=rtpmap:0 PCMU/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:4 G723/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729a/8000
a=rtpmap:96 G726-40/8000
a=rtpmap:97 G726-24/8000
a=rtpmap:98 G726-16/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30

name = variable_remote_media_port value = 13442
name = variable_sip_gateway_name value = openser
name = tag_name value =
name = variable_originator_codec value = PCMU@8000h@30i
name = variable_current_application value = execute_extension
name = Caller-Caller-ID-Number value = 1001
name = variable_write_codec value = PCMU
name = Other-Leg-Privacy-Hide-Name value = false
name = Channel-State-Number value = 5
name = variable_local_media_port value = 13442
name = variable_switch_r_sdp value = v=0
o=- 9 2 IN IP4 192.168.1.102
s=CounterPath X-Lite 3.0
c=IN IP4 192.168.1.102
t=0 0
m=audio 13442 RTP/AVP 0 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

name = variable_hold_music value = silence
name = Caller-Caller-ID-Name value = 1001
name = variable_remote_media_ip value = 192.168.1.102
name = variable_sip_call_id value = b68774cf-2c36-122c-778f-0022190e9476
name = Caller-Dialplan value = XML
name = Other-Leg-Unique-ID value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_read_rate value = 8000
name = variable_read_codec value = PCMU
name = Caller-Channel-Hangup-Time value = 0
name = Caller-Profile-Index value = 1
name = variable_endpoint_disposition value = ANSWER
name = Other-Leg-Username value = 1001
name = Caller-Username value = 1001
name = Other-Leg-Privacy-Hide-Number value = false
name = variable_bridge_channel value = sofia/internal/1001@192.168.1.101 (1001@192.168.1.101)
name = variable_sip_user_agent value = X-Lite release 1011s stamp 41150
name = Caller-Network-Addr value = 192.168.1.101
name = Other-Leg-Screen-Bit value = true
name = Other-Leg-Caller-ID-Name value = 1001
name = Channel-Write-Codec-Name value = PCMU
name = Other-Leg-Network-Addr value = 192.168.1.101
name = variable_signal_bond value = 57515855-62d3-445d-b174-7ccbca8f608f
name = Other-Leg-Caller-ID-Number value = 1001
name = Other-Leg-Context value = public
name = Call-Direction value = outbound
name = Caller-Screen-Bit value = true
name = Caller-Privacy-Hide-Number value = false
name = section value = dialplan
name = Caller-Channel-Created-Time value = 1226588455328603
name = variable_sofia_profile_name value = external
name = Caller-Channel-Progress-Time value = 1226588455767736
name = variable_bridge_uuid value = 57515855-62d3-445d-b174-7ccbca8f608f
name = Caller-Privacy-Hide-Name value = false
name = Other-Leg-Channel-Name value = sofia/internal/1001@192.168.1.101 (1001@192.168.1.101)
name = Caller-Context value = public
name = Channel-Write-Codec-Rate value = 8000
name = Other-Leg-Destination-Number value = 001000
name = variable_channel_name value = sofia/external/1000
name = variable_bridge_to value = 57515855-62d3-445d-b174-7ccbca8f608f
name = variable_write_rate value = 8000
name = Caller-Profile-Created-Time value = 1226588455328603
name = variable_sip_destination_url value = sip:1000@192.168.1.101:5060



_______________________________________________
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