[Serusers] SER 0.9.2 & Route & Analog FXO Problems :(

Iqbal iqbal at gigo.co.uk
Fri Jun 3 22:16:01 CEST 2005


Hi

To be honest I never really designed/wrote it to sell, hence its tightly 
intergrated into the way we do our system, thats the reason I wrote the 
pseudocode in the email, if I can get time, I will try to see if I can 
make the next version standalone, and then just dump it as opensource or 
something, but dont hold ur breath on that, cause these days I barely 
have time to goto sleep, seems like I am building ser setups for half 
the world  :-) . I went through the email below and hers my thoughts for 
the part I understand. If you want one written we may look at it, but we 
would look at a minimum cost £3000

1. Account for everything, and in ur script which does the 
billing/rating just ignore all numbers which start with 833, its better 
to do it here, than in ser itself, although in ser you could simply say 
if method !=REGISTER and uri!=^sip:833) setflag(1) or whatever acc flag 
is...that lots is not syntatically correct I just typed it out...but you 
get the idea.

2. I dont follow much of the rest  :-) , but it seems as if when a user 
dial a particvular number you wish it to goto ext1, then 2 etc etc, if 
that is the case look at usr_preferences table, where you can set onbusy 
etc paratemers, and tell them where to send the call . Note I have had 
varying success with this cause it does depend on your client a little. 
And in ser.cfg what you do is to use avpops to pull that value out, 
check what to do, set a flag, and then forward the call.

Hope the above is of some help...

Iqbal

Ozan Blotter wrote:


>> Dear Iqbal,
>>
>> Do you ever want to sell it , mean i want to buy  :)  all i need is so 
>> simple , please check this and tell me how we can arrange it, i 'm 
>> ready to pay quickly and also there's a small problem for me;
>>
>> Dear Friends,
>>
>> A friend of me is writing Basic Billing for SER  :)  in PHP. I'm gonna 
>> place it somewhere so anyone can add remove features to it and repost 
>> it. Will let all of you know and download it. But for now i need to 
>> create a dial plan. I do not want to make accounting for numbers 
>> beginning with 833 prefix, is there a way for it ? Another thing is , 
>> i've tried with so many things but always give errors in config. I 
>> have 2 x 4 Port Analog GSM Gateways, first IP is 192.168.1.10 and 
>> second IP is 192.168.1.20, SER Server has two ethernets, one is for 
>> Public IP 212.154.XXX.YYY for general use and the second ethernet is 
>> 192.168.1.5 connected to HUB where Gateways's LAN is. All ports of 
>> FXO's are registered with SER like 1111,2222,3333,4444 (Gateway A) and 
>> 5555,6666,7777,8888 (Gateway B). I want SER to send some calls to that 
>> numbers depending on Prefix :
>>
>> Before i worked with Ondo SIP Proxy a little and was successful with 
>> dial plan. Ex: a user dials 05353490056, proxys adds 1111 prefix, 
>> route to registered SIP client 1111 and send the call as 
>> 111105353490056 at IP.of.Proxy to Gateway, prefix 1111 is stripped from 
>> SIP and the gateway connects to GSM like 05353490056 at IP.of.Gateway
>>
>>
>> Ex for Gateways:
>> * for 1111,2222,3333 and 4444 : i want to use 053 prefix, so when a 
>> user dial a number like 05353490056, SER has to route it to 1111, if 
>> it's busy then route to 2222 so on till 4444.
>> * for 5555 and 6666 : i want to use 050 and 055 prefix, again same as 
>> above.
>> * for 7777 and 8888 : i want to use 054 prefix.
>>
>> * for prefixes apart from above and 833, i want to route all calls to 
>> 85.96.XXX.YYY , important thing is the clients are registered on SER 
>> but i want to route calls over from SER and by keeping their 
>> username/password combination since the clients are created on 
>> 85.96.XXX.YYY and that Gateway does auth for users, but SER also has 
>> to do accounting for this calls.
>>
>> Do i need so many things ?
>>
>> Thanks,
>> Ozan Blotter
>>
>> *ps : I'm using SER 0.9.2 from CVS  :) 
>>
>> current SER.CFG as follows :
>>
>> [root at localhost ser]# cat ser.cfg
>> debug=3
>> fork=yes
>> log_stderror=no
>>
>> listen=192.168.1.9           # put your server IP address here
>> port=5060
>> children=4
>>
>> dns=no
>> rev_dns=no
>>
>> fifo="/tmp/ser_fifo"
>> fifo_db_url="mysql://ser:heslo@localhost/ser"
>>
>> loadmodule "/usr/local/lib/ser/modules/mysql.so"
>> loadmodule "/usr/local/lib/ser/modules/sl.so"
>> loadmodule "/usr/local/lib/ser/modules/tm.so"
>> loadmodule "/usr/local/lib/ser/modules/rr.so"
>> loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
>> loadmodule "/usr/local/lib/ser/modules/usrloc.so"
>> loadmodule "/usr/local/lib/ser/modules/registrar.so"
>> loadmodule "/usr/local/lib/ser/modules/auth.so"
>> loadmodule "/usr/local/lib/ser/modules/auth_db.so"
>> loadmodule "/usr/local/lib/ser/modules/acc.so"
>> loadmodule "/usr/local/lib/ser/modules/uri_db.so"
>>
>> modparam("auth_db|uri_db|usrloc", "db_url", 
>> "mysql://ser:heslo@localhost/ser")
>> modparam("auth_db", "calculate_ha1", 1)
>> modparam("auth_db", "password_column", "password")
>> modparam("usrloc", "db_mode", 1)
>> modparam("rr", "enable_full_lr", 1)
>>
>> modparam("acc", "log_level", 1)
>> modparam("acc", "db_flag", 1)
>> modparam("acc", "log_missed_flag", 3)
>> modparam("acc", "log_fmt", "fimos")
>> modparam("acc", "db_url", "mysql://ser:heslo@localhost/ser")
>> modparam("acc", "db_missed_flag", 2)
>> modparam("acc", "early_media", 1)
>> modparam("acc", "failed_transactions", 1)
>> modparam("acc", "log_flag", 1)
>>
>> route {
>>
>> setflag(1);
>>
>>        # 
>> -----------------------------------------------------------------
>>        # Sanity Check Section
>>        # 
>> -----------------------------------------------------------------
>>        if (!mf_process_maxfwd_header("10")) {
>>                sl_send_reply("483", "Too Many Hops");
>>                break;
>>        };
>>
>>        if (msg:len > max_len) {
>>                sl_send_reply("513", "Message Overflow");
>>                break;
>>        };
>>
>>        # 
>> -----------------------------------------------------------------
>>        # Record Route Section
>>        # 
>> -----------------------------------------------------------------
>>        if (method!="REGISTER") {
>>                record_route();
>>        };
>>
>>        # 
>> -----------------------------------------------------------------
>>        # Loose Route Section
>>        # 
>> -----------------------------------------------------------------
>>        if (loose_route()) {
>>                route(1);
>>                break;
>>        };
>>
>>        # 
>> -----------------------------------------------------------------
>>        # Call Type Processing Section
>>        # 
>> -----------------------------------------------------------------
>>        if (uri!=myself) {
>>                route(1);
>>                break;
>>        };
>>
>>        if (uri==myself) {
>>                if (method=="INVITE" || method=="BYE" || 
>> method=="CANCEL") {
>>                setflag(1);
>>                        route(3);
>>                        break;
>>                } else  if (method=="REGISTER") {
>>                        route(2);
>>                        break;
>>                };
>>
>>                lookup("aliases");
>>                if (uri!=myself) {
>>                        route(1);
>>                        break;
>>                };
>>
>>                if (!lookup("location")) {
>>                        if (uri=~"^sip:053[0-9]*@") {
>>                        prefix("1111");
>>                        rewritehost ("192.168.1.10");
>>                        break;
>>                };
>>
>>                        sl_send_reply("404", "User Not Found");
>>                        break;
>>                };
>>
>>                route(1);
>>        };
>> }
>>
>> route[1] {
>>
>>        # 
>> -----------------------------------------------------------------
>>        # Default Message Handler
>>        # 
>> -----------------------------------------------------------------
>>        if (!t_relay()) {
>>                sl_reply_error();
>>        };
>> }
>>
>> route[2] {
>>
>>        # 
>> -----------------------------------------------------------------
>>        # REGISTER Message Handler
>>        # ----------------------------------------------------------------
>>        sl_send_reply("100", "Trying");
>>
>>
>>        if (!www_authorize("","subscriber")) {
>>                www_challenge("","0");
>>                break;
>>        };
>>
>>        if (!check_to()) {
>>                sl_send_reply("401", "Unauthorized");
>>                break;
>>        };
>>
>>        consume_credentials();
>>
>>        if (!save("location")) {
>>                sl_reply_error();
>>        };
>> }
>>
>> route[3] {
>>        # 
>> -----------------------------------------------------------------
>>        # INVITE Message Handler
>>        # 
>> -----------------------------------------------------------------
>>        if (!proxy_authorize("localhost","subscriber")) {
>>                proxy_challenge("localhost","0");
>>                break;
>>        } else if (!check_from()) {
>>                sl_send_reply("403", "Use From=ID");
>>                break;
>>        };
>>
>>        consume_credentials();
>>
>>        lookup("aliases");
>>        if (uri!=myself) {
>>                route(1);
>>                break;
>>        };
>>
>>        if (!lookup("location")) {
>>                sl_send_reply("404", "User Not Found");
>>                break;
>>        };
>>
>>        route(1);
>> }
>>
>> [root at localhost ser]#
>>
>>
>>
>> ----- Original Message ----- From: "Iqbal" <iqbal at gigo.co.uk>
>> To: <cosmocid at ispro.net.tr>
>> Sent: Thursday, June 02, 2005 8:00 PM
>> Subject: [Fwd: Re: [Serusers] VoIp Billing Solution SIP server 
>> compatible!!!]
>>
>>
>  
>
>>>> Not sure it helps, but was my thought process when I looked at 
>>>> building mine
>>>>
>>>> Iqbal
>>>>
>>    
>>
>>
>>
>> .
>>
>  
>

.


--------------080700020303020806010007--

.




Ozan Blotter wrote:

> Dear Friends,
>
> I know this is annoying to post nearly same things but still no answer 
> :( Is it really so hard or can anybody tell me why this is not working.
>
> There are :
> ATA 1 : 12345 (registered and can call 54321, no problem)
> ATA 2 : 54321 (registered and can call 12345, no problem)
> ANALOG FXO : 201 (registered as 201, for test purposes i only 
> registered one port of it)
>
> With Brekeke's Ondo SIP Proxy, i created a simple dial-plan and it 
> worked, even i can add more prefixes no problem. But in SER i cannot 
> :( I'm using ver 0.9.2. Normally it's like when i want to call a GSM, 
> proxy simply adds a prefix 201 which is same with registered sip 
> number for regarding analog port and forwards it (looks like 
> sip:20105353490056 at 192.168.1.35) to Gateway and Gateway simply strips 
> 201 from it and dials 05353490056, yes it connects. But what this same 
> does not work on SER, any ideas because it's very boring to play all 
> day and night ?
>
> Thanks....
>
>
>>>>>>>>>>> minimal SER.CFG >>>>>>>>>>
>>>>>>>>>>
>
> debug=3
> fork=yes
> log_stderror=no
>
> check_via=no
> dns=no
> rev_dns=no
> listen=192.168.1.10
> port=5060
> children=4
> fifo="/tmp/ser_fifo"
>
> loadmodule "/usr/local/lib/ser/modules/sl.so"
> loadmodule "/usr/local/lib/ser/modules/tm.so"
> loadmodule "/usr/local/lib/ser/modules/rr.so"
> loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
> loadmodule "/usr/local/lib/ser/modules/usrloc.so"
> loadmodule "/usr/local/lib/ser/modules/registrar.so"
>
> modparam("usrloc", "db_mode",   0)
> modparam("rr", "enable_full_lr", 1)
>
> route {
>
>        if (!mf_process_maxfwd_header("10")) {
>                sl_send_reply("483","Too Many Hops");
>                break;
>        };
>        if ( msg:len > max_len ) {
>                sl_send_reply("513", "Message too big");
>                break;
>        };
>
>        record_route();
>
>        if (loose_route()) {
>                t_relay();
>                break;
>        };
>
>        if (uri==myself) {
>
>                if (method=="REGISTER") {
>
>                        save("location");
>                        break;
>                };
>
>                if (uri=~"^sip:053[0-9]*@.*") {
>                        prefix("201");
>                        rewritehostport ("192.168.1.35:5060");
>                # forward ("192.168.1.35:5060");
>                        t_relay_to_udp("192.168.1.35","5060");
>                        break;
>                };
>
>                if (!lookup("location")) {
>                        sl_send_reply("404", "Not Found");
>                        break;
>                };
>        };
>
>        if (!t_relay()) {
>                sl_reply_error();
>        };
>
> }
>
>
>
>>>>>>>>>>> call from 12345 to 54321 (SIP 2 SIP Call) >>>>>>>>>>
>>>>>>>>>>
>
> U 192.168.1.10:5060 -> 192.168.1.201:5060
>  INVITE sip:54321 at 192.168.1.201:5060 SIP/2.0..Record-Route: 
> <sip:192.168.1.1
>  0;ftag=xITO2cDMxID;lr=on>..Via: SIP/2.0/UDP 
> 192.168.1.10;branch=z9hG4bK233f
>  .8f8b9d41.0..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bKba4b3e1d3eed
>  9c7c..Max-Forwards: 16..To: <sip:54321 at 192.168.1.10>..From: 
> <sip:12345 at 192.
>  168.1.10;user=phone>;tag=xITO2cDMxID..Call-ID: 
> 911D1B912D91212 at 192.168.1.20
>  0..CSeq: 1 INVITE..Contact: 
> <sip:12345 at 192.168.1.200:5060>..Session-Expires
>  : 100;refresher=uac..Supported: timer..Content-Type: 
> application/sdp..Conte
>  nt-Length: 185....v=0..o=12345 0 0 IN IP4 192.168.1.200..s=-..c=IN 
> IP4 192.
>  168.1.200..t=0 0..m=audio 2142 RTP/AVP 18 18..a=rtpmap:18 
> G729/8000..a=send
>  recv..a=rtpmap:18 G729/8000..a=sendrecv..a=ptime:20..
> #
> U 192.168.1.10:5060 -> 192.168.1.200:5060
>  SIP/2.0 180 Ringing..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bKba4b
>  3e1d3eed9c7c..To: <sip:54321 at 192.168.1.10>;tag=xETOxUDMxED..From: 
> <sip:1234
>  5 at 192.168.1.10;user=phone>;tag=xITO2cDMxID..Call-ID: 
> 911D1B912D91212 at 192.16
>  8.1.200..CSeq: 1 INVITE..Record-Route: 
> <sip:192.168.1.10;ftag=xITO2cDMxID;l
>  r=on>..Content-Length: 0....
>
>>>>>>>>>>> call from 12345 to 05353490056 (GSM Call) >>>>>>>>>>
>>>>>>>>>>
>
> U 192.168.1.10:5060 -> 192.168.1.200:5060
>  SIP/2.0 100 trying -- your call is important to us..Via: SIP/2.0/UDP 
> 192.16
>  8.1.200:5060;branch=z9hG4bK31bc676961f91e18..To: 
> <sip:05353490056 at 192.168.1
>  .10>..From: 
> <sip:12345 at 192.168.1.10;user=phone>;tag=xIjNxkDMxID..Call-ID: 8
>  76D1B912D91212 at 192.168.1.200..CSeq: 1 INVITE..Server: Sip EXpress 
> router (0
>  .9.2 (i386/linux))..Content-Length: 0..Warning: 392 192.168.1.10:5060 
> "Nois
>  y feedback tells:  pid=4587 req_src_ip=192.168.1.200 
> req_src_port=5060 in_u
>  ri=sip:05353490056 at 192.168.1.10 
> out_uri=sip:20105353490056 at 192.168.1.35:506
>  0 via_cnt==1"....
> #
> U 192.168.1.10:5060 -> 192.168.1.35:5060
>  INVITE sip:20105353490056 at 192.168.1.35:5060 SIP/2.0..Record-Route: 
> <sip:192
>  .168.1.10;ftag=xIjNxkDMxID;lr=on>..Via: SIP/2.0/UDP 
> 192.168.1.10;branch=z9h
>  G4bK188d.03855495.0..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bK31bc
>  676961f91e18..Max-Forwards: 16..To: 
> <sip:05353490056 at 192.168.1.10>..From: <
>  sip:12345 at 192.168.1.10;user=phone>;tag=xIjNxkDMxID..Call-ID: 
> 876D1B912D9121
>  2 at 192.168.1.200..CSeq: 1 INVITE..Contact: 
> <sip:12345 at 192.168.1.200:5060>..S
>  ession-Expires: 100;refresher=uac..Supported: timer..Content-Type: 
> applicat
>  ion/sdp..Content-Length: 185....v=0..o=12345 0 0 IN IP4 
> 192.168.1.200..s=-.
>  .c=IN IP4 192.168.1.200..t=0 0..m=audio 2146 RTP/AVP 18 
> 18..a=rtpmap:18 G72
>  9/8000..a=sendrecv..a=rtpmap:18 G729/8000..a=sendrecv..a=ptime:20..
> #
> U 192.168.1.10:5060 -> 192.168.1.35:5060
>  INVITE sip:20105353490056 at 192.168.1.35:5060 SIP/2.0..Record-Route: 
> <sip:192
>  .168.1.10;ftag=xIjNxkDMxID;lr=on>..Via: SIP/2.0/UDP 
> 192.168.1.10;branch=z9h
>  G4bK188d.03855495.0..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bK31bc
>  676961f91e18..Max-Forwards: 16..To: 
> <sip:05353490056 at 192.168.1.10>..From: <
>  sip:12345 at 192.168.1.10;user=phone>;tag=xIjNxkDMxID..Call-ID: 
> 876D1B912D9121
>  2 at 192.168.1.200..CSeq: 1 INVITE..Contact: 
> <sip:12345 at 192.168.1.200:5060>..S
>  ession-Expires: 100;refresher=uac..Supported: timer..Content-Type: 
> applicat
>  ion/sdp..Content-Length: 185....v=0..o=12345 0 0 IN IP4 
> 192.168.1.200..s=-.
>  .c=IN IP4 192.168.1.200..t=0 0..m=audio 2146 RTP/AVP 18 
> 18..a=rtpmap:18 G72
>  9/8000..a=sendrecv..a=rtpmap:18 G729/8000..a=sendrecv..a=ptime:20..
> #
> U 192.168.1.10:5060 -> 192.168.1.35:5060
>  INVITE sip:20105353490056 at 192.168.1.35:5060 SIP/2.0..Record-Route: 
> <sip:192
>  .168.1.10;ftag=xIjNxkDMxID;lr=on>..Via: SIP/2.0/UDP 
> 192.168.1.10;branch=z9h
>  G4bK188d.03855495.0..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bK31bc
>  676961f91e18..Max-Forwards: 16..To: 
> <sip:05353490056 at 192.168.1.10>..From: <
>  sip:12345 at 192.168.1.10;user=phone>;tag=xIjNxkDMxID..Call-ID: 
> 876D1B912D9121
>  2 at 192.168.1.200..CSeq: 1 INVITE..Contact: 
> <sip:12345 at 192.168.1.200:5060>..S
>  ession-Expires: 100;refresher=uac..Supported: timer..Content-Type: 
> applicat
>  ion/sdp..Content-Length: 185....v=0..o=12345 0 0 IN IP4 
> 192.168.1.200..s=-.
>  .c=IN IP4 192.168.1.200..t=0 0..m=audio 2146 RTP/AVP 18 
> 18..a=rtpmap:18 G72
>  9/8000..a=sendrecv..a=rtpmap:18 G729/8000..a=sendrecv..a=ptime:20..
> #
> U 192.168.1.10:5060 -> 192.168.1.35:5060
>  INVITE sip:20105353490056 at 192.168.1.35:5060 SIP/2.0..Record-Route: 
> <sip:192
>  .168.1.10;ftag=xIjNxkDMxID;lr=on>..Via: SIP/2.0/UDP 
> 192.168.1.10;branch=z9h
>  G4bK188d.03855495.0..Via: SIP/2.0/UDP 
> 192.168.1.200:5060;branch=z9hG4bK31bc
>  676961f91e18..Max-Forwards: 16..To: 
> <sip:05353490056 at 192.168.1.10>..From: <
>  sip:12345 at 192.168.1.10;user=phone>;tag=xIjNxkDMxID..Call-ID: 
> 876D1B912D9121
>  2 at 192.168.1.200..CSeq: 1 INVITE..Contact: 
> <sip:12345 at 192.168.1.200:5060>..S
>  ession-Expires: 100;refresher=uac..Supported: timer..Content-Type: 
> applicat
>  ion/sdp..Content-Length: 185....v=0..o=12345 0 0 IN IP4 
> 192.168.1.200..s=-.
>  .c=IN IP4 192.168.1.200..t=0 0..m=audio 2146 RTP/AVP 18 
> 18..a=rtpmap:18 G72
>  9/8000..a=sendrecv..a=rtpmap:18 G729/8000..a=sendrecv..a=ptime:20..
> #
> U 192.168.1.10:5060 -> 192.168.1.200:5060
>  SIP/2.0 200 ok -- no more pending branches..Via: SIP/2.0/UDP 
> 192.168.1.200:
>  5060;branch=z9hG4bK31bc676961f91e18..To: 
> <sip:05353490056 at 192.168.1.10>;tag
>  =2f9bfc2acf470ceacf4efdebbaa289b4-026c..From: 
> <sip:12345 at 192.168.1.10;user=
>  phone>;tag=xIjNxkDMxID..Call-ID: 876D1B912D91212 at 192.168.1.200..CSeq: 
> 1 CAN
>  CEL..Server: Sip EXpress router (0.9.2 (i386/linux))..Content-Length: 
> 0..Wa
>  rning: 392 192.168.1.10:5060 "Noisy feedback tells:  pid=4586 
> req_src_ip=19
>  2.168.1.200 req_src_port=5060 in_uri=sip:05353490056 at 192.168.1.10 
> out_uri=s
>  ip:20105353490056 at 192.168.1.35:5060 via_cnt==1"....
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
> .
>




More information about the sr-users mailing list