[SR-Users] libosip2 parse body error

2010-10-26 Thread t
Hi,

Not sure how to provide this info (or even if anybody cares), but libosip2
parser objects to incorrect (short) Content-Length from iptel.org.

Regards,
Tony.
20:15:21 sock.c:434 send UDP packet to 213.192.59.75: 5060
---BUFFER DUMP follows---
  53 49 50 2f 32 2e 30 20 32 30 30 20 4f 4b 0d 0a SIP/2.0 200 OK..
  56 69 61 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 Via: SIP/2.0/UDP
  20 32 31 33 2e 31 39 32 2e 35 39 2e 37 35 3b 62  213.192.59.75;b
  72 61 6e 63 68 3d 7a 39 68 47 34 62 4b 63 37 32 ranch=z9hG4bKc72
  62 2e 64 39 65 39 66 65 32 33 2e 30 0d 0a 56 69 b.d9e9fe23.0..Vi
  61 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 31 a: SIP/2.0/UDP 1
  39 32 2e 31 36 38 2e 32 35 34 2e 31 3a 35 30 36 92.168.254.1:506
  30 3b 72 70 6f 72 74 3d 35 30 36 30 3b 62 72 61 0;rport=5060;bra
  6e 63 68 3d 7a 39 68 47 34 62 4b 33 34 62 32 36 nch=z9hG4bK34b26
  33 63 32 37 33 33 61 35 32 34 66 64 65 64 36 31 3c2733a524fded61
  33 61 64 65 38 62 31 64 34 39 38 0d 0a 56 69 61 3ade8b1d498..Via
  3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 31 39 : SIP/2.0/UDP 19
  32 2e 31 36 38 2e 31 31 2e 35 31 3b 72 70 6f 72 2.168.11.51;rpor
  74 3b 62 72 61 6e 63 68 3d 7a 39 68 47 34 62 4b t;branch=z9hG4bK
  70 78 7a 6d 64 6f 72 74 0d 0a 52 65 63 6f 72 64 pxzmdort..Record
  2d 52 6f 75 74 65 3a 20 3c 73 69 70 3a 32 31 33 -Route: ..Fr
  6f 6d 3a 20 22 63 64 31 30 31 30 31 31 40 31 39 om: "cd101...@19
  32 2e 31 36 38 2e 31 31 2e 31 22 20 3c 73 69 70 2.168.11.1" ;tag=nmur
  79 0d 0a 54 6f 3a 20 3c 73 69 70 3a 63 64 30 30 y..To: ;tag=zcojc..C
  61 6c 6c 2d 49 44 3a 20 6c 65 6c 69 7a 74 62 70 all-ID: leliztbp
  72 69 62 70 65 70 74 40 6c 6f 63 61 6c 68 6f 73 ribp...@localhos
  74 0d 0a 43 53 65 71 3a 20 39 31 34 20 49 4e 56 t..CSeq: 914 INV
  49 54 45 0d 0a 43 6f 6e 74 61 63 74 3a 20 3c 73 ITE..Contact: ..Cont
  65 6e 74 2d 54 79 70 65 3a 20 61 70 70 6c 69 63 ent-Type: applic
  61 74 69 6f 6e 2f 73 64 70 0d 0a 41 6c 6c 6f 77 ation/sdp..Allow
  3a 20 49 4e 56 49 54 45 0d 0a 41 6c 6c 6f 77 3a : INVITE..Allow:
  20 41 43 4b 0d 0a 41 6c 6c 6f 77 3a 20 42 59 45  ACK..Allow: BYE
  0d 0a 41 6c 6c 6f 77 3a 20 43 41 4e 43 45 4c 0d ..Allow: CANCEL.
  0a 41 6c 6c 6f 77 3a 20 4f 50 54 49 4f 4e 53 0d .Allow: OPTIONS.
  0a 41 6c 6c 6f 77 3a 20 50 52 41 43 4b 0d 0a 41 .Allow: PRACK..A
  6c 6c 6f 77 3a 20 52 45 46 45 52 0d 0a 41 6c 6c llow: REFER..All
  6f 77 3a 20 4e 4f 54 49 46 59 0d 0a 41 6c 6c 6f ow: NOTIFY..Allo
  77 3a 20 53 55 42 53 43 52 49 42 45 0d 0a 41 6c w: SUBSCRIBE..Al
  6c 6f 77 3a 20 49 4e 46 4f 0d 0a 41 6c 6c 6f 77 low: INFO..Allow
  3a 20 4d 45 53 53 41 47 45 0d 0a 53 65 72 76 65 : MESSAGE..Serve
  72 3a 20 54 77 69 6e 6b 6c 65 2f 31 2e 34 2e 32 r: Twinkle/1.4.2
  0d 0a 53 75 70 70 6f 72 74 65 64 3a 20 72 65 70 ..Supported: rep
  6c 61 63 65 73 0d 0a 53 75 70 70 6f 72 74 65 64 laces..Supported
  3a 20 6e 6f 72 65 66 65 72 73 75 62 0d 0a 43 6f : norefersub..Co
  6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 20 20 ntent-Length:   
  32 30 30 0d 0a 0d 0a 76 3d 30 0d 0a 6f 3d 74 77 200v=0..o=tw
  69 6e 6b 6c 65 20 31 33 33 33 37 30 37 32 38 39 inkle 1333707289
  20 38 30 39 37 35 37 36 37 33 20 49 4e 20 49 50  809757673 IN IP
  34 20 36 36 2e 34 39 2e 32 33 35 2e 31 32 39 0d 4 66.49.235.129.
  0a 73 3d 2d 0d 0a 63 3d 49 4e 20 49 50 34 20 36 .s=-..c=IN IP4 6
  36 2e 34 39 2e 32 33 35 2e 31 32 39 0d 0a 74 3d 6.49.235.129..t=
  30 20 30 0d 0a 6d 3d 61 75 64 69 6f 20 35 30 32 0 0..m=audio 502
  32 20 52 54 50 2f 41 56 50 20 39 38 20 31 30 31 2 RTP/AVP 98 101
  0d 0a 61 3d 72 74 70 6d 61 70 3a 39 38 20 73 70 ..a=rtpmap:98 sp
  65 65 78 2f 31 36 30 30 30 0d 0a 61 3d 72 74 70 eex/16000..a=rtp
  6d 61 70 3a 31 30 31 20 74 65 6c 65 70 68 6f 6e map:101 telephon
  65 2d 65 76 65 6e 74 2f 38 30 30 30 0d 0a 61 3d e-event/8000..a=
  66 6d 74 70 3a 31 30 31 20 30 2d 31 35 0d 0afmtp:101 0-15.. 

---end of BUFFER DUMP---
20:15:22 sock.c:281 received UDP packet from [213.192.59.75:5060] count=1014
---BUFFER DUMP follows---
  53 49 50 2f 32 2e 30 20 32 30 30 20 4f 4b 0d 0a SIP/2.0 200 OK..
  56 69 61 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 Via: SIP/2.0/UDP
  20 31 39 32 2e 31 36 38 2e 32 35 34 2e 31 3a 35  192.168.254.1:5
  30 36 30 3b 72 70 6f 72 74 3d 35 30 36 30 3b 62 060;rport=5060;b
  72 61 6e 63 68 3d 7a 39 68 47 34 62 4b 33 34 62 ranch=z9hG4bK34b
  32 36 33 63 32 37 33 33 61 35 32 34 66 64 65 64 263c2733a524fded
  36 31 33 61 64 65 38 62 31 64 34 39 38 0d 0a 56 613ade8b1d498..V
  69 61 3a 20 53 49 50 2f 32 2e 30 2f 55 44 50 20 ia: SIP/2.0/UDP 
  31 39 32 2e 31 36 38 2e 31 31 2e 35 31 3b 72 70 192.168.11.51;rp
  6f 72 74 3b 62 72 61 6e 63 68 3d 7a 39 68 47 34 ort;branch=z9hG4
  62 4b 70 78 7a 6d 64 6f 72 74 0d 0a 52 65 63 6f bKpxzmdort..Reco
  72 64 2d 52 6f 75 74 65 3a 20 3c 73 69 70 3a 32 rd-Route: ..
  46 72 6f 6d 3a 20 22 63 64 31 30 31 30 31 31 40 From: "cd101011@
  31 39 32 2e 31 36 38 2e 31 31 2e 31 22 20 3c 73 192.168.11.1" ;tag=nm
  75 72 79 0d 0a 54 6f 3a 20 3c 73 69 70 3a 63 64 ury..To: ;tag=zcojc.
  0a 43 61 6c 6c 2d 49 44 3a 

[SR-Users] 'from' user != auth username

2014-12-30 Thread Dima T.
Hello,

I need migrate users from the old proprietary softswitch but they have
predefined from/to header which is differ from auth username.
I read about flags in auth_check but I need strict pairs from user/auth
username.
How this authentication scheme could be implemented with Kamailio?



-- Dmitry
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio 3.2.2 Error - usrloc

2012-04-05 Thread Gilbert T. Gutierrez, Jr.

Centos6 x64
Kamailio 3.2.2 installed using RPMs installed from 
http://download.opensuse.org/repositories/home:/kamailio:/telephony/CentOS_CentOS-6/


I am using MySQL as the backend to this system and am setting up a 
multidomain server. I am slowly getting all the parts I want put 
together but I keep getting the below error everytime I restart the 
service...


Apr  5 15:56:58 test3 /usr/sbin/kamailio[11565]: CRITICAL: usrloc 
[udomain.c:439]: empty domain record for user 100...skipping


I have a couple users that go by 100. Below is my subscriber database 
which has a domain for each user...


mysql> select * from subscriber;
++--+---+--+---+--+--+--+
| id | username | domain| password | email_address | 
ha1  | ha1b | rpid |

++--+---+--+---+--+--+--+
|  5 | 100  | test3..com |   |   | 
a872d8611e8e5a0d5e02d5c53b44363d | 9c7c858342a79a9fb4caa5f3bdaa4a90 | NULL |
|  6 | 101  | test3..com |   |   | 
a4c9cecfa57f211f2dfff2b92a99d27d | 891f84cb602527e64ce63cac5239c8ec | NULL |
|  3 | 100  | test2..com |   |   | 
b4e5250cb60357081c731a8340907577 | dfc878dfefb427199673a08f839319e6 | NULL |
|  4 | 101  | test2..com |   |   | 
a19dba81db7fb43adcd81b6ea5376018 | 480b80d129f575fb999106e9d25fd5e8 | NULL |
|  8 | 102  | test2..com |   |   | 
b09c561b6177c3e0a2a8b1b96749dffe | 1a9ed92187bf7cf0e88b03075d530877 | NULL |

++--+---+--+---+--+--+--+
5 rows in set (0.00 sec)

Where is this user coming from? How do I get rid of this error?

Thanks in advance.
Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 3.2.2 Error - usrloc

2012-04-06 Thread Gilbert T. Gutierrez, Jr.
I realized I did not post to the list on my reply, so here is what I 
sent to Daniel.


Daniel,
I am using the default configuration with some mods that I have made to 
some of the routing sections. Aside from the module sections included in 
the default configuration file, I am using the lcr module and the sqlops 
module. I have not made any changes to the userloc module parameters 
from the default configuration.


#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
#!define WITH_MULTIDOMAIN
#!define WITH_ALIASDB


# - usrloc params -
/* enable DB persistency for location entries */
#!ifdef WITH_USRLOCDB
modparam("usrloc", "db_url", DBURL)
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "use_domain", MULTIDOMAIN)
#!endif

Because I have defined WITH_MULTIDOMAIN, that last modparam is 1. 
Everything that I have done seems to be working OK from what I have 
seen. I just see this error that I don't expect.


Thank you and Happy Easter,
Gilbert


On 4/6/2012 1:54 AM, Daniel-Constantin Mierla wrote:

Hello,

have you changed the domain column name via usrloc module parameters?

In the code all looks ok, maybe sharing the module parameters you set 
for usrloc module will help to track what happens.


Cheers,
Daniel

On 4/6/12 1:19 AM, Gilbert T. Gutierrez, Jr. wrote:

Centos6 x64
Kamailio 3.2.2 installed using RPMs installed from 
http://download.opensuse.org/repositories/home:/kamailio:/telephony/CentOS_CentOS-6/


I am using MySQL as the backend to this system and am setting up a 
multidomain server. I am slowly getting all the parts I want put 
together but I keep getting the below error everytime I restart the 
service...


Apr  5 15:56:58 test3 /usr/sbin/kamailio[11565]: CRITICAL: usrloc 
[udomain.c:439]: empty domain record for user 100...skipping


I have a couple users that go by 100. Below is my subscriber database 
which has a domain for each user...


mysql> select * from subscriber;
++--+---+--+---+--+--+--+ 

| id | username | domain| password | email_address | 
ha1  | ha1b | 
rpid |
++--+---+--+---+--+--+--+ 

|  5 | 100  | test3..com |   |   | 
a872d8611e8e5a0d5e02d5c53b44363d | 9c7c858342a79a9fb4caa5f3bdaa4a90 | 
NULL |
|  6 | 101  | test3..com |   |   | 
a4c9cecfa57f211f2dfff2b92a99d27d | 891f84cb602527e64ce63cac5239c8ec | 
NULL |
|  3 | 100  | test2..com |   |   | 
b4e5250cb60357081c731a8340907577 | dfc878dfefb427199673a08f839319e6 | 
NULL |
|  4 | 101  | test2..com |   |   | 
a19dba81db7fb43adcd81b6ea5376018 | 480b80d129f575fb999106e9d25fd5e8 | 
NULL |
|  8 | 102  | test2..com |   |   | 
b09c561b6177c3e0a2a8b1b96749dffe | 1a9ed92187bf7cf0e88b03075d530877 | 
NULL |
++--+---+--+---+--+--+--+ 


5 rows in set (0.00 sec)

Where is this user coming from? How do I get rid of this error?

Thanks in advance.
Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users






___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 3.2.2 Error - usrloc

2012-04-09 Thread Gilbert T. Gutierrez, Jr.
Yes, everything is running fine, I only get that error when I start or 
restart Kamailio.


Domain:: location table=512 records=4 max_slot=1
AOR:: 1...@.com
Contact:: sip:100@216.224.227.116:5060 Q=
Expires:: 3568
Callid:: 773e1aaf0c1ca1e6@RV80NTAw
Cseq:: 2
User-agent:: ewua/1.0
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:216.224.225.42:5060
Methods:: 4751
AOR:: 1...@xxyy.com
Contact:: sip:101@216.224.227.114:5060 Q=
Expires:: 3589
Callid:: 5f4a23b23970b344@RV80NTAw
Cseq:: 2
User-agent:: ewua/1.0
State:: CS_NEW
Flags:: 0
Cflag:: 0
Socket:: udp:216.224.225.42:5060
Methods:: 4751
AOR:: 1...@xxyy.com
Contact:: sip:100@216.224.227.114:5060 Q=
Expires:: 3589
Callid:: 66d379b468c57941@RV80NTAw
Cseq:: 2
User-agent:: ewua/1.0
State:: CS_NEW
Flags:: 0
Cflag:: 0
Socket:: udp:216.224.225.42:5060
Methods:: 4751
AOR:: 1...@.com
Contact:: sip:101@216.224.227.116:5060 Q=
Expires:: 3568
Callid:: 4962838a6cbb7477@RV80NTAw
Cseq:: 2
User-agent:: ewua/1.0
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:216.224.225.42:5060
Methods:: 4751



Gilbert


On 4/9/2012 3:01 AM, Daniel-Constantin Mierla wrote:

Hello,

so, if everything runs fine, can you dump the content of the records 
from memory and see if everything is loaded there:


kamctl ul show

Cheers,
Daniel

On 4/6/12 1:19 AM, Gilbert T. Gutierrez, Jr. wrote:

Centos6 x64
Kamailio 3.2.2 installed using RPMs installed from 
http://download.opensuse.org/repositories/home:/kamailio:/telephony/CentOS_CentOS-6/


I am using MySQL as the backend to this system and am setting up a 
multidomain server. I am slowly getting all the parts I want put 
together but I keep getting the below error everytime I restart the 
service...


Apr  5 15:56:58 test3 /usr/sbin/kamailio[11565]: CRITICAL: usrloc 
[udomain.c:439]: empty domain record for user 100...skipping


I have a couple users that go by 100. Below is my subscriber database 
which has a domain for each user...


mysql> select * from subscriber;
++--+---+--+---+--+--+--+ 

| id | username | domain| password | email_address | 
ha1  | ha1b | 
rpid |
++--+---+--+---+--+--+--+ 

|  5 | 100  | test3..com |   |   | 
a872d8611e8e5a0d5e02d5c53b44363d | 9c7c858342a79a9fb4caa5f3bdaa4a90 | 
NULL |
|  6 | 101  | test3..com |   |   | 
a4c9cecfa57f211f2dfff2b92a99d27d | 891f84cb602527e64ce63cac5239c8ec | 
NULL |
|  3 | 100  | test2..com |   |   | 
b4e5250cb60357081c731a8340907577 | dfc878dfefb427199673a08f839319e6 | 
NULL |
|  4 | 101  | test2..com |   |   | 
a19dba81db7fb43adcd81b6ea5376018 | 480b80d129f575fb999106e9d25fd5e8 | 
NULL |
|  8 | 102  | test2..com |   |   | 
b09c561b6177c3e0a2a8b1b96749dffe | 1a9ed92187bf7cf0e88b03075d530877 | 
NULL |
++--+---+--+---+--+--+--+ 


5 rows in set (0.00 sec)

Where is this user coming from? How do I get rid of this error?

Thanks in advance.
Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users





___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Variable $fu Kamailio 3.2

2012-04-09 Thread Gilbert T. Gutierrez, Jr.
I wrote the code below to rewrite an extension to a phone number (It is 
called in route[LOCATION]). This code works fine with MULTIDOMAIN 
enabled but when I run it as a single domain the line $fu=$var(b); does 
not seem to work..  You can see that I have several xlog lines 
outputting the variable values into my /var/log/messages. $var(b) has 
the correct value in it, so I do not know what is happening. I have also 
included the /var/log/messages output which I redacted the phone number, 
domain, and extension for security purposes. I am sure I am going about 
this backwards, but can someone provide me some guidance as to what is 
going wrong?


Thank you,
Gilbert

# Rewrite - Gilbert
route[REWRITE] {
# This section rewrites the outbound calling number so that caller id 
works correctly.

#!ifdef WITH_REWRITE
# lookup an outbound number to replace the extension with
$var(b)="NO REV";
sql_xquery("ca","select number from pioutalias where 
username='$fU'","ra");

# determine if a outbound number exists
if ($xavp(ra=>number)) {
$var(b)="sip:" + $xavp(ra=>number) + "@" + $fd;
xlog("L_INFO","var(b): '$var(b)'");
xlog("L_INFO","fu: '$fu'");
# Assign the outbound calling number
$fu=$var(b);
xlog("L_INFO","New fu: '$fu'");
}
sql_result_free("ra");
# see if it found a number and log if it did not
if ($var(b)=="NO REV")
xlog("L_INFO","No number found for extension: '$fu'");
#!endif
}


/var/log/messages output

Apr  9 14:38:38 tempfax /usr/sbin/kamailio[6088]: INFO: 

Re: [SR-Users] Variable $fu Kamailio 3.2

2012-04-10 Thread Gilbert T. Gutierrez, Jr.

Daniel and Alex,

Obviously I stumbled into a way to do things that has been illegal in 
the past. How do I do this the old way? I have been looking for examples 
and hints online but have only found references to modules and examples 
using Kamailio compiled as OpenSER. I am using Kamailio from RPMs so I 
only have modules and modules_k.


The issue I was having was that my extension (either 3 digit or 7 digit) 
was showing up as the callerid when I made outside calls. I created a 
reverse table that you look up the correct number to show the callee. I 
also add the domain to the query when I have multidomain enabled. On my 
test box for multidomain which I am developing in parallel, my code 
works and $fu is set to what I want and the callee gets what I want them 
to see. It is odd to me that it works on one box with multidomain and 
not the other with multidomain disabled.


Thank you,
Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet



On 4/10/2012 1:07 AM, Daniel-Constantin Mierla wrote:

Hello,

On 4/10/12 4:05 AM, Alex Balashov wrote:

$fu is not mutable.


actually it is starting with v3.2.0. But it is not visible in the 
script, like the other operations performed on the headers -- they 
operations are kept as a diff (patch) list, not applied immediately.


So, you will see the new From header when the message is sent to the 
network, before that is the original value. You can use 
msg_apply_changes() to make the changes visible immediately.


Cheers,
Daniel



--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/, http://www.alexbalashov.com

"Gilbert T. Gutierrez, Jr."  wrote:


I wrote the code below to rewrite an extension to a phone number (It is
called in route[LOCATION]). This code works fine with MULTIDOMAIN
enabled but when I run it as a single domain the line $fu=$var(b); does
not seem to work..  You can see that I have several xlog lines
outputting the variable values into my /var/log/messages. $var(b) has
the correct value in it, so I do not know what is happening. I have 
also
included the /var/log/messages output which I redacted the phone 
number,

domain, and extension for security purposes. I am sure I am going about
this backwards, but can someone provide me some guidance as to what is
going wrong?

Thank you,
Gilbert

# Rewrite - Gilbert
route[REWRITE] {
# This section rewrites the outbound calling number so that caller id
works correctly.
#!ifdef WITH_REWRITE
 # lookup an outbound number to replace the extension with
 $var(b)="NO REV";
 sql_xquery("ca","select number from pioutalias where
username='$fU'","ra");
 # determine if a outbound number exists
 if ($xavp(ra=>number)) {
 $var(b)="sip:" + $xavp(ra=>number) + "@" + $fd;
 xlog("L_INFO","var(b): '$var(b)'");
 xlog("L_INFO","fu: '$fu'");
 # Assign the outbound calling number
 $fu=$var(b);
 xlog("L_INFO","New fu: '$fu'");
 }
 sql_result_free("ra");
 # see if it found a number and log if it did not
 if ($var(b)=="NO REV")
 xlog("L_INFO","No number found for extension: '$fu'");
#!endif
}


/var/log/messages output

Apr  9 14:38:38 tempfax /usr/sbin/kamailio[6088]: INFO:

Re: [SR-Users] Variable $fu Kamailio 3.2

2012-04-10 Thread Gilbert T. Gutierrez, Jr.

Actually I figured it out.  Here is the code I used to fix my issue.


route[REWRITE] {
# This section rewrites the outbound calling number so that caller id 
works correctly.

#!ifdef WITH_REWRITE
# lookup an outbound number to replace the extension with
$var(b)="NO REV";
sql_xquery("ca","select number from pioutalias where 
username='$fU' and domain='$fd'","ra");

# determine if a outbound number exists
if ($xavp(ra=>number)) {
$var(b)="sip:" + $xavp(ra=>number) + "@" + $fd;

subst('/^P-Asserted-Identity:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/P-Asserted-Identity:\1$var(b)\2/ig');

}
sql_result_free("ra");
# see if it found a number and log if it did not
if ($var(b)=="NO REV")
xlog("L_INFO","No number found for extension: 
'$fu'");

#!endif
return;
}

Your response referencing "msg_apply_changes()" lead me to the module 
"textops.so" (Though msg_apply_changes() is in module textopsx.so). I am 
not sure what the '1' and the '2' in my regular expression do.  I assume 
they refer to the characters captured in the '(.*)' sections of the 
regular expression (I am terrible with regular expressions). Basically 
what I needed was to replace the P-Asserted-Identity line in the header.



Thanks again,
Gilbert




On 4/10/2012 1:25 PM, Daniel-Constantin Mierla wrote:

Hello,


On 4/10/12 7:23 PM, Gilbert T. Gutierrez, Jr. wrote:

Daniel and Alex,

Obviously I stumbled into a way to do things that has been illegal in 
the past. How do I do this the old way? I have been looking for 
examples and hints online but have only found references to modules 
and examples using Kamailio compiled as OpenSER. I am using Kamailio 
from RPMs so I only have modules and modules_k.
I don't really get what you mean. Do you need a solution for an older 
version? openser was the old name for kamailio, all modules that 
existed during openser name are in modules/ or modules_k/. Starting 
with 3.2.0, you can directly assign value to $fu, previously the 
solution was to use uac_replace_from() of uac module, or play with 
functions from textops module.




The issue I was having was that my extension (either 3 digit or 7 
digit) was showing up as the callerid when I made outside calls. I 
created a reverse table that you look up the correct number to show 
the callee. I also add the domain to the query when I have 
multidomain enabled. On my test box for multidomain which I am 
developing in parallel, my code works and $fu is set to what I want 
and the callee gets what I want them to see. It is odd to me that it 
works on one box with multidomain and not the other with multidomain 
disabled.


Do you get any error messages in the log where it does not work? Add 
some xlog(...) to print the values used in the operations. debugger 
module may help you to see if the action is actually executed.


Btw, if you need the From header to be reverted in the reply, 
uac_replace_from() is the better way to go.


Cheers,
Daniel


Thank you,
Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet



On 4/10/2012 1:07 AM, Daniel-Constantin Mierla wrote:

Hello,

On 4/10/12 4:05 AM, Alex Balashov wrote:

$fu is not mutable.


actually it is starting with v3.2.0. But it is not visible in the 
script, like the other operations performed on the headers -- they 
operations are kept as a diff (patch) list, not applied immediately.


So, you will see the new From header when the message is sent to the 
network, before that is the original value. You can use 
msg_apply_changes() to make the changes visible immediately.


Cheers,
Daniel



--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/, http://www.alexbalashov.com

"Gilbert T. Gutierrez, Jr."  wrote:

I wrote the code below to rewrite an extension to a phone number 
(It is

called in route[LOCATION]). This code works fine with MULTIDOMAIN
enabled but when I run it as a single domain the line $fu=$var(b); 
does

not seem to work..  You can see that I have several xlog lines
outputting the variable values into my /var/log/messages. $var(b) has
the correct value in it, so I do not know what is happening. I 
have also
included the /var/log/messages output which I redacted the phone 
number,
domain, and extension for security purposes. I am sure I am going 
about
this backwards, but can someone provide me some guidance as to 
what is

going wrong?

Thank you,
Gilbert

# Rewrite - Gilbert
route[REWRITE] {
# This section rewrites the outboun

[SR-Users] OT - Consultation

2013-09-25 Thread Gilbert T. Gutierrez, Jr.
I looking to hire a consultant to build a new multi-tenant solution for 
my organization. I do not have the time to do it myself nor the staff. 
If you are a consultant interested in more details, please contact me 
off list.


Sorry to post an off topic email to this list, I could not find a 
Kamailio list for this type of post.


Gilbert T. Gutierrez, Jr.
Operations Manager
Phoenix Internet
gilber...@phoenixinternet.net

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] avpops issue

2014-05-22 Thread Gilbert T. Gutierrez, Jr.
I am trying to setup call forwarding but I am getting a failure when I 
attempt to implement it.


Kamailio Version 4.1.1
Centos 6 x64
Using precompiled RPMs from telephony.repo

I am following guidance from the following urls...
http://www.kamailio.org/wiki/tutorials/mini-howto-admin/call_forwarding
http://www.kamailio.org/dokuwiki/doku.php/tutorials:avpops
http://www.kamailio.org/dokuwiki/doku.php/examples:set-blind-call-forwarding


0(16018) ERROR:  [cfg.y:3272]: yyparse(): cfg. parser: failed to 
find command is_user_in
 0(16018) :  [cfg.y:3411]: yyerror_at(): parse error in config 
file //etc/kamailio/kamailio.cfg, line 1046, column 41: unknown command, 
missing loadmodule?


 0(16018) ERROR:  [cfg.y:3272]: yyparse(): cfg. parser: failed to 
find command avp_write
 0(16018) :  [cfg.y:3411]: yyerror_at(): parse error in config 
file //etc/kamailio/kamailio.cfg, line 1048, column 39: unknown command, 
missing loadmodule?


My understanding is that when I load module avpops that it should 
include those 2 procedures (avp_write and is_user_in). I am loading the 
module avpops.so


Can someone please set me straight.  Thank you.

Gilbert T. Gutierrez, Jr.
Phoenix Internet


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] avpops issue

2014-05-22 Thread Gilbert T. Gutierrez, Jr.
After I posted, I saw that the function had been discontinued. Thank you 
for your help. I will look into the group module. I do not have the 
group module loaded. I will look into that module.


Gilbert

On 5/22/2014 2:09 PM, Fred Posner wrote:

For the is_user_in... are you loading the group module?

For avp_write, that function hasn't existed in some time. You can use
logic such as:

$avp(s:fwd_blind) = $ru;

Fred Posner
The Palner Group, Inc.
503-914-0999 (direct)
954-472-2896 (fax)

Good. Fast. Cheap. <- Pick two.

On 05/22/2014 04:49 PM, Gilbert T. Gutierrez, Jr. wrote:

I am trying to setup call forwarding but I am getting a failure when I
attempt to implement it.

Kamailio Version 4.1.1
Centos 6 x64
Using precompiled RPMs from telephony.repo

I am following guidance from the following urls...
http://www.kamailio.org/wiki/tutorials/mini-howto-admin/call_forwarding
http://www.kamailio.org/dokuwiki/doku.php/tutorials:avpops
http://www.kamailio.org/dokuwiki/doku.php/examples:set-blind-call-forwarding



0(16018) ERROR:  [cfg.y:3272]: yyparse(): cfg. parser: failed to
find command is_user_in
  0(16018) :  [cfg.y:3411]: yyerror_at(): parse error in config
file //etc/kamailio/kamailio.cfg, line 1046, column 41: unknown command,
missing loadmodule?

  0(16018) ERROR:  [cfg.y:3272]: yyparse(): cfg. parser: failed to
find command avp_write
  0(16018) :  [cfg.y:3411]: yyerror_at(): parse error in config
file //etc/kamailio/kamailio.cfg, line 1048, column 39: unknown command,
missing loadmodule?

My understanding is that when I load module avpops that it should
include those 2 procedures (avp_write and is_user_in). I am loading the
module avpops.so

Can someone please set me straight.  Thank you.

Gilbert T. Gutierrez, Jr.
Phoenix Internet


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Interpreting messages in log

2014-05-28 Thread Gilbert T. Gutierrez, Jr.

Can someone help me interpret what I a seeing in my log?

Gilbert

May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=521 a=5 n=route
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=665 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=625 a=24 n=has_totag
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=525 a=24 n=t_check_trans
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=528 a=5 n=route
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=797 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=784 a=25 n=is_method
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=792 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=787 a=27 n=auth_check
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=788 a=26 n=auth_challenge
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=789 a=2 n=exit



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Interpreting messages in log

2014-05-28 Thread Gilbert T. Gutierrez, Jr.

Never mind  I should look before I post. Sorry for the clutter.

Gilbert

On 5/28/2014 9:55 AM, Gilbert T. Gutierrez, Jr. wrote:

Can someone help me interpret what I a seeing in my log?

Gilbert

May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=521 a=5 n=route
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=665 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=625 a=24 n=has_totag
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=525 a=24 n=t_check_trans
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=528 a=5 n=route
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=797 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=784 a=25 n=is_method
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=792 a=16 n=if
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=787 a=27 n=auth_check
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=788 a=26 n=auth_challenge
May 28 09:53:09 faxsvr /usr/sbin/kamailio[1811]: ERROR: *** cfgtrace: 
c=[//etc/kamailio/kamailio.cfg] l=789 a=2 n=exit



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] 4.1 Compilation issue

2014-08-03 Thread Gilbert T. Gutierrez, Jr.

CentOS6.5
Kamailio 4.1

I compiled Kamailio as follows so that the configuration file would be 
in "/etc/kamailio" rather than "/usr/local/etc/kamailio/"...


make cfg_prefix=/ all
make cfg_prefix=/ install

When I try to start kamailio I get the following error...

Not starting : invalid configuration file!

ERROR: loading config file(/usr/local/etc/kamailio/kamailio.cfg): No 
such file or directory


I can find no reference in the init file to that location (which does 
not exist). Did I use the wrong options in make?


Gilbert

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] 4.1 Compilation issue

2014-08-04 Thread Gilbert T. Gutierrez, Jr.
This is a new machine that going to be used for testing. This is the 
only instance, compiled from GIT. I can try recompiling it but I believe 
I compiled it with the cfg option as listed.


[root@localhost ~]# kamailio -I
Print out of kamailio internals
  Version: kamailio 4.1.4 (x86_64/linux) 4eb7b5
  Default config: /usr/local/etc/kamailio/kamailio.cfg
  Default paths to modules: /usr/local/lib64/kamailio/modules
  Compile flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, 
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, 
PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, 
HAVE_RESOLV_RES

  MAX_RECV_BUFFER_SIZE=262144
  MAX_LISTEN=16
  MAX_URI_SIZE=1024
  BUF_SIZE=65535
  DEFAULT PKG_SIZE=4MB
  DEFAULT SHM_SIZE=32MB
  ADAPTIVE_WAIT_LOOPS=1024
  TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select
  Source code revision ID: 4eb7b5
  Compiled with: gcc 4.4.7
  Compiled on: 16:27:56 Jul 31 2014
Thank you for flying kamailio!

Gilbert



On 8/4/2014 2:46 AM, Daniel-Constantin Mierla wrote:

Hello,

do you have any other kamailio instance installed before?

Can you give the output of 'kamailio -I'? (that's an upper case i).

Cheers,
Daniel

On 03/08/14 20:28, Gilbert T. Gutierrez, Jr. wrote:

CentOS6.5
Kamailio 4.1

I compiled Kamailio as follows so that the configuration file would 
be in "/etc/kamailio" rather than "/usr/local/etc/kamailio/"...


make cfg_prefix=/ all
make cfg_prefix=/ install

When I try to start kamailio I get the following error...

Not starting : invalid configuration file!

ERROR: loading config file(/usr/local/etc/kamailio/kamailio.cfg): No 
such file or directory


I can find no reference in the init file to that location (which does 
not exist). Did I use the wrong options in make?


Gilbert

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users





___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users