I have noticed the wiki is pretty much non-existant on the subject of custom events.
From my understanding of the system thus far, I could create a number of custom events that my applications can react to and perform busienss logic.
One specific example: I could connect to FS and fire an event "MYPROJECT::OUTBOUND_DIAL" which a separate application could listen for and process further. I might therefore have a chain of small apps developing these and reacting at various stages. Is my understanding correct? Can I therefore register an application to listen for MYPROJECT::MY_CUSTOM_EVENT and wait until another of my apps fires it? The next obvious question is how parameter handling works... But I shall try to walk before running... Thanks, James
On Aug 18, 2008, at 8:48 AM, James Green wrote:
I have noticed the wiki is pretty much non-existant on the subject of custom events.
Probably true :( The best docs for this are generated by doxygen : http://www.freeswitch.org/docs/switch__types_8h.html#a658
From my understanding of the system thus far, I could create a number of custom events that my applications can react to and perform busienss logic.
Correct
One specific example: I could connect to FS and fire an event "MYPROJECT::OUTBOUND_DIAL" which a separate application could listen for and process further. I might therefore have a chain of small apps developing these and reacting at various stages.
Is my understanding correct? Can I therefore register an application to listen for MYPROJECT::MY_CUSTOM_EVENT and wait until another of my apps fires it? The next obvious question is how parameter handling works...
All Correct. Params are handled as name/value pair headers in the event. To add headers see switch_event_add_header/ switch_event_add_header_string functions. You can access these with switch_event_get_header. Events also have bodies switvh_event_add_body/switch_event_get_body. A full detail of the event functions is at http://www.freeswitch.org/docs/switch__event_8h.html .
But I shall try to walk before running...
Thanks,
James
Mike
Hi all, I'm trying to get run FreeSWITCH behind NAT with users behind the same NAT, on public IP addresses and also behind the other NAT. I think I need different sofia profiles for them. Thats simple :-) But what I'm missing is how to choose proper profile for inbound call to the users. And if I have to use multiply registrations, it is even harder :-) Lets say I have profile A for users behind same NAT and profile B for the others. And than comes call for some user. How should I know what profile I need? sofia/A/user%$${domain} or sofia/B/user%$${domain} And in case if user is registered more than once (at first from behind the same NAT and at second from the other NAT) I really don't know how dial string should look like :-) Could someone, please, point me to some docs (I'm not able to find it) or explain it directly? I really appreciate it :-) Thank you. Best regards, kokoska.rokoska
On Aug 21, 2008, at 9:32 AM, kokoska.rokoska wrote:
Hi all,
I'm trying to get run FreeSWITCH behind NAT with users behind the same NAT, on public IP addresses and also behind the other NAT.
I am trying to do the exact same thing and haven't figured it out yet either... It does seem to me that he different profiles are differentiated by the registration port. ie if you use "sofia status" from the command line you can see the different profiles. If you register on port 5060, you are on one profile if you register on port 5070 another, 5080, ..etc. Hope this is right? Maybe it's helpful? Marty
I think I need different sofia profiles for them. Thats simple :-) But what I'm missing is how to choose proper profile for inbound call to the users. And if I have to use multiply registrations, it is even harder :-)
Lets say I have profile A for users behind same NAT and profile B for the others.
And than comes call for some user. How should I know what profile I need?
sofia/A/user%$${domain} or sofia/B/user%$${domain}
And in case if user is registered more than once (at first from behind the same NAT and at second from the other NAT) I really don't know how dial string should look like :-)
Could someone, please, point me to some docs (I'm not able to find it) or explain it directly? I really appreciate it :-) Thank you.
Best regards,
kokoska.rokoska
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- users http://www.freeswitch.org
Martin Joseph napsal(a):
On Aug 21, 2008, at 9:32 AM, kokoska.rokoska wrote:
Hi all,
I'm trying to get run FreeSWITCH behind NAT with users behind the same NAT, on public IP addresses and also behind the other NAT.
I am trying to do the exact same thing and haven't figured it out yet either...
It does seem to me that he different profiles are differentiated by the registration port.
ie if you use "sofia status" from the command line you can see the different profiles. If you register on port 5060, you are on one profile if you register on port 5070 another, 5080, ..etc.
Thank you very much, Martin, for your answer! I think about this possibility - list status of all relevant sofia profiles, parse it, and try to find user I want to send call to. But it has three big disadvantages: 1. I'm afraid it is very resource intensive operation (especially at high CPS) 2. In the delay between sofia status processing and b-leg call setup user may reregister with another profile, so I send call using wrong profile 3. This workaround doesn't solve multiply registration problem But - may be - I'm completly wrong :-) Thanks once more for your help! Best regards, kokoska.rokoska
On Aug 21, 2008, at 11:24 AM, kokoska.rokoska wrote:
Martin Joseph napsal(a):
On Aug 21, 2008, at 9:32 AM, kokoska.rokoska wrote:
Hi all,
I'm trying to get run FreeSWITCH behind NAT with users behind the same NAT, on public IP addresses and also behind the other NAT.
I am trying to do the exact same thing and haven't figured it out yet either...
It does seem to me that he different profiles are differentiated by the registration port.
ie if you use "sofia status" from the command line you can see the different profiles. If you register on port 5060, you are on one profile if you register on port 5070 another, 5080, ..etc.
Thank you very much, Martin, for your answer!
I think about this possibility - list status of all relevant sofia profiles, parse it, and try to find user I want to send call to. But it has three big disadvantages: OK, I wasn't suggesting that at all. Are you suggesting your users phone is portable equipment and might be registered at either location (ie internal or external)? Why not just ring all possible extensions for that user?
1. I'm afraid it is very resource intensive operation (especially at high CPS) I wasn't suggesting that, sorry. 2. In the delay between sofia status processing and b-leg call setup user may reregister with another profile, so I send call using wrong profile 3. This workaround doesn't solve multiply registration problem I have no idea how FS handles multiple regs. I am total nub actually....
Hope this is useful, Marty
But - may be - I'm completly wrong :-)
Thanks once more for your help!
Best regards,
kokoska.rokoska
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch- users http://www.freeswitch.org
Martin Joseph napsal(a):
On Aug 21, 2008, at 11:24 AM, kokoska.rokoska wrote:
Martin Joseph napsal(a):
On Aug 21, 2008, at 9:32 AM, kokoska.rokoska wrote:
Hi all,
I'm trying to get run FreeSWITCH behind NAT with users behind the same NAT, on public IP addresses and also behind the other NAT. I am trying to do the exact same thing and haven't figured it out yet either...
It does seem to me that he different profiles are differentiated by the registration port.
ie if you use "sofia status" from the command line you can see the different profiles. If you register on port 5060, you are on one profile if you register on port 5070 another, 5080, ..etc.
Thank you very much, Martin, for your answer!
I think about this possibility - list status of all relevant sofia profiles, parse it, and try to find user I want to send call to. But it has three big disadvantages: OK, I wasn't suggesting that at all. Are you suggesting your users phone is portable equipment and might be registered at either location (ie internal or external)?
Yes, I'm sure about it :-) Mainly because they do it right now and I'm affraid, they don't want to loose this feature. BTW: Usual scenario is that users have SIP enabled GSM phones (Nokia E series) in pockets + HW SIP phones (Linksys 9xx, Snom 3xx) in the office, both registered to the same account. Thus SIP phones are (nearly always) registered to "internal" profile and GSM phone sometimes to "internal", sometimes to "external" and from time to time unregistered :-)
Why not just ring all possible extensions for that user?
It is one extension per user, but - may be - multiply contacts registered to "whatever" sofia profile I can't predict. And this is my problem - how to choose proper profile or profiles (in case of multiply regs.) Thanks very much, Martin, for you interest and help! Best regards, kokoska.rokoska
participants (4)
-
James Green
-
kokoska.rokoska
-
Martin Joseph
-
Michael Jerris