[Freeswitch-users] Gafachi Setup / Caller ID
Nick Temple
nick at intellispire.com
Thu Jun 12 09:50:39 PDT 2008
Using Javascript, I'm simply trying to originate a call:
(variables sent over XMLRPC from something similar to:
jsrun alert_cid.js $id $wave $phone $gateway $timeout $caller_id_number
$caller_id_name
)
console_log('notice', trace(session, "GOT: (" + callid + "," + greeting +
"," + phone + "," + gw + ","+ timeout + ","
+ caller_id + "," +
caller_name + ")\n"));
sessionx = new Session();
var call =
"{origination_caller_id_number=XXXXXXXX,origination_caller_id_name=XXXX,ignore_early_media=true,"
+
"originate_timeout=" + timeout +
"}" +
"sofia/gateway/" +
gw +
"/" +
phone;
console_log('notice', trace(session, "originate: " + call + "\n"));
console_log('notice', session.caller_id_Name + "\n");
rs = sessionx.originate(session, call, timeout);
console_log('debug', trace(session, "origination complete: " + rs + "\n"));
console_log('notice', sessionx.caller_id_Name + "\n");
(trace is an internal function that just adds some additional information,
such as cause, to the string)
I've traced the SIP calls, so has Gafachi, and we're not seeing the
caller_id. They are rejecting the calls because of this:
SIP/2.0 604 Invalid Calling Party Number
Via: SIP/2.0/UDP 75.101.133.137:5080
;branch=z9hG4bKm4028av6cyD0F;received=75.101.133.137;rport=5080
From: "" <sip:a6031sTVQLeOhyIV at sip.gafachi.com<sip%3Aa6031sTVQLeOhyIV at sip.gafachi.com>
;transport=udp>;tag=j8BBv5jaycaFF
To: <sip:15025482003 at sip.gafachi.com <sip%3A15025482003 at sip.gafachi.com>
>;tag=gss0c342e9c3ad2398e2f610f7ce613a089
Call-ID: b161c7c6-b33c-122b-33b2-123138006c07
CSeq: 100525131 INVITE
Server: Gafachi UAS v110.08
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE
Contact: <sip:15025482003 at 64.192.112.13 <sip%3A15025482003 at 64.192.112.13>
>
Content-Length: 0
>From reading various docs, I assume that I'm looking for the
caller_id_number in the FROM header of the INVITE sent to the gateway?
Here's my internal logs after running the code, above:
2008-06-12 12:08:52 [NOTICE] alert_cid.js:1 console_log() =>[undefined]
(undefined) GOT:
(54,/tmp/4dc180ba-37fd-1e14-ad0c-7aa0770f2d0e.wav,XX,default,30,XX,XX)
2008-06-12 12:08:52 [NOTICE] alert_cid.js:1 console_log() =>[undefined]
(undefined) originate:
{origination_caller_id_number=XX,origination_caller_id_name=XX,ignore_early_media=true,originate_timeout=30}sofia/gateway/default/XX
2008-06-12 12:08:52 [NOTICE] alert_cid.js:1 console_log() undefined <===
caller_id_number should be defined here for sure
2008-06-12 12:08:52 [NOTICE] switch_channel.c:533 switch_channel_set_name()
New Channel sofia/external/XX [d1be5806-7535-4168-8ad2-e6d787f603bd]
[SIP TRACE DELETED. relevent error portion quoted above]
2008-06-12 12:08:53 [NOTICE] sofia.c:2085 sofia_handle_sip_i_state() Hangup
sofia/external/1502XXXXXXX [CS_CONSUME_MEDIA] [NO_ROUTE_DESTINATION]
2008-06-12 12:08:53 [WARNING] mod_spidermonkey.c:2771 session_originate()
Cannot Create Outgoing Channel!
[{origination_caller_id_number=502XXXXXXX,origination_caller_id_name=XXXX,ignore_early_media=true,originate_timeout=30}sofia/gateway/default/1502XXXXXXX]
Obviously from the note below effective_caller_id_name was not correct, I
should have been using origination_caller_id_xxxx instead ... I've tried
both many times, I just happened to start tracing (grepping)
effective_caller_id_name first to see if I could get a handle on what was
going on.
I just know it's something simple I've missed ... at this point I'm just
going through the code and adding additional logging to the routines so I
can try to figure out what it is I've missed, mis-spelled or whatever - or
even hard-code the caller_id if necessary to get past this (seemingly tiny)
hurdle.
I'm at work right now, I'll try to get on IRC this evening or tomorrow.
Nick
On Thu, Jun 12, 2008 at 9:20 AM, Brian West <brian at freeswitch.org> wrote:
> I don't get what you're doing here.. effective_caller_id_number and
> origination_caller_id_number depending on if you're originating or if you're
> doing a bridge. I have verified they work. Can you elaborate on your
> situation because you shouldn't have to go digging in the code for this.
> /b
>
> On Jun 12, 2008, at 2:10 AM, Nick Temple wrote:
>
>
> I see where the caller_id_number is being set in:
> switch_core_session_outgoing_channel
>
> However my tests are showing that
>
> It looks like in , this test is returning false (no session):
>
> if (session) {
> ....
> }
>
> hence it appears that the caller_id_number part of the struct is not being
> set from th effective_caller_id_number. Later in the code it's looking for a
> channel if (channel) { .... }, which is also null, making the entire
> function pretty much a no-op in this case.
>
> Am I even looking in the right place?
>
> Thanks,
>
> Nick
>
>
>
>
>
>
>
>
>
> On Wed, Jun 11, 2008 at 9:28 PM, Brian West <brian at freeswitch.org> wrote:
>
>>
>> On Jun 11, 2008, at 8:18 PM, Nick Temple wrote:
>>
>> call = "{ignore_early_media=true,originate_timeout=30}sofia/gateway/
>> sip.gafachi.com/1XXXXXXXXXX";
>>
>>
>>
>> Try to export instead of set. The variable isn't on the b-leg so you
>> actually have it set on the a-leg or you can try this which should be
>> documented rather well on the wiki:
>>
>> call =
>> "{effective_caller_id_number=12345,ignore_early_media=true,originate_timeout=30}sofia/gateway/
>> sip.gafachi.com/1XXXXXXXXXX";
>>
>> /b
>>
>>
>> _______________________________________________
>> Freeswitch-users mailing list
>> Freeswitch-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
> Brian West
> sip:brian at freeswitch.org
>
>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080612/198353fb/attachment-0002.html
More information about the FreeSWITCH-users
mailing list