[OpenSIPS-Users] Questions in opensips
Rodrigo Pimenta Carvalho
pimenta at inatel.br
Tue Sep 29 19:16:55 CEST 2015
Hi.
I'm new to OpenSIPS too and I have received good help from experts that access this forum.
But, one point that you have to do is access a database to get the information about the PBX, haven't you? For this, you can use the module AVPOP:
modparam("avpops","db_url","sqlite:///usr/local/opensips_proxy/sqlite") # CUSTOMIZE ME
That is, you can use a module that allows you to access the database. In this example, I use SQLite.
Are you familiar with the database handling actions via such module?
To get data from database, you can do something like this:
avp_db_query(put sql query here, "$avp(myAvp)"); # the avp will contain the query result.
About the others details, like forwarding calls, someone expert might reply to you.
You SQL will be similar to: select PBX from table where Exten = 'extension' and CustomerContext = 'the customer context';
{exten} & {CustomerContext}, the query returns a value of which PBX
Tell me if this information is useful for you, please.
Regards.
RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
________________________________
De: users-bounces at lists.opensips.org <users-bounces at lists.opensips.org> em nome de Travis Manson-Drake <travism at simplybits.com>
Enviado: terça-feira, 29 de setembro de 2015 13:54
Para: Users at lists.opensips.org
Assunto: [OpenSIPS-Users] Questions in opensips
Hello everyone,
I wanted to pick your brains and see if any of you have done something like this before, or might eb able to send me in the right direction.
Here's what I'm trying to accomplish.
Thought process
Sip packet comes into proxy
- Proxy parses sip message, and checks from_uri (for example {exten}{CustomerConetxt}@proxyIPaddr)
- once the proxy parses the data, we query a database.
- based on the value of {exten} & {CustomerContext}, the query returns a value of which PBX this {exten}&{CustomerContext} belongs to.
- once this info has been returned to the proxy it then manipulates the dest_uri to something like {exten}&{CustomerContext}@PBX DNS
At this point the sip message is forwarded onto the appropriate PBX, and we simply Record_Route for future communications.
I know I can hard code the PBX's value in the sip server of the UAC, and just have the proxy do what it does.
But what I'm really trying to go for is to simply hardcode the info for a sip proxy, have the UAC send its request to it, then it forwards on traffic to the appropriate PBX based upon the value of the from_uri
With that being said:
How would I do this?
I had looked at sipmsgops and some of its functions however I can't seem to find one that will enable me to pull just the dest uri, & extract info from it
Is there also a function in sipmsgops for manipulating the dest_uri?
Any input is greatly appreciated!
Thank you for your time,
Travis Manson-Drake
Voice Systems Analyst L1
Simply Bits, LLC
Now You're Thinkin' Smart!
5225 N. Sabino Canyon Road
Tucson, AZ 85750
Phone: 520-545-0311
Fax: 520-545-7252
Support Hotline: 5205450333
www.simplybits.com<http://www.simplybits.com/>
Internet - Phone - Business Technology Solutions | Simply Bits
Providing buisnesses with qualtiy solutions for Internet Service, VoIP Phone Service, Fax to email, Website Design, Internet Marketing and much more.
Leia mais...<http://www.simplybits.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150929/ee5cfbdc/attachment.htm>
More information about the Users
mailing list