Let's see if I can do this, so something like this?
Using the PSTN Source IP to decide on the asterisk peer?
Not really sure on what variable dispatch will return as it's chosen ip?
IP_auth ->Dispatch->Force Socket->Relay
route{
if (!allow_source_address("1")) {
sl_send_reply("403", "Forbidden");
exit;
};
# load-balance dispatching on gateways group '1'
if(!ds_select_dst("1", "10"))
{
send_reply("404", "No destination");
exit;
}
xlog("L_DBG", "--- SCRIPT: going to <$ru> via
<$du>\n");
t_on_failure("RTF_DISPATCH");
if ($si == "1.2.3.1") {
force_send_socket($sndto:5065);
} else if ($si == "1.2.3.2") {
force_send_socket($sndto:5070);
}
t_relay();
return;
Most definitely, thank you for your time.
Matt Scott
From: sr-users-bounces(a)lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org]
On Behalf Of Olle E. Johansson
Sent: Friday, January 18, 2013 1:09 AM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: Re: [SR-Users] Invite - negotiate to asterisk as peer not kamailio
17 jan 2013 kl. 18:07 skrev "Scott, Matt"
<mscott@homeadvisor.com<mailto:mscott@homeadvisor.com>>:
Pstn->Kamailio->dispatcher->asterisk
When calls come in, they are sent to asterisk, and the peer is negotiated as Kamailio.
How can I have different peer settings, for example dtmf?
I have an Asterisk branch that separates peers beyond the proxy (pinetree-1.4) based on
the via received headers.
I have it in production for Asterisk 1.4 in multiple places, but don't know the
current state in relationship to
latest source code.
I'm thinking I want the call to come in, then when the invite is sent to asterisk, the
invite should be from the pstn-peer and not Kamailio, make sense?
Then I can have separate peers, with their own dtmf/audio settings, but I see the invite
as:
Remember that Asterisk first match incoming calls on users with the FROM header. You can
separate based on the From header. But for PSTN, that doesn't really help...
If you have a limited set of profiles you can add port numbers to Asterisk peers, like
have a peer on port 5060 and another on the kamailio IP on 5065. Have kamailio open both
sockets and use force_socket to send from the proper one.
/O
INVITE sip:+1866NXXNXXX@<kamailio<sip:+1866NXXNXXX@%3ckamailio> ip>:5060
SIP/2.0
Via: SIP/2.0/UDP <Kamailio ip>;branch=z9hG4bKc087.12db3c91.0
Via: SIP/2.0/UDP <pstn-peer ip>:5060;branch=z9hG4bK0cB824c55100a4f2b8b
From: <sip:+1NXXNXXXXXXXX@<pstn-peer ip>:5060;isup-oli=0>;tag=gK0c731df8
To: <sip:+1NXXNXXNXXX@<kamailio ip>:5060>
Call-ID: 1024240378_131584110@<pstn-peer ip>
Any help or suggestions are very welcome..
Matt Scott
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org<mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users