Greetings,
Suppose I need to do custom routing for outbound calls from UA - softphone.
Each user account may have the following info attached to it:
1:provider_a:2:provider_b:3:provider_c which means: forward call to provider_a, if failed forward call to provider_b if failed forward call to provider_c if failed send response back to UA
I do database lookup based on from, and get above string. Suppose I wrote my own dispatcher module which initially gets set to above string: 1:provider_a:2:provider_b:3:provider_c
and forwards to first provider, then on failure_route I call next_provider and so on.
Will it work across multiple messages? Will it work correctly for each child - I mean joe@domain and paul@domain should be handled according their own providers?
Any other suggestions?
Thanks, Toly
toly schrieb:
Greetings,
Suppose I need to do custom routing for outbound calls from UA - softphone.
Each user account may have the following info attached to it:
1:provider_a:2:provider_b:3:provider_c which means: forward call to provider_a, if failed forward call to provider_b if failed forward call to provider_c if failed send response back to UA
I do database lookup based on from, and get above string. Suppose I wrote my own dispatcher module which initially gets set to above string: 1:provider_a:2:provider_b:3:provider_c
and forwards to first provider, then on failure_route I call next_provider and so on.
Such things are usually done in the following way: - in the routing module: push the destination URIs into the AVPs with the same name e.g. in your case write the 3 destinations into AVPs (if you define an AVP 3 times, you will have 3 AVPs with the same name)
- in the config script main route: check if this certain AVP is defined, if yes activate a failure route, copy the AVP into $ru, delete the AVP, t_relay
- in the failure route: check if this certain AVP is still defined, if yes activate the same failure route again, copy the AVP into $ru, delete the AVP, t_relay. if no, send an error response back to the caller.
Will it work across multiple messages? Will it work correctly for each child - I mean joe@domain and paul@domain should be handled according their own providers?
Any other suggestions?
maybe you can use the carrierroute module.
klaus
Klaus,
suppose to I wrote my own routing module. If the call originated from workerA, will failure route hit the same wrokerA?
Thanks, Toly
No, because the reply may be processed by a different worker.
Regards, Ovidiu Sas
On Fri, Sep 5, 2008 at 11:52 AM, toly hippo_big@hotmail.com wrote:
Klaus,
suppose to I wrote my own routing module. If the call originated from workerA, will failure route hit the same wrokerA?
Thanks, Toly -- View this message in context: http://www.nabble.com/custom-routing-tp19322478p19334164.html Sent from the OpenSER Users Mailing List mailing list archive at Nabble.com.
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
El Viernes, 5 de Septiembre de 2008, toly escribió:
Klaus,
suppose to I wrote my own routing module. If the call originated from workerA, will failure route hit the same wrokerA?
No, as Ovidiu has explained. Anyway, why do you need the same worler handling both request and response? Can you rely on bflags and AVP's that are visible per transaction?