you could try using a FS api call in your originate that uses mod_http to hit your routing logic.<br><br>The other way is just not elegant at all and there is no way I can see to do it.<br><br><br><div class="gmail_quote">
On Tue, Jul 28, 2009 at 3:29 AM, Tamas Cseke <span dir="ltr"><<a href="mailto:cstomi.levlist@gmail.com">cstomi.levlist@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
Thank you for your effort about this issue.<br>
Our problem is that searching this routing data from database is quiet<br>
painful.<br>
Let me explain. we have manual calls from softphones and automatically<br>
originated calls pushed into fifo.<br>
<br>
We have a quiet complicate routing logic setting certain variables (sip<br>
headers, caller id number etc...), select routes according to prefix,<br>
time matching and so on.<br>
For manual calls we only could accomplish these routing in dialplan.<br>
(we store the data in database but we generate xml dialplans from them).<br>
For automatic calls if we can't use the dialplan we have to implement<br>
this routing again (in C module). and every time when a manager or<br>
customer would like a new feature (eg. add<br>
different sip headers for calls for different projects) we have to<br>
implement it twice.<br>
<br>
I tried to make a patch to do a dialplan hunt before the real invite for<br>
outgoing channels, but it's not very elegant...<br>
We were thinking about to make a new endpoint module, but the problem<br>
is that outgoing channel routine create the session, that we need for<br>
dialplan hunting, so I can't do it totally independent<br>
Could you please advise me a way to do it elegant, or is it a very bad idea?<br>
<br>
Here is the patch.<br>
svn diff -r 14390:14396<br>
<a href="http://svn.freeswitch.org/svn/freeswitch/branches/cseket/src/mod/endpoints/mod_sofia" target="_blank">http://svn.freeswitch.org/svn/freeswitch/branches/cseket/src/mod/endpoints/mod_sofia</a><br>
<br>
Thanks in advance,<br>
Tamas<br>
<br>
Anthony Minessale írta:<br>
<div><div></div><div class="h5">> yah, I looked into that and it's not possible to do.<br>
><br>
> Your usage of the dialplan like a database is just not a good way to do it.<br>
> I suggest you use a database or something else to store that routing data<br>
> like others do.<br>
><br>
><br>
><br>
> On Wed, Jul 22, 2009 at 10:55 AM, Tamas Cseke <<a href="mailto:cstomi.levlist@gmail.com">cstomi.levlist@gmail.com</a>>wrote:<br>
><br>
><br>
>> Hello,<br>
>><br>
>> we are using mod_loopback for outbound calls to be able to do a dialplan<br>
>> hunt before the actual call origination.<br>
>> change caller number, change routing according to the prefix and<br>
>> something like that.<br>
>> We have talked about a lot, that this is "not very" efficient because<br>
>> we have 2 extra channels (loopbacks) for every call.<br>
>><br>
>> I diged into the state machine code and figured out that if I change the<br>
>> on_routing state handler functions for switch_ivr_originate to don't<br>
>> veto the standard behavior I can perform a dilplan hunt.<br>
>> But I still have to originate a channel which makes a dialplan hunt and<br>
>> originate another. and this isn't what we really would like to...<br>
>><br>
>> I've got the following tip from Anthony earlier:<br>
>> 0416 16:39:28 <@anthm> maybe i could make an api command to pretend to<br>
>> do a dialplan run and print out a list in inline format of what to do<br>
>> 0416 16:39:48 <@anthm> that you could feed to originate inline dialplan<br>
>><br>
>> But I don't know how to implement this. I need some explanation.<br>
>><br>
>> 1) the dialplan pretender api returns applications in inline format<br>
>> 2) we feed it to inline dialplan<br>
>> but how could we originate the call, how should the whole process look<br>
>> like?<br>
>> could you please give me an example?<br>
>><br>
>> I was thinking about someting like this, but it doesn't make sense I quess.<br>
>> ${originate(call_url inline ${pretend_dialplan_hunt(exten XML context)})}<br>
>><br>
>> Thanks in advance,<br>
>> Tamas<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> FreeSWITCH-dev mailing list<br>
>> <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>><br>
>><br>
><br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">><br>
> _______________________________________________<br>
> FreeSWITCH-dev mailing list<br>
> <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>