Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


93 posts

Master Geek
+1 received by user: 3


Topic # 154342 24-Oct-2014 18:56
Send private message

I have an OpenVFX line registered to a PBX in a Flash asterisk PBX.

I want to configure the system so if a call comes in and I don't answer my
desk phone, it goes back out the trunk and to my cell.

I have configured this now and it is working, however I am not getting
the caller ID of the inbound caller, but rather the caller ID of my VFX
line.

I am wanting to preserve the original caller ID when the call hits my
cell so I can see who’s calling.

I've checked with WxC and they have indicated this is possible.

My searches have turned up couple of threads [1] [2] Unfortunately it appears the information in these threads is out of date and doesn't appear to be very helpful.

Can someone who has it working with the latest version of Asterisk post how you did it?

View this topic in a long page with up to 500 replies per page Create new topic
 1 | 2
3594 posts

Uber Geek
+1 received by user: 1322

Subscriber



93 posts

Master Geek
+1 received by user: 3


  Reply # 1161761 24-Oct-2014 21:47
Send private message

Hey, as I said I did spot that thread, I did make the mods as suggested but I cam still getting the CID of my VFX line.

Here's what my /var/lib/asterisk/agi-bin/dialparties.agi looks like http://pastebin.com/kZW2MKTz (and yes, I have added the $didname = $AGI->request['agi_dnid']; declare at the top of the line with the other declares)

3594 posts

Uber Geek
+1 received by user: 1322

Subscriber

  Reply # 1161772 24-Oct-2014 22:13
Send private message

How are you sending calls out to your mobile? Are you doing a call forward? Or just sending out via a ring group? 

27074 posts

Uber Geek
+1 received by user: 6517

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  Reply # 1161777 24-Oct-2014 22:23
One person supports this post
Send private message

Simple answer is that it's not simple. There are lots of catches to using SIP 302 redirects in Asterisk. It's a lot of hard work using FreePBX.



93 posts

Master Geek
+1 received by user: 3


  Reply # 1161843 24-Oct-2014 23:28
Send private message

chevrolux, the inbound route goes to a ring group. The no-answer destination is my cell. I have also checked my outbound route and there is no CID set in the "Route CID" field.

I've have also tried changing it so the inbound route destination is a ring group with my cell # in it. That doesn't give the desired result either.

sbiddle -- ain't that the truth. Works great once set up though.

3594 posts

Uber Geek
+1 received by user: 1322

Subscriber

  Reply # 1161928 25-Oct-2014 09:15
Send private message

Because you aren't doing a call forward Asterisk is just picking another channel and sending the call out to your cell. This will always end in receiving the b party CID instead of A.

You need heaps of custom work to get this done. Start googling sip 302 haha.

13 posts

Geek
+1 received by user: 1


  Reply # 1162166 25-Oct-2014 21:33
Send private message

Hi,

I got this working a year or so again, where I could transfer the Incoming caller ID, even after I answered..
Long of the short. (and it was a while ago)

You must transfer back out the existing trunk, you cant "dial" a new call. advantage is that it frees up the incomming trunk
You probably have to patch asterisk if the new versions still don't support it. when I finally figured it out I searched and found
posts saying that the Asterisk developers were intentionally leaving out the headers because they're "not officially part of the
SIP specification" however the WXC/VFX servers all support it.

-- Just found my original Post --
http://www.geekzone.co.nz/forums.asp?forumid=65&topicid=115680

So..  Download the asterisk source, edit channels/chan_sip.c and find the sip_redirect() function and add the line

        add_diversion(&p->initreq, p);

Just before the lines

        ast_string_field_build(p, our_contact, "Transfer <sip:%s@%s>", extension, domain);
        transmit_response_reliable(p, "302 Moved Temporarily", &p->initreq);

Hopefully it will recompile with no problems (./configure, make, make install)

I haven't used FreePBX before but from what I understand its just a web interface for Asterisk just try and keep the versions the same
Luckily I had two phones (work and personal) So I could test it Work Cell -> VFX -> Personal Cell
And I think it even comes up and says "Diverted Call"

Regards,
Blair (aka antilogic)



93 posts

Master Geek
+1 received by user: 3


  Reply # 1162882 27-Oct-2014 12:01
Send private message

Ok so I have been trying all long weekend to get this to work. It appears that if I add that line & recompile asterisk, it compiles successfully with no errors thrown but chan_sip won't load.

pbx*CLI> module load chan_sip.so
Unable to load module chan_sip.so
Command 'module load chan_sip.so' failed.
pbx*CLI> module show like sip
Module Description Use Count
app_adsiprog.so Asterisk ADSI Programming Application 0
1 modules loaded


The binary has definitely been generated and is in the correct place on the file system:

$ locate chan_sip
/usr/lib/asterisk/modules/chan_sip.so
/usr/src/asterisk/channels/.chan_sip.makeopts
/usr/src/asterisk/channels/.chan_sip.moduleinfo
/usr/src/asterisk/channels/.chan_sip.o.d
/usr/src/asterisk/channels/chan_sip.c
/usr/src/asterisk/channels/chan_sip.exports
/usr/src/asterisk/channels/chan_sip.o
/usr/src/asterisk/channels/chan_sip.so


Can you take a look at where I've added the line and see if it's all good? http://pastebin.com/MHnWE04Q (see line 47).



93 posts

Master Geek
+1 received by user: 3


  Reply # 1162990 27-Oct-2014 14:49
Send private message

Ok so I got it compiled -- didn't have the right version of asterisk (1.8 vs 11). Now that everything is compiled and running, Blair can you clarify this part of your post:


"Then I simply used the Transfer() command in my dialplan

[incoming]
exten => ${VFXNUMBER},1,Transfer(${MOBILENUM})
exten => ${VFXNUMBER},n,Hangup()

Also note: I found that if you Transfer() but don't Hangup() it doesn't work"

How do I implement this?

13 posts

Geek
+1 received by user: 1


  Reply # 1163016 27-Oct-2014 15:39
Send private message

Not sure what you mean. On my system I deleted all the configs and started again.
also note you can answer the call and still transfer out retaining cid info



93 posts

Master Geek
+1 received by user: 3


  Reply # 1163090 27-Oct-2014 17:55
Send private message

Which file does that stuff go in? Using PiaF you don't modify the text files on the filesystem, everything is done via the Web UI so just trying to work out what I need to update.

I tested it as it stands and it still isn't maintaining CID.

Cheers



93 posts

Master Geek
+1 received by user: 3


  Reply # 1163937 28-Oct-2014 20:32
One person supports this post
Send private message

Well, getting this going has been more unpleasant than a colonoscopy.

I've elected to forward it right out from WxC using the feature codes so the CID works properly rather than wasting any more time on this. Will revisit this in a few versions yell

13 posts

Geek
+1 received by user: 1


  Reply # 1164087 29-Oct-2014 07:31
One person supports this post
Send private message

Ok, I've downloaded "PBX in a flash" (20650 i386) then choose to install Asterisk11, as it installed I opted for a "make Menuconfig" and when it started I switched console
Alt-F2, Logged in to a console, found the source in /usr/src/asterisk/channels/chan_sip.c then edited chan_sip.c with nano, Ctrl-W to search, turns out the function is called sip_sipredirect(struct sip_pvt *p, const char *dest)

Its about line 33147 so you can skip straight there with

nano +33147 chan_sip.c

anyway, scroll down a few lines and you will see ast_get_string_field_build(p, our_contact, "Transfer <sip............"

just before that line add add_diversion(&p->initreq, p);

Switch back to the first console (Alt-F1) and continue the build, ( I didn't change any settings, but guess you can)

I'll post once its up and running (its compiling now) and find where to add the Transfer/Hangup to the dialplan




93 posts

Master Geek
+1 received by user: 3


  Reply # 1165179 30-Oct-2014 17:08
Send private message

Any luck, antilogic?

13 posts

Geek
+1 received by user: 1


  Reply # 1165222 30-Oct-2014 18:42
Send private message

Hi, Sorry,

So I've installed and been playing with the web interface. It seems to be a bit of a pain in the butt to do anything cleaver with.

Basically what i've been trying is to create a custom dialplan (/etc/asterisk/extensions_custom.conf) and added :

[custom-transfer-plan]
exten => 1234,1,Transfer(....)
exten => 1234,n,Hangup()

but I havn't been able to find anywhere to actually pass the call in to this context.. I'll keep trying later on, but let us know if you figure this out.
Like i said, i Just created the configs from scratch and dont bother with a web interface. Maybe it can be configured as an outgoing trunk?

-Blair (antilogic)

 1 | 2
View this topic in a long page with up to 500 replies per page Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.